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.28] - Add ctr to rke2 shell completion #6737

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

[Release-1.28] - Add ctr to rke2 shell completion #6737

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.28 with 05928c5 / v1.28

Environment Details

Infrastructure

  • Cloud
  • Hosted

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

Linux ip-172-31-0-174 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.28.14+dev.05928c52 (05928c524ec436f7d854c68dea34f3e3bf4d5287)
go version go1.22.6 X:boringcrypto
$ rke2 completion bash -i --crictl --kubectl --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
068ec769bb6a694108dad3e6e9a294f665c5e351b24aec784f5c5f11fe7247ab    docker.io/rancher/mirrored-calico-typha:v3.28.1                              io.containerd.runc.v2
0feba565f35256fa519345545ad15946bac08c3916cc4f4b770c4646afb86df5    docker.io/rancher/mirrored-calico-cni:v3.28.1                                io.containerd.runc.v2
12a3db1daf0d9005e5f39570f7eda4673fc73953b7524d8242afbdf58708c8bd    docker.io/rancher/hardened-kubernetes:v1.28.14-rke2r1-build20240912          io.containerd.runc.v2
15ae9468e3c760532d1e7a1271fadd58829c8275c7332929cd4b5c95ce180181    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
298f082f3fe04be03aaa897be1c789fd6e88cf1cd34f13cc10f33cba4928d2de    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
2ae916896520103befb60ca52f502d3f2ed8d0b9882b3387043c09edc45bdfc4    docker.io/rancher/mirrored-calico-operator:v1.34.3                           io.containerd.runc.v2
2ea8689b014a6324289fac45d25ccca0b08c58c3862855bfd0b382ba1a8eaa56    docker.io/rancher/hardened-kubernetes:v1.28.14-rke2r1-build20240912          io.containerd.runc.v2
301cf43496943604e70d9efd1fbbc7b09addc440ccd100ad97f511cfe12e089f    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
311fc4c23a1351689748d5ae7de4f723f6ffec83265b742a87d449d78aeed966    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
3303f5e13e13cda9bc0bd04ad64cf80a2d1a59d28342a9c4c9bd2f0730dd5bbf    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
353f233470a4d67e1d1b67f874c3073f3e281e30018324e54d6191579c3bca7c    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
385e77275d3bacdb19694b9505da3d069cdf75156a5c6a8cc9af61f6cc0ba1b5    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
3ede6b5d2e7f6ecda37ee31cbb81ffc9dbdc79a0b2b51491f3386ea31a684a3d    docker.io/rancher/mirrored-calico-pod2daemon-flexvol:v3.28.1                 io.containerd.runc.v2
3f3c1ceb7742baa7d77d1b61282e4914defec14b1678da5d4087ac2256b44dc9    docker.io/rancher/hardened-k8s-metrics-server:v0.7.1-build20240910           io.containerd.runc.v2
40cc5e3d799eb698e936b782f1550f51c9ea9280c19cec1a88dbf46cdc82d83e    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
42de7f24e5b304f35ca993843249fd06567de1a19c4f519fd1dd81bd57f30dac    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
436249cb127a8a76445f148d18bf1ee0959cab5398c33ced3da66a4fbed61ce2    docker.io/rancher/mirrored-sig-storage-snapshot-controller:v6.2.1            io.containerd.runc.v2
4d20f2830cf426971554b9ebd98499c614876e175cc57bd03ecc6d065217852d    docker.io/rancher/hardened-kubernetes:v1.28.14-rke2r1-build20240912          io.containerd.runc.v2
4e54f2fc52d8da53207b030492be13cd3a898aad5cbd192e84c825cd52a69ddd    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
51891e057407d4258e20d5e73575788098b05233bff64d866dab0574871c443b    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
55cd8bd93b5c26ce755b3cd9ab8f42a2642c0f8e2da81d3d468b138655469afb    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
5a74e09c13caac3cd93ca3553e10f5d22f3ee738797935ed35208d1b885fbb6b    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
5ca4df546875d1f16ad7a1fef916faf6f0909697630643e2b699f280dcf15ea7    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
5feecc970a51115a6d0a30828064cdd2175e1ff99f0d6afcc25e04126d589dd2    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
6367bbd8774a3446324471a6e281c17e9413fc2a2ce767d96de910e2e6a0c75e    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
6477cacddcdf1e8454aeb001352a3fc87f1b6803425ff48722df88960998e877    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
654d81bda7fae75d0bccf84af2560500a6e25d170d869e1ffaa9f55b7c98bc8a    docker.io/rancher/hardened-coredns:v1.11.1-build20240910                     io.containerd.runc.v2
69326374137f389c70275302c368b6f15be7521892d4a9cf3578170cd16736cc    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
6db8f6f1840b9e237f59f079db7e9e1a0bfddd24dbba67ed69702ee7e9333bb3    docker.io/rancher/hardened-kubernetes:v1.28.14-rke2r1-build20240912          io.containerd.runc.v2
73f8e986afd9b6469a12b2cf4dc8225378ed54273548eacab984f04dc0eecfd5    docker.io/rancher/rke2-cloud-provider:v1.28.13-build20240910                 io.containerd.runc.v2
74c83d30fe7156cf215e2443db6ef0e2e6df7dd53e54bac52b40c17313e06d7b    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
76f739ae4a459608345175852762e582be4c645478ed5085e00295286bf83c2b    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
787f7ddc26bdb5e65f04f58d0d3be99e293ec8ac0906a80905ad31f778b0070a    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
7f5c641a669f8d736b8e05e1128cdc89a579b756eb7167c6daa3d70951dfe278    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
826c609cd87cdde43c57b047ebf82e6ec4696fef137a53b9048cd37ba1f1c93c    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
85ae60e36b5d1d0246c213093d7d0bfd948526742036cf028464fdfc7b216f49    docker.io/rancher/hardened-cluster-autoscaler:v1.8.11-build20240910          io.containerd.runc.v2
87e899b3b610c09e2db5f7757f53816c63b7317869a2a5de3d0e6a71cbdb7ad6    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
8ce6317f247d413ef24f2ba8fda89ff38e149ddbbb5925d91244da53f2eba9d1    docker.io/rancher/mirrored-calico-node:v3.28.1                               io.containerd.runc.v2
98a4e0a492d593f472fd60adb71cff3718d7d9f0354bd89dbc5078de62fa941d    docker.io/rancher/hardened-etcd:v3.5.13-k3s1-build20240910                   io.containerd.runc.v2
aec1fd214a33af4c26233c6480e07cac8ec3fcb15487b497b923cc4cd4274324    docker.io/rancher/nginx-ingress-controller:v1.10.4-hardened3                 io.containerd.runc.v2
b105535360d014cd0b5ed62921ac91d2b2c7f102e5fd33f17bd1c5f352d7aeca    docker.io/rancher/mirrored-sig-storage-snapshot-validation-webhook:v6.2.2    io.containerd.runc.v2
b1df0373e2f8847659f5521060471b02093cfb26714538950929c17bf4344a1f    docker.io/rancher/mirrored-calico-operator:v1.34.3                           io.containerd.runc.v2
b5a76b86f2459586f8088825e1a2830462ebe38e020ce9fe34d94d14c22771bf    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
bbc4856b924e5fd8c568b9cc0bc6f687dbcc38e30b62b52c51185e2200543614    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
c7db68d828c6e7f8de291f98cd943f984fa04e70cf9dbaca0884c23033cfe0e5    docker.io/rancher/hardened-kubernetes:v1.28.14-rke2r1-build20240912          io.containerd.runc.v2
ccec8c176250b5f625f4017b8b9768c9848a38f8b852a65936b71c9c085207d2    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
ce042753bbe39a09bcd5ce1a1399193712e7c59ce5db81177790407ebd06a2fe    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
d12e526733def9d6cdde1142d18466f815dbe3a021cfe15a41573edfbb00a4cd    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
d18cc69cd834736e6ccac831b2b7832d06c96be384644b8d684fe1f7f85cbd64    docker.io/rancher/mirrored-calico-kube-controllers:v3.28.1                   io.containerd.runc.v2
dddc3082cc8ba39aa61dd710910fda5a47f23d4837b994927660becf40d85188    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
e4c9d615d629f8893a10e54f1f01917344db4ababb636d992067966714a9416f    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
e617213c75c34637a3c74558121192b9d142b4f58d9c1fda05f738b3dc36df73    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
ece7bf2b0631cfa26245a0f4466404a2e863441ee8bc7605ec8b1c7af3d9dda0    docker.io/rancher/hardened-kubernetes:v1.28.14-rke2r1-build20240912          io.containerd.runc.v2
fef919bda7abc80d82a6389f3835c188fe400770513d030f5f7f86123e2857fc    docker.io/rancher/rke2-cloud-provider:v1.28.13-build20240910                 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