kubernetes: unknown flag: --record for "kubectl create" command
What happened
I am not able to pass --record=true parameter while using kubectl create command. Hence, I can’t register change cause seen in kubectl rollout history output when I use kubectl create
$ kubectl create deployment --image=nginx --record=true
Error: unknown flag: --record
What you expected to happen:
I should record the command while using kubectl create command. The ambigious thing is that I’m able to pass --record parameter with deprecated kubectl run command. In addition to that, I can pass --record with kubectl set as expected.
How to reproduce it (as minimally and precisely as possible):
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:11:31Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:02:58Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
$ kubectl create deployment --image=nginx --record=true
Error: unknown flag: --record
Anything else we need to know?:
I’m aware of issue #40422 however --record options are deleted only for kubectl create as far as I investigate. We need to clarify the usage of change-cause in kubectl rollout history command.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 18 (5 by maintainers)
/reopen issue still present in 1.23
I saw lots of mismatchings (in version 1.15.4, probably other newer version as well) between help information/documents and the real commands output, for example:
Command ‘kubectl help create’ printed ‘–record’ is supported as an option, but when we ran 'kubectl create deployment nginx --image=nginx --record ', it gave an error like ‘Error: unknown flag: --record’.
Also, the ‘CHANGE-CAUSE’ in output of ‘kubectl rollout history’ looks like always empty now.
We may need a full review and correction in all the places including document, kubectl help information and release notes.