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

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

[Release-1.30] - Add ctr to rke2 shell completion #6735

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.30 with 9517eea / v1.30

Environment Details

Infrastructure

  • Cloud
  • Hosted

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

Linux ip-172-31-5-247 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:

  • rke2 version used for replication:
rke2 -v
rke2 version v1.30.4+rke2r1 (9517eea519b780e154dd791c555c698e84a0e5cd)
go version go1.22.5 X:boringcrypto
rke2 completion bash -i --kubectl --crictl --ctr
Incorrect Usage: flag provided but not defined: -ctr

NAME:
   rke2 completion - Install shell completion script

USAGE:
   rke2 completion [SHELL] (valid shells: bash, zsh)

OPTIONS:
   -i         Install source line to rc file
   --kubectl  (kubectl) export kubeconfig
   --crictl   (crictl) export crictl config file

FATA[0000] flag provided but not defined: -ctr

Validation Results:

  • rke2 version used for validation:
rke2 -v
rke2 version v1.30.5+dev.0c83bc82 (0c83bc82315cd61664880d0b52a7e070e9fbd623)
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

$ CONTAINER                                                           IMAGE                                                                        RUNTIME
0ace9941d85e12f6910689da9aa08a167efff58a3af1c7d1c42dc43c5fa0abfb    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
0ade08468a0c6bf93dcd01cc6eea6575fb2c64b3a642364b0943bf4c06642c10    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
0c5af7a8c81871719cdb4e03de7ef6b9779a915c3aed72d61c2bac1e8c3dc9c2    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
137a0b2d178ae71efaa011450bf714b9b0e29a822b09a8905e53d8fc641727c0    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
1a0fce682ef73929a2987a2968d65cd6694ae222f221a2cf4889597d8cf3f7b2    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
1decaf066cfd1979d6035fd114bcd605c282628404544ec2949d7454a7cc097c    docker.io/rancher/mirrored-sig-storage-snapshot-controller:v6.2.1            io.containerd.runc.v2
238b36c43921af0e0583af35fbc5fee128e5cc6e1f8a3a2e6502e953bd2b5fb9    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
34571f80044d9a23b759d336030e803ea3ba065671d5ac0916a7c7eea4c1c46d    docker.io/rancher/hardened-etcd:v3.5.13-k3s1-build20240910                   io.containerd.runc.v2
3604e72a7ff6e9b7d8fc25e364e253275663933d71046f3c72ef558bdc9a9ce1    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
3a372ed1e34b5530eb5d4a0a616b498af8cd26654f972aba8409ada84dc9d899    docker.io/rancher/hardened-k8s-metrics-server:v0.7.1-build20240910           io.containerd.runc.v2
3a4bf5da800f403d237ded1b29b331f88002a1b4fb158915c939b2c62071514b    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
41dc20aad9caab610ccd1f9700938e70a938c2452789d4de5f25dd2659b016f7    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
476734ac05040c91c5c7726a15cccfb9dcf90c7e325b74fc8bf304088d65a874    docker.io/rancher/mirrored-sig-storage-snapshot-validation-webhook:v6.2.2    io.containerd.runc.v2
4a1f840984d0e047d31f3af214f42d8526c1b6ce9563904411eb077299a214a5    docker.io/rancher/mirrored-calico-kube-controllers:v3.28.1                   io.containerd.runc.v2
4a5e4131b270a168b94b393d9c8b69ba157823e79936ba4a1d5070ad500702e7    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
52c5dd511578419a1373acf90af63f41852bcb6e0450c0f3617244958db707f8    docker.io/rancher/hardened-kubernetes:v1.30.5-rke2r1-build20240912           io.containerd.runc.v2
570938ed87c643c320cf1bca3a5d2a96524f3182f5f72b9cb5f8cf5f9e9d1d2c    docker.io/rancher/hardened-kubernetes:v1.30.5-rke2r1-build20240912           io.containerd.runc.v2
5bdb180e4afc88d1f6dc99c3309ff2231f3effc30f55344c694f6a0a109027af    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
69388b2912edc98e51a274d6ef78bd4da031f48d7259bf76660105ef4535d229    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
7276f52bc530d065080d54dcd469e8ef8ef92145312b076637b081b958328c2c    docker.io/rancher/hardened-cluster-autoscaler:v1.8.11-build20240910          io.containerd.runc.v2
72a3f76c2534c060afbee054bc78165cb2b09783b11f699f628539abaa02f68f    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
77270bb00b3eded2e2af3dec1525e42423a514773a557d9ab60e7e83e8c20ad2    docker.io/rancher/nginx-ingress-controller:v1.10.4-hardened3                 io.containerd.runc.v2
7beaa92d25378f3517f08ebe547e23ae1233a7d4c032e77517eeb20f9aa8050a    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
83145fdd3e85488b903bff64519391ceb68154500549f261f77ef3e214214520    docker.io/rancher/mirrored-calico-operator:v1.34.3                           io.containerd.runc.v2
87b3d44de7172272e011af70ea08c35433d97e8d6681391764335418d0496f7e    docker.io/rancher/mirrored-calico-typha:v3.28.1                              io.containerd.runc.v2
8c96d957d0ce4eac978baf0b3cac494463789728e3ffd3d13f74f88213114862    docker.io/rancher/rke2-cloud-provider:v1.30.4-build20240910                  io.containerd.runc.v2
8e04f2fc7c2d1a982d9417c2a6aa121e572ce7cf097c3dd29df20bc9b1fc21a8    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
904c8283dd93a9b5d329466c3f6cd95f540a7c2dd33993a16984b47c14cfd328    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
915f058266e84d1bbbef95643517f9c2a55d34f41a7497eb31db90b2e81b7a3a    docker.io/rancher/mirrored-calico-pod2daemon-flexvol:v3.28.1                 io.containerd.runc.v2
9213b0b6eb3f64052c5191be0e5e3ebbd3668096cab8f1fc221cdaca38bf0716    docker.io/rancher/hardened-kubernetes:v1.30.5-rke2r1-build20240912           io.containerd.runc.v2
a378255c79fbf8229166d55717a975c24afd56c74b98331e6e95dadebcc93c8b    docker.io/rancher/rke2-cloud-provider:v1.30.4-build20240910                  io.containerd.runc.v2
a4e3dde8934d22cd6a281eff6f28300c2356bc8fc49bde6ece28a7285b61227b    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
ac0d26f93893ab32166c7705d1608b0cad6d8de59eeaac0aacb3147de3919e5b    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
ac3d57168944c0b64aa8547bd903c301293fe7beaa90d62078ed1fb07a860115    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
b2a8c5a10afd0e351a6c9f3b849293dfdeb8cdf7eb10d101e8934276f3077960    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
bb8963a3c690ba8e3966910947898a0f929e48301ca5cbe013ec69f6b755d3cb    docker.io/rancher/hardened-kubernetes:v1.30.5-rke2r1-build20240912           io.containerd.runc.v2
be4339fde49626884f9ff27bf8467b0146bbfc713485e14e224e51eed1e5f6f7    docker.io/rancher/hardened-kubernetes:v1.30.5-rke2r1-build20240912           io.containerd.runc.v2
c6acb149c71566031cfab11d28464862a8c3cf454463ce76355f7ec9160aba94    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
cbe7c240280e313fc8b61cabbc42479248f89bbd48acbf58e1967741a1f89eb0    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          io.containerd.runc.v2
cd9b10425f023122c48f66a85667f93e95846d85724400317a5f0bfdadecd191    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
d27dfd7616017d1c8ce082a193913db9ceef4df39dc5ce97e48a4cda1ad7a44d    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
d38c37ca2806d50991dee673749f3850374ef2a15c8691def3eeb3e728512166    docker.io/rancher/mirrored-calico-cni:v3.28.1                                io.containerd.runc.v2
dabc57ed632e07415102baa87949c9fd6109b3c29227ce3bb642db799ae328f8    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
dc57296f8f7aa05e04886ef76eefa77fe69f71c4a48db43aa8bebfa3e42c1f21    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
df67381473d8f058d37d4aa47b9ea1cc2bba6e613bc79768c5d32a7446286d35    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
e21df91acb8667f184a8797f126578c884e4270b428816bf2055cea401fb6adc    docker.io/rancher/hardened-coredns:v1.11.1-build20240910                     io.containerd.runc.v2
e2a7b761889c0bf9f6de0c75b353642249657bf178b5474ca1724f61e7713d6d    docker.io/rancher/mirrored-calico-operator:v1.34.3                           io.containerd.runc.v2
e6cdad4053e8194c16013ef053907ea6151e0baf465317ec998ef7d95104ceb4    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
e7878e635fa62406d4e5bf21694d711acc01036d9197955c3d4c9842dc48af54    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
eaa87f78d3b5c13194f30bf1cd8cce9c65396fe5bf8a48179db2c0d1472a9a63    docker.io/rancher/mirrored-sig-storage-snapshot-controller:v6.2.1            io.containerd.runc.v2
eab6856d491fa635f0bf3f9d232a4304e78f0c46e3e6658e35e3145c636485a3    docker.io/rancher/hardened-kubernetes:v1.30.5-rke2r1-build20240912           io.containerd.runc.v2
effcb8d83c4f5474804f9a5996236d4b030064208433cf7d8d996233ed76a823    docker.io/rancher/mirrored-calico-node:v3.28.1                               io.containerd.runc.v2
f00c376b677d0254e71d60c9abd3c8aef31aed890adb38a2051d72e66943373f    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
f83dd81cba7e9a9b41a38aa4bcc2bba4c8e3ac2e0f2f7cb6a075f1f75ab06f3e    docker.io/rancher/mirrored-pause:3.6                                         io.containerd.runc.v2
fa6cc4facc31119fe817b54f8849caca03fc5f8f6f69aca8abae04ef97dd2242    docker.io/rancher/klipper-helm:v0.9.2-build20240828                          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