mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
Fresh dep ensure
This commit is contained in:
18
vendor/k8s.io/apimachinery/pkg/runtime/codec.go
generated
vendored
18
vendor/k8s.io/apimachinery/pkg/runtime/codec.go
generated
vendored
@ -76,24 +76,6 @@ func EncodeOrDie(e Encoder, obj Object) string {
|
||||
return string(bytes)
|
||||
}
|
||||
|
||||
// DefaultingSerializer invokes defaulting after decoding.
|
||||
type DefaultingSerializer struct {
|
||||
Defaulter ObjectDefaulter
|
||||
Decoder Decoder
|
||||
// Encoder is optional to allow this type to be used as both a Decoder and an Encoder
|
||||
Encoder
|
||||
}
|
||||
|
||||
// Decode performs a decode and then allows the defaulter to act on the provided object.
|
||||
func (d DefaultingSerializer) Decode(data []byte, defaultGVK *schema.GroupVersionKind, into Object) (Object, *schema.GroupVersionKind, error) {
|
||||
obj, gvk, err := d.Decoder.Decode(data, defaultGVK, into)
|
||||
if err != nil {
|
||||
return obj, gvk, err
|
||||
}
|
||||
d.Defaulter.Default(obj)
|
||||
return obj, gvk, nil
|
||||
}
|
||||
|
||||
// UseOrCreateObject returns obj if the canonical ObjectKind returned by the provided typer matches gvk, or
|
||||
// invokes the ObjectCreator to instantiate a new gvk. Returns an error if the typer cannot find the object.
|
||||
func UseOrCreateObject(t ObjectTyper, c ObjectCreater, gvk schema.GroupVersionKind, obj Object) (Object, error) {
|
||||
|
Reference in New Issue
Block a user