Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.): No.
What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): dry-run, metadata.name, CRD
Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT
Kubernetes version (use kubectl version):
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.0", GitCommit:"ddf47ac13c1a9483ea035a79cd7c10005ff21a6d", GitTreeState:"clean", BuildDate:"2018-12-03T21:04:45Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"9+", GitVersion:"v1.9.7-gke.11", GitCommit:"dc4f6dda6a08aae2108d7a7fdc2a44fa23900f4c", GitTreeState:"clean", BuildDate:"2018-11-10T20:22:02Z", GoVersion:"go1.9.3b4", Compiler:"gc", Platform:"linux/amd64"}
Environment:
uname -a): 4.18.10-1rodete2-amd64 #1 SMP Debian 4.18.10-1rodete2 (2018-10-09) x86_64 GNU/LinuxWhat happened: kubectl create --dry-run on a CRD with an invalid metadata.name succeeds, but kubectl create fails with an invalid name error.
What you expected to happen: kubectl create --dry-run should return that metadata.name is invalid.
How to reproduce it (as minimally and precisely as possible):
file.yaml with metadata.name: Synckubectl create -f file.yaml --dry-run [no error]kubectl create -f file.yaml [returns error since metadata.name is not a valid DNS1123 label]I believe the server side version of dry run doesn't have this problem. But you will need to run a 1.12 server with the alpha feature enabled or a 1.13 server (where it is beta) to test it.
fyi @apelisse
/sig cli
/area kubectl
/kind bug
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
I don't know what else we can do about it. Please use server-side dry-run.
Most helpful comment
I believe the server side version of dry run doesn't have this problem. But you will need to run a 1.12 server with the alpha feature enabled or a 1.13 server (where it is beta) to test it.
fyi @apelisse