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
Drop deprecated run flags and deprecate unused ones #99732
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: soltysh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/triage accepted |
Can we have a :party_parrot: here? Will review ASAP so this can ship in v1.21 |
@@ -311,10 +302,7 @@ func (o *RunOptions) Run(f cmdutil.Factory, cmd *cobra.Command, args []string) e | |||
} | |||
|
|||
generators := generateversioned.GeneratorFn("run") | |||
generator, found := generators[generateversioned.RunPodV1GeneratorName] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we are dropping the generator flag, but I'm wondering if we still shouldn't be checking the existence of this on the map. Otherwise, on the next line (names := generator.ParamNames()
) we might be calling a nil value and get a panic, if someone removes this generator :)
generators := generateversioned.GeneratorFn("expose") | ||
generator, found := generators[serviceGenerator] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same concern as above here, but I might be over concerned? :D
@soltysh just two points of concern here :) |
Good point, updated. |
/test pull-kubernetes-e2e-kind Test passed locally, retesting here |
/lgtm Thanks!! |
Why was |
As described by shartte,
I'm most concerned because it's described in the current official CKAD Study Guide:
Example❮ k run nginx --image=nginx --restart=Never --serviceaccount=custom
Flag --serviceaccount has been deprecated, has no effect and will be removed in the future.
pod/nginx created
❯ k get po nginx -o yaml | rg -i -C 3 serviceaccount
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: custom-token-ljvxm
readOnly: true
dnsPolicy: ClusterFirst
--
restartPolicy: Never
schedulerName: default-scheduler
securityContext: {}
serviceAccount: custom
serviceAccountName: custom Kubectl version info❯ k version -o yaml
clientVersion:
buildDate: "2021-04-08T16:31:21Z"
compiler: gc
gitCommit: cb303e613a121a29364f75cc67d3d580833a7479
gitTreeState: clean
gitVersion: v1.21.0
goVersion: go1.16.1
major: "1"
minor: "21"
platform: linux/amd64
serverVersion:
buildDate: "2021-01-13T13:20:00Z"
compiler: gc
gitCommit: faecb196815e248d3ecfb03c680a4507229c2a56
gitTreeState: clean
gitVersion: v1.20.2
goVersion: go1.15.5
major: "1"
minor: "20"
platform: linux/amd64 |
I'd also like to know why The alternative is quite clunky:
|
…lure. There is some discussion going on about the kubectl run --serviceaccount flag. It is deprecated but still works: kubernetes/kubernetes#99732 So for now, use the "overrides" workaround. --restart=OnFailure - leaves the pod in status completed, if no errors occur. Otherwise it would restart and apply again, even on success. Why don't we use a job instead of a pod? It's likely that we would have to use YAML, because "kubectl create job" does not support --override. This makes handling it much more complicate for the user. For example, passing flags such as --remote, --argocd, etc. Also interactive mode (""-i --tty") is not possible. This makes it more complicate to wait for success and to view output. This would likely require a combination of "kubectl wait --for=condition=failure job/myjob" and "kubectl logs -f". So for now, "kubectl run" seems to be the easiest way here.
Same question but for |
Was the reason for deprecation of |
What type of PR is this?
/kind cleanup
/kind deprecation
/sig cli
What this PR does / why we need it:
This PR remove entirely flags which were deprecated since cleaning
kubectl run
command.Special notes for your reviewer:
/assign @rikatz
Does this PR introduce a user-facing change?