Fix dependencies
This commit is contained in:
2
vendor/k8s.io/apimachinery/pkg/runtime/codec.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/runtime/codec.go
generated
vendored
@ -29,7 +29,7 @@ import (
|
||||
|
||||
"k8s.io/apimachinery/pkg/conversion/queryparams"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// codec binds an encoder and decoder.
|
||||
|
10
vendor/k8s.io/apimachinery/pkg/runtime/codec_check.go
generated
vendored
10
vendor/k8s.io/apimachinery/pkg/runtime/codec_check.go
generated
vendored
@ -21,7 +21,6 @@ import (
|
||||
"reflect"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
)
|
||||
|
||||
// CheckCodec makes sure that the codec can encode objects like internalType,
|
||||
@ -33,14 +32,7 @@ func CheckCodec(c Codec, internalType Object, externalTypes ...schema.GroupVersi
|
||||
return fmt.Errorf("Internal type not encodable: %v", err)
|
||||
}
|
||||
for _, et := range externalTypes {
|
||||
typeMeta := TypeMeta{
|
||||
Kind: et.Kind,
|
||||
APIVersion: et.GroupVersion().String(),
|
||||
}
|
||||
exBytes, err := json.Marshal(&typeMeta)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
exBytes := []byte(fmt.Sprintf(`{"kind":"%v","apiVersion":"%v"}`, et.Kind, et.GroupVersion().String()))
|
||||
obj, err := Decode(c, exBytes)
|
||||
if err != nil {
|
||||
return fmt.Errorf("external type %s not interpretable: %v", et, err)
|
||||
|
4
vendor/k8s.io/apimachinery/pkg/runtime/converter.go
generated
vendored
4
vendor/k8s.io/apimachinery/pkg/runtime/converter.go
generated
vendored
@ -31,9 +31,9 @@ import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
"sigs.k8s.io/structured-merge-diff/v4/value"
|
||||
"sigs.k8s.io/structured-merge-diff/v3/value"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// UnstructuredConverter is an interface for converting between interface{}
|
||||
|
17
vendor/k8s.io/apimachinery/pkg/runtime/schema/group_version.go
generated
vendored
17
vendor/k8s.io/apimachinery/pkg/runtime/schema/group_version.go
generated
vendored
@ -176,6 +176,15 @@ func (gv GroupVersion) Empty() bool {
|
||||
// String puts "group" and "version" into a single "group/version" string. For the legacy v1
|
||||
// it returns "v1".
|
||||
func (gv GroupVersion) String() string {
|
||||
// special case the internal apiVersion for the legacy kube types
|
||||
if gv.Empty() {
|
||||
return ""
|
||||
}
|
||||
|
||||
// special case of "v1" for backward compatibility
|
||||
if len(gv.Group) == 0 && gv.Version == "v1" {
|
||||
return gv.Version
|
||||
}
|
||||
if len(gv.Group) > 0 {
|
||||
return gv.Group + "/" + gv.Version
|
||||
}
|
||||
@ -243,10 +252,10 @@ func (gv GroupVersion) WithResource(resource string) GroupVersionResource {
|
||||
type GroupVersions []GroupVersion
|
||||
|
||||
// Identifier implements runtime.GroupVersioner interface.
|
||||
func (gvs GroupVersions) Identifier() string {
|
||||
groupVersions := make([]string, 0, len(gvs))
|
||||
for i := range gvs {
|
||||
groupVersions = append(groupVersions, gvs[i].String())
|
||||
func (gv GroupVersions) Identifier() string {
|
||||
groupVersions := make([]string, 0, len(gv))
|
||||
for i := range gv {
|
||||
groupVersions = append(groupVersions, gv[i].String())
|
||||
}
|
||||
return fmt.Sprintf("[%s]", strings.Join(groupVersions, ","))
|
||||
}
|
||||
|
13
vendor/k8s.io/apimachinery/pkg/runtime/scheme.go
generated
vendored
13
vendor/k8s.io/apimachinery/pkg/runtime/scheme.go
generated
vendored
@ -211,19 +211,6 @@ func (s *Scheme) AddKnownTypeWithName(gvk schema.GroupVersionKind, obj Object) {
|
||||
}
|
||||
}
|
||||
s.typeToGVK[t] = append(s.typeToGVK[t], gvk)
|
||||
|
||||
// if the type implements DeepCopyInto(<obj>), register a self-conversion
|
||||
if m := reflect.ValueOf(obj).MethodByName("DeepCopyInto"); m.IsValid() && m.Type().NumIn() == 1 && m.Type().NumOut() == 0 && m.Type().In(0) == reflect.TypeOf(obj) {
|
||||
if err := s.AddGeneratedConversionFunc(obj, obj, func(a, b interface{}, scope conversion.Scope) error {
|
||||
// copy a to b
|
||||
reflect.ValueOf(a).MethodByName("DeepCopyInto").Call([]reflect.Value{reflect.ValueOf(b)})
|
||||
// clear TypeMeta to match legacy reflective conversion
|
||||
b.(Object).GetObjectKind().SetGroupVersionKind(schema.GroupVersionKind{})
|
||||
return nil
|
||||
}); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// KnownTypes returns the types known for the given version.
|
||||
|
2
vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go
generated
vendored
@ -31,7 +31,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime/serializer/recognizer"
|
||||
"k8s.io/apimachinery/pkg/util/framer"
|
||||
utilyaml "k8s.io/apimachinery/pkg/util/yaml"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// NewSerializer creates a JSON serializer that handles encoding versioned objects into the proper JSON form. If typer
|
||||
|
2
vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go
generated
vendored
2
vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go
generated
vendored
@ -25,7 +25,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// NewDefaultingCodecForScheme is a convenience method for callers that are using a scheme.
|
||||
|
Reference in New Issue
Block a user