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

[Release-1.29] - Add ctr to rke2 shell completion #6736

Closed
vitorsavian opened this issue Sep 5, 2024 · 1 comment
Closed

[Release-1.29] - Add ctr to rke2 shell completion #6736

vitorsavian opened this issue Sep 5, 2024 · 1 comment
Assignees

Comments

@vitorsavian
Copy link
Member

Backport fix for Add ctr to rke2 shell completion

@endawkins
Copy link

Validated on release-1.29 with 429b6bb / v1.29

Environment Details

Infrastructure

  • Cloud
  • Hosted

Node(s) CPU architecture, OS, and Version:

Linux ip-172-31-5-153 5.14.21-150500.55.44-default #1 SMP PREEMPT_DYNAMIC Mon Jan 15 10:03:40 UTC 2024 (cc7d8b6) x86_64 x86_64 x86_64 GNU/Linux
NAME="SLES"
VERSION="15-SP5"
VERSION_ID="15.5"
PRETTY_NAME="SUSE Linux Enterprise Server 15 SP5"
ID="sles"
ID_LIKE="suse"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:15:sp5"
DOCUMENTATION_URL="https://documentation.suse.com/"

Cluster Configuration:

1 server

Config.yaml:

N/A

Additional files

N/A

Testing Steps

  1. Copy config.yaml
$ sudo mkdir -p /etc/rancher/rke2 && sudo cp config.yaml /etc/rancher/rke2
  1. Install RKE2
  2. Run sudo -su
  3. Install Shell Completion
    rke2 completion bash -i --crictl --kubectl --ctr
  4. Run the following commands (while still in root):
$ source ~/.bashrc
$ echo $CONTAINERD_ADDRESS
$ /var/lib/rancher/rke2/bin/ctr --namespace k8s.io container ls

Replication Results:
See: #6735 (comment) for reproduction

Validation Results:

  • rke2 version used for validation:
rke2 -v
rke2 version v1.29.9+dev.429b6bba (429b6bbac506250ccc93e3c17967849223529c50)
go version go1.22.6 X:boringcrypto
$ rke2 completion bash -i --kubectl --crictl --ctr
Autocomplete for bash added to: /root/.bashrc

$ source ~/.bashrc

$ echo $CONTAINERD_ADDRESS
/run/k3s/containerd/containerd.sock

$ /var/lib/rancher/rke2/bin/ctr --namespace k8s.io container ls
CONTAINER                                                           IMAGE                                                                        RUNTIME
0a4d4034f161e19d789daf43b5c7c77e2f76be7b1989b979554e76fd7729547b    docker.io/rancher/hardened-kubernetes:v1.29.9-rke2r1-build20240912           io.containerd.runc.v2
0bd72c6ca214e00f140b15b8a63e6e00fecc07423dc738744465a75d041a591c    docker.io/rancher/hardened-kubernetes:v1.29.9-rke2r1-build20240912           io.containerd.runc.v2
0dca859270f9159467aece865884542a792da8013ff71aa31d68bd6192194d99    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
0ef734f711e29a94a9e9df7181230032cd32289b84917984c2baf905160be121    docker.io/rancher/mirrored-calico-operator:v1.34.3                           io.containerd.runc.v2
135a5be014d4f3f186d60227073f406bf33c8b0ea9ca8d437905edd115d3539a    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
19b2b357cc1e43e82c15b08a26c025e1cd53001afae4a9c58f40afab3848525e    docker.io/rancher/mirrored-sig-storage-snapshot-validation-webhook:v6.2.2    io.containerd.runc.v2
21a686a598e98591d0a9926cc6dfb7257df9b4ed055b350f258d27b686cf12dc    docker.io/rancher/mirrored-sig-storage-snapshot-controller:v6.2.1            io.containerd.runc.v2
2871814029c9dde449e1fc3f013ffcf59c283d6a866035a20edf94ea4db5c29f    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
2a7f230128b177bf38f2ec15545601ad69400993c90748ed07638d5be7ad8052    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
2eb6f0f765a68b5911e4e3e1fa076291cad634082c0ad627c6a05370490a024c    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
2eeebdc72ccb648bdbaf9b12f65d8fe9a2a8d1a39ca82c943301d1fa78c4721c    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
2fbe0d61de98628e6bf944780acc37abe48e6d11efc26a6e2c08633b08e4f49b    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
33a2f46c767f47854c716e9d7659d071d8d139939679b6adc8b60b764e2e3ada    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
3717ed1c9a39d714cd9756e2b79d34f243ba8ecaa321091d5febad359afc360c    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
3717f32b5fb8e170de80ed5a675f89fb2b4ad9110f34ebf3a0ba459d9be187bf    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
3a3c09c123a6e1f94cbdaa93a1890ebb9cfb0dc6f90f1f2d5d2f929bd9f9a7e0    docker.io/rancher/hardened-cluster-autoscaler:v1.8.11-build20240910          io.containerd.runc.v2
3c2b15c0f3f7b4ea58d41d272c31d9afd4a653389d59e635b0d7997fea331c61    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
593eba5b82c46b42cfb8669e29cbdccff39038afc57fe75bca8cadf9b2248bbb    docker.io/rancher/mirrored-calico-cni:v3.28.1                                io.containerd.runc.v2
5961692442a0a21fda3cc81702dedc6b2075da144163ee63c95df8b5d7dfc306    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
60db3ebb313582b4bb79bad90dda18b3439369adb3808d46d0d1132bf14bccd5    docker.io/rancher/hardened-kubernetes:v1.29.9-rke2r1-build20240912           io.containerd.runc.v2
615599013c2c51f82a0aaea736592ca82ad0ec16400ebc0f65c3b38be86d8dab    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
64f46a567f8989a32a35f389938dc0cd9b9622e1caa29a61a6885599c49cbb09    docker.io/rancher/mirrored-calico-pod2daemon-flexvol:v3.28.1                 io.containerd.runc.v2
6654571275da7b80a79f94adbeb6c1d666fc992a632c614e9352316ab07f8e0d    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
6f581b62313f2f4f190d05021768ded56714ede4164f7a07791d5462b9dae7bb    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
73f9181c8d2f02738e9ee6d2aac656cfa018e32ca858b218ee084ddcfc23a392    docker.io/rancher/hardened-coredns:v1.11.1-build20240910                     io.containerd.runc.v2
779a69cba4705b8f81bfb574b7168e537b21c7c3827f22acaf75f4a49ac9eae3    docker.io/rancher/mirrored-calico-kube-controllers:v3.28.1                   io.containerd.runc.v2
790c9c706ec18dc0209757116e6dfb34624242ed0af1775bd6e8d10daaefe9d1    docker.io/rancher/mirrored-calico-operator:v1.34.3                           io.containerd.runc.v2
816c385ff0c4c5461340e9a9d1a51b0c9cbb28815a75fcf7f58755c3b73ea61d    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
85d6ae2263c863563a67a9c301fda60a84f4acc1c7f329cdc3eefd4ab8c2f5c5    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
85db7708f30d71b2efe6b356a259dacb2574464bf124bada8eb13996d2cf6daf    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
8a5dd9f493a1bb96f3663eab893ae9d19635c34ea79e2bc1ca6473434b369b88    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
8f382a274a460179cabe13923943ba2416198d06146017a26fc932393c7e3da7    docker.io/rancher/hardened-kubernetes:v1.29.9-rke2r1-build20240912           io.containerd.runc.v2
953a0aabf9533fa448d55fc95cbf70b8559c1555c0426130323a64500f88a269    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
9759fc90b6a0d7e7d1d5ada423048c4a8aacee53658b66f41a69a514545b47ce    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
996024f47f69e32d2e411cf9ae93ba1f947c347b0f98213a62452f8ca9ba1749    docker.io/rancher/hardened-etcd:v3.5.13-k3s1-build20240910                   io.containerd.runc.v2
9d3044d91b1d22c9b1ef39cfe83b97476c271d263eb4d3dd0d8c86b70a56960a    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
a4eb28b228bda2a487089e7db2399b036a220ce00a9eb22429cfbc785e07cd00    docker.io/rancher/hardened-k8s-metrics-server:v0.7.1-build20240910           io.containerd.runc.v2
af1cf61dd28ff34229df230cc3c0574f7b19df1020cf2b7fb150333573302a6f    docker.io/rancher/rke2-cloud-provider:v1.29.8-build20240910                  io.containerd.runc.v2
bde6ac9a72d41e9ce338a853d63ce9ae9cbba57c4bb62181a20d875d5a0049d7    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
c0625c96f4fac2f64c5e136f93bd7d44ad19224ef6f37b02f66bf803b9b5482e    docker.io/rancher/rke2-cloud-provider:v1.29.8-build20240910                  io.containerd.runc.v2
c227e1e8673b8795ebdb7ed0dc2a6f3635ee77e55ad1b55ca75235e14b0d6446    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
c26853e0d40861b0ca3deb5f7a78d7141d787ef7ef27129575f648e10d29ed7b    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
cd02ebaa601aff82a3ab5f1fd3a6b2cd572efd01ba9df7f3b9ed246908964720    docker.io/rancher/nginx-ingress-controller:v1.10.4-hardened3                 io.containerd.runc.v2
cf9de9f0863547714db75bf7752d38f5e0921936c4003eee8e654509484190c1    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
db739240811c4f0b4cb2e2bffdfdbc902b8f91e1a99bb20269621429839b7b18    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
df45ddc9d5fce89b463c2c518509370083ea0a2bc5fdbe900616bfe225efa403    docker.io/rancher/hardened-kubernetes:v1.29.9-rke2r1-build20240912           io.containerd.runc.v2
e1e454d907521d1ec4a0efd29e01d2a586a5400713820f36eee70fc8add94353    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
e33e41a525e5471f9f18d10046df5a6f0dd4a63379756128996988dd23f3ee4a    docker.io/rancher/mirrored-calico-node:v3.28.1                               io.containerd.runc.v2
ec3258532e4699122e3fb840e3732702c0cd9568d53c522d305f05eb34ac97c2    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
ed512dff5842ed177ab8ec10a234091a8f4044827c1883d92ac7da5810a80bb6    docker.io/rancher/mirrored-calico-typha:v3.28.1                              io.containerd.runc.v2
f04ff4f5d9a39abc4276507ee52c914526a6a8030a3f90ac1153dd42217a9527    docker.io/rancher/hardened-kubernetes:v1.29.9-rke2r1-build20240912           io.containerd.runc.v2
f231b6c49e344e2e7961417967ec1615ef0bcf60a12ac09de841ec96a12fe921    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
f2ac6b2c711524f3eff53b387d26b60d82a4d01a40eb2d8b3ba448ac33c953d1    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
fcdfee0a4afaff39548b00823412634e8a7782fd0254dd02ea1d0ad7338610da    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
fe07e9f323589cbb1ef55df9f176ac04b0728387549f05bdab85f31931a3601d    docker.io/rancher/mirrored-sig-storage-snapshot-controller:v6.2.1            io.containerd.runc.v2

Additional context / logs:

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants