@@ -47,7 +47,7 @@ func TestAdmission(t *testing.T) {
47
47
},
48
48
},
49
49
}
50
- err := handler .Admit (admission .NewAttributesRecord (& pod , nil , api .Kind ("Pod" ).WithVersion ("version" ), pod .Namespace , pod .Name , api .Resource ("pods" ).WithVersion ("version" ), "" , admission .Create , false , nil ), nil )
50
+ err := handler .Admit (admission .NewAttributesRecord (& pod , nil , api .Kind ("Pod" ).WithVersion ("version" ), pod .Namespace , pod .Name , api .Resource ("pods" ).WithVersion ("version" ), "" , admission .Create , & metav1. CreateOptions {}, false , nil ), nil )
51
51
if err != nil {
52
52
t .Errorf ("Unexpected error returned from admission handler" )
53
53
}
@@ -84,7 +84,7 @@ func TestValidate(t *testing.T) {
84
84
},
85
85
}
86
86
expectedError := `pods "123" is forbidden: spec.initContainers[0].imagePullPolicy: Unsupported value: "": supported values: "Always"`
87
- err := handler .Validate (admission .NewAttributesRecord (& pod , nil , api .Kind ("Pod" ).WithVersion ("version" ), pod .Namespace , pod .Name , api .Resource ("pods" ).WithVersion ("version" ), "" , admission .Create , false , nil ), nil )
87
+ err := handler .Validate (admission .NewAttributesRecord (& pod , nil , api .Kind ("Pod" ).WithVersion ("version" ), pod .Namespace , pod .Name , api .Resource ("pods" ).WithVersion ("version" ), "" , admission .Create , & metav1. CreateOptions {}, false , nil ), nil )
88
88
if err == nil {
89
89
t .Fatal ("missing expected error" )
90
90
}
@@ -139,7 +139,7 @@ func TestOtherResources(t *testing.T) {
139
139
for _ , tc := range tests {
140
140
handler := & AlwaysPullImages {}
141
141
142
- err := handler .Admit (admission .NewAttributesRecord (tc .object , nil , api .Kind (tc .kind ).WithVersion ("version" ), namespace , name , api .Resource (tc .resource ).WithVersion ("version" ), tc .subresource , admission .Create , false , nil ), nil )
142
+ err := handler .Admit (admission .NewAttributesRecord (tc .object , nil , api .Kind (tc .kind ).WithVersion ("version" ), namespace , name , api .Resource (tc .resource ).WithVersion ("version" ), tc .subresource , admission .Create , & metav1. CreateOptions {}, false , nil ), nil )
143
143
144
144
if tc .expectError {
145
145
if err == nil {
0 commit comments