mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Move defaulting funcs from internal to v1
This commit is contained in:
		@@ -35,15 +35,6 @@ func init() {
 | 
			
		||||
			obj.LabelSelector = labels.Everything()
 | 
			
		||||
			obj.FieldSelector = fields.Everything()
 | 
			
		||||
		},
 | 
			
		||||
		// TODO: see about moving this into v1/defaults.go
 | 
			
		||||
		func(obj *PodExecOptions) {
 | 
			
		||||
			obj.Stderr = true
 | 
			
		||||
			obj.Stdout = true
 | 
			
		||||
		},
 | 
			
		||||
		func(obj *PodAttachOptions) {
 | 
			
		||||
			obj.Stderr = true
 | 
			
		||||
			obj.Stdout = true
 | 
			
		||||
		},
 | 
			
		||||
	)
 | 
			
		||||
	Scheme.AddConversionFuncs(
 | 
			
		||||
		func(in *unversioned.Time, out *unversioned.Time, s conversion.Scope) error {
 | 
			
		||||
 
 | 
			
		||||
@@ -70,7 +70,7 @@ func roundTrip(t *testing.T, codec runtime.Codec, item runtime.Object) {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	if !api.Semantic.DeepEqual(item, obj2) {
 | 
			
		||||
		t.Errorf("1: %v: diff: %v\nCodec: %v\nSource:\n\n%#v\n\nEncoded:\n\n%s\n\nFinal:\n\n%#v", name, util.ObjectGoPrintDiff(item, obj2), codec, printer.Sprintf("%#v", item), string(data), printer.Sprintf("%#v", obj2))
 | 
			
		||||
		t.Errorf("\n1: %v: diff: %v\nCodec: %v\nSource:\n\n%#v\n\nEncoded:\n\n%s\n\nFinal:\n\n%#v", name, util.ObjectGoPrintDiff(item, obj2), codec, printer.Sprintf("%#v", item), string(data), printer.Sprintf("%#v", obj2))
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -128,7 +128,8 @@ func TestList(t *testing.T) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var nonRoundTrippableTypes = sets.NewString()
 | 
			
		||||
var nonInternalRoundTrippableTypes = sets.NewString("List", "ListOptions", "PodExecOptions", "PodAttachOptions")
 | 
			
		||||
 | 
			
		||||
var nonInternalRoundTrippableTypes = sets.NewString("List", "ListOptions")
 | 
			
		||||
var nonRoundTrippableTypesByVersion = map[string][]string{}
 | 
			
		||||
 | 
			
		||||
func TestRoundTripTypes(t *testing.T) {
 | 
			
		||||
 
 | 
			
		||||
@@ -91,6 +91,14 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer {
 | 
			
		||||
			j.LabelSelector, _ = labels.Parse("a=b")
 | 
			
		||||
			j.FieldSelector, _ = fields.ParseSelector("a=b")
 | 
			
		||||
		},
 | 
			
		||||
		func(j *api.PodExecOptions, c fuzz.Continue) {
 | 
			
		||||
			j.Stdout = true
 | 
			
		||||
			j.Stderr = true
 | 
			
		||||
		},
 | 
			
		||||
		func(j *api.PodAttachOptions, c fuzz.Continue) {
 | 
			
		||||
			j.Stdout = true
 | 
			
		||||
			j.Stderr = true
 | 
			
		||||
		},
 | 
			
		||||
		func(s *api.PodSpec, c fuzz.Continue) {
 | 
			
		||||
			c.FuzzNoCustom(s)
 | 
			
		||||
			// has a default value
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,14 @@ import (
 | 
			
		||||
 | 
			
		||||
func addDefaultingFuncs() {
 | 
			
		||||
	api.Scheme.AddDefaultingFuncs(
 | 
			
		||||
		func(obj *PodExecOptions) {
 | 
			
		||||
			obj.Stdout = true
 | 
			
		||||
			obj.Stderr = true
 | 
			
		||||
		},
 | 
			
		||||
		func(obj *PodAttachOptions) {
 | 
			
		||||
			obj.Stdout = true
 | 
			
		||||
			obj.Stderr = true
 | 
			
		||||
		},
 | 
			
		||||
		func(obj *ReplicationController) {
 | 
			
		||||
			var labels map[string]string
 | 
			
		||||
			if obj.Spec.Template != nil {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user