-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ScheduledJob to validation #1159
Add ScheduledJob to validation #1159
Conversation
One question in the tests the following validation step is defined: case *batch.Job:
if t.Namespace == "" {
t.Namespace = api.NamespaceDefault
}
// Job needs generateSelector called before validation, and job.Validate does this.
// See: https://github.com/kubernetes/kubernetes/issues/20951#issuecomment-187787040
t.ObjectMeta.UID = types.UID("fakeuid")
errors = job.Strategy.Validate(nil, t) We could replace the last line with: errors = batch_validation.ValidateJob(t) First attempt resulted in a Fail:
|
LGTM. Thanks @johscheuer. @pwittrock can we merge this? It's fixing a test that affects all PRs. |
@johscheuer the validation error you mentioned is expected (see https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/batch/validation/validation.go#L74). In real cluster, the selector and labels will be automatically generated by the server if user doesn't specify them in config. We should mimic this behavior in test. scheduledjob validation does not verify the selector matches labels, which is a bug IMO, we should fix it. @janetkuo @erictune |
scheduledjob doesn't have selectors |
Thanks @janetkuo ! |
This commit updates "cluster" to "cross-cluster" in the service mirroring section. Fixes kubernetes#1157 Signed-off-by: Ujjwal Goyal <[email protected]>
* feat: add MrErlison as a ptbr approver
Fix the tests for release-1.4 in #1123 @janetkuo added a file for a
ScheduledJob
this results in a fail:See #1067 for example. I added the file and a validation for the
ScheduledJob
.This change is