@@ -157,15 +157,15 @@ func TestCustomResourceValidator(t *testing.T) {
157
157
},
158
158
map [schema.GroupVersionKind ]ObjectValidator {
159
159
{Group : testGroup , Version : testVersion , Kind : testKind }: testValidator {
160
- validateCreate : func (obj runtime.Object ) field.ErrorList {
160
+ validateCreate : func (_ context. Context , obj runtime.Object ) field.ErrorList {
161
161
createFuncCalled = true
162
162
if tc .validateFuncErr {
163
163
return field.ErrorList {field .InternalError (field .NewPath ("test" ), errors .New ("TEST Error" ))}
164
164
}
165
165
funcArgObject = obj
166
166
return nil
167
167
},
168
- validateUpdate : func (obj runtime.Object , oldObj runtime.Object ) field.ErrorList {
168
+ validateUpdate : func (_ context. Context , obj runtime.Object , oldObj runtime.Object ) field.ErrorList {
169
169
if tc .validateFuncErr {
170
170
return field.ErrorList {field .InternalError (field .NewPath ("test" ), errors .New ("TEST Error" ))}
171
171
}
@@ -174,7 +174,7 @@ func TestCustomResourceValidator(t *testing.T) {
174
174
funcArgOldObject = oldObj
175
175
return nil
176
176
},
177
- validateStatusUpdate : func (obj runtime.Object , oldObj runtime.Object ) field.ErrorList {
177
+ validateStatusUpdate : func (_ context. Context , obj runtime.Object , oldObj runtime.Object ) field.ErrorList {
178
178
updateStatusFuncCalled = true
179
179
if tc .validateFuncErr {
180
180
return field.ErrorList {field .InternalError (field .NewPath ("test" ), errors .New ("TEST Error" ))}
@@ -259,20 +259,20 @@ func TestCustomResourceValidator(t *testing.T) {
259
259
}
260
260
261
261
type testValidator struct {
262
- validateCreate func (uncastObj runtime.Object ) field.ErrorList
263
- validateUpdate func (uncastObj runtime.Object , uncastOldObj runtime.Object ) field.ErrorList
264
- validateStatusUpdate func (uncastObj runtime.Object , uncastOldObj runtime.Object ) field.ErrorList
262
+ validateCreate func (_ context. Context , uncastObj runtime.Object ) field.ErrorList
263
+ validateUpdate func (_ context. Context , uncastObj runtime.Object , uncastOldObj runtime.Object ) field.ErrorList
264
+ validateStatusUpdate func (_ context. Context , uncastObj runtime.Object , uncastOldObj runtime.Object ) field.ErrorList
265
265
}
266
266
267
- func (v testValidator ) ValidateCreate (uncastObj runtime.Object ) field.ErrorList {
268
- return v .validateCreate (uncastObj )
267
+ func (v testValidator ) ValidateCreate (ctx context. Context , uncastObj runtime.Object ) field.ErrorList {
268
+ return v .validateCreate (ctx , uncastObj )
269
269
}
270
270
271
- func (v testValidator ) ValidateUpdate (uncastObj runtime.Object , uncastOldObj runtime.Object ) field.ErrorList {
272
- return v .validateUpdate (uncastObj , uncastOldObj )
271
+ func (v testValidator ) ValidateUpdate (ctx context. Context , uncastObj runtime.Object , uncastOldObj runtime.Object ) field.ErrorList {
272
+ return v .validateUpdate (ctx , uncastObj , uncastOldObj )
273
273
274
274
}
275
275
276
- func (v testValidator ) ValidateStatusUpdate (uncastObj runtime.Object , uncastOldObj runtime.Object ) field.ErrorList {
277
- return v .validateStatusUpdate (uncastObj , uncastOldObj )
276
+ func (v testValidator ) ValidateStatusUpdate (ctx context. Context , uncastObj runtime.Object , uncastOldObj runtime.Object ) field.ErrorList {
277
+ return v .validateStatusUpdate (ctx , uncastObj , uncastOldObj )
278
278
}
0 commit comments