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

Support completion for kubectl apply view/edit-last-applied #60499

Merged
merged 1 commit into from
Mar 27, 2018

Conversation

superbrothers
Copy link
Member

What this PR does / why we need it: With this PR, kubectl apply view/edit-last-applied support completion.

$ kubectl apply view-last-applied <tab>
certificatesigningrequest  configmap           daemonset   event                    job            node                   pod                  podtemplate            rolebinding  serviceaccount  storageclass
clusterrolebinding         controllerrevision  deployment  horizontalpodautoscaler  namespace      persistentvolume       poddisruptionbudget  replicaset             secret       statefulset     
componentstatus            cronjob             endpoints   ingress                  networkpolicy  persistentvolumeclaim  podsecuritypolicy    replicationcontroller  service      status
$ kubectl apply view-last-applied deployment nginx<tab>
nginx   nginx2

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

`kubectl apply view/edit-last-applied support completion.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 27, 2018
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 27, 2018
@mengqiy
Copy link
Member

mengqiy commented Feb 27, 2018

/ok-to-test
/assign @shiywang

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 27, 2018
@@ -168,7 +168,8 @@ __kubectl_require_pod_and_container()
__custom_func() {
case ${last_command} in
kubectl_get | kubectl_describe | kubectl_delete | kubectl_label | kubectl_edit | kubectl_patch |\
kubectl_annotate | kubectl_expose | kubectl_scale | kubectl_autoscale | kubectl_taint | kubectl_rollout_*)
kubectl_annotate | kubectl_expose | kubectl_scale | kubectl_autoscale | kubectl_taint | kubectl_rollout_* |\
kubectl_apply_edit-last-applied | kubectl_apply_view-last-applied)
Copy link
Contributor

@shiywang shiywang Mar 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's also a set-last-applied we can add it.

@shiywang
Copy link
Contributor

shiywang commented Mar 1, 2018

@mengqiy @superbrothers I tried on my laptop, it works well, there's only one set-last-applied left then we are good to go.

➜  amd64 git:(last-applied) ./kubectl apply view-last-applied
certificatesigningrequest  persistentvolume         
clusterrolebinding         persistentvolumeclaim    
componentstatus            pod                      
configmap                  poddisruptionbudget      
controllerrevision         podsecuritypolicy        
cronjob                    podtemplate              
daemonset                  replicaset               
deployment                 replicationcontroller    
endpoints                  rolebinding              
event                      secret                   
horizontalpodautoscaler    service                  
ingress                    serviceaccount           
job                        statefulset              
namespace                  status                   
networkpolicy              storageclass             
node                                                

@superbrothers
Copy link
Member Author

superbrothers commented Mar 1, 2018

@shiywang kubectl apply set-last-applied doesn't have RESOURCE/NAME argument unlike view/edit-last-applied. set-last-applied already supports completion.

kubectl apply set-last-applied -f FILENAME [options]
kubectl apply view-last-applied (TYPE [NAME | -l label] | TYPE/NAME | -f FILENAME) [options]
kubectl apply edit-last-applied (RESOURCE/NAME | -f FILENAME) [options]

@shiywang
Copy link
Contributor

shiywang commented Mar 1, 2018

@superbrothers oh, sorry : )
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 1, 2018
@superbrothers
Copy link
Member Author

@shiywang Thank you for your review! ;)

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 21, 2018
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Mar 24, 2018
@mengqiy
Copy link
Member

mengqiy commented Mar 27, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 27, 2018
@mengqiy
Copy link
Member

mengqiy commented Mar 27, 2018

/retest

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mengqiy, shiywang, superbrothers

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 27, 2018
@mengqiy
Copy link
Member

mengqiy commented Mar 27, 2018

/retest

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 60499, 61715, 61688, 61300, 58787). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit d885863 into kubernetes:master Mar 27, 2018
@superbrothers superbrothers deleted the last-applied branch March 27, 2018 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants