Skip to content
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

--dry-run=true and --validate=true results in no validation performed #67168

Closed
cflewis opened this issue Aug 8, 2018 · 2 comments
Closed

--dry-run=true and --validate=true results in no validation performed #67168

cflewis opened this issue Aug 8, 2018 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one.

Comments

@cflewis
Copy link

cflewis commented Aug 8, 2018

/kind bug

What happened:
Attempting to run --dry-run=true and --validate=true reported that the object was created.

What you expected to happen:
The object should be rejected.

How to reproduce it (as minimally and precisely as possible):
Using the same files as in the documentation:

# Create the resource
% kubectl create -f resourcedefinition.yaml 
customresourcedefinition.apiextensions.k8s.io/crontabs.stable.example.com created

# This is a rejection as expected
% kubectl create -f my-crontab.yaml 
The CronTab "my-new-cron-object" is invalid: []: Invalid value: map[string]interface {}{"apiVersion":"stable.example.com/v1", "kind":"CronTab", "metadata":map[string]interface {}{"uid":"f671f1f9-9b59-11e8-ba9a-42010a8a0fe0", "selfLink":"", "clusterName":"", "name":"my-new-cron-object", "namespace":"default", "creationTimestamp":"2018-08-08T22:25:32Z"}, "spec":map[string]interface {}{"cronSpec":"* * * *", "image":"my-awesome-cron-image", "replicas":15}}: validation failure list:
spec.cronSpec in body should match '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$'
spec.replicas in body should be less than or equal to 10

# This is a create which should be rejected, but instead claims it was created, because `--dry-run` was set to true.
% kubectl create --validate=true --dry-run=true --filename=my-crontab.yaml
crontab.stable.example.com/my-new-cron-object created (dry run)

Environment:

  • Kubernetes version (use kubectl version): 1.11
  • Cloud provider or hardware configuration: Google Kubernetes Engine
  • OS (e.g. from /etc/os-release): Debian
  • Kernel (e.g. uname -a): GNU/Linux x86_64
@k8s-ci-robot
Copy link
Contributor

@cflewis: There are no sig labels on this issue. Please add a sig label.

A sig label can be added by either:

  1. mentioning a sig: @kubernetes/sig-<group-name>-<group-suffix>
    e.g., @kubernetes/sig-contributor-experience-<group-suffix> to notify the contributor experience sig, OR

  2. specifying the label manually: /sig <group-name>
    e.g., /sig scalability to apply the sig/scalability label

Note: Method 1 will trigger an email to the group. See the group list.
The <group-suffix> in method 1 has to be replaced with one of these: bugs, feature-requests, pr-reviews, test-failures, proposals

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. kind/bug Categorizes issue or PR as related to a bug. labels Aug 8, 2018
@cflewis
Copy link
Author

cflewis commented Aug 8, 2018

Closing as a dupe of #64830, but it does seem documentation is required here. The confusion is very real!

@cflewis cflewis closed this as completed Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

2 participants