• Kubernetes Submit Queue's avatar
    Merge pull request #48267 from superbrothers/clusterrole-flag-completion · 551c4581
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
    
    Support completions for --clusterrole of kubectl create clusterrolebinding
    
    **What this PR does / why we need it**:
    This PR supports completion for --clusterrole of kubectl create clusterrolebinding.
    ```
    $ kubectl create clusterrolebinding hoge --clusterrole <tab>
    admin                                         system:controller:daemon-set-controller       system:controller:node-controller             system:controller:service-controller          system:kube-scheduler
    cluster-admin                                 system:controller:deployment-controller       system:controller:persistent-volume-binder    system:controller:statefulset-controller      system:node
    edit                                          system:controller:disruption-controller       system:controller:pod-garbage-collector       system:controller:ttl-controller              system:node-bootstrapper
    system:auth-delegator                         system:controller:endpoint-controller         system:controller:replicaset-controller       system:discovery                              system:node-problem-detector
    system:basic-user                             system:controller:generic-garbage-collector   system:controller:replication-controller      system:heapster                               system:node-proxier
    system:controller:attachdetach-controller     system:controller:horizontal-pod-autoscaler   system:controller:resourcequota-controller    system:kube-aggregator                        system:persistent-volume-provisioner
    system:controller:certificate-controller      system:controller:job-controller              system:controller:route-controller            system:kube-controller-manager                view
    system:controller:cronjob-controller          system:controller:namespace-controller        system:controller:service-account-controller  system:kube-dns
    ```
    
    **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
    
    **Special notes for your reviewer**:
    
    I feel that it is better to except system clusterroles from completion candidates. What do you think about it?
    
    **Release note**:
    
    ```release-note
    Support completion for --clusterrole of kubectl create clusterrolebinding
    ```
    551c4581
create_clusterrolebinding.go 3.52 KB