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

feat: enable kubectl autocompletion #1015

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dockerimages/terminal/latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ COPY scripts/ttyd-kubectl.sh /usr/bin/
RUN arch && \
apt-get update && \
apt-get install -y --no-install-recommends -o Acquire::http::No-Cache=True \
ca-certificates curl wget bind9-utils git g++ gcc libc6-dev make pkg-config vim \
ca-certificates curl wget bind9-utils git g++ gcc libc6-dev make pkg-config vim bash-completion \
Copy link
Contributor

Choose a reason for hiding this comment

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

Pls give image size increments changes.

ncurses-dev libtolua-dev exuberant-ctags gdb dnsutils iputils-ping net-tools postgresql-client openssh-client && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
chmod a+x /usr/bin/ttyd-kubectl.sh && \
Expand All @@ -35,6 +35,8 @@ COPY --from=mysql-client /usr/bin/mysql /usr/bin/mysql
COPY --from=mongo-client /usr/bin/mongosh /usr/bin/mongosh
COPY --from=redis-client /usr/local/bin/redis-cli /usr/local/bin/redis-cli

RUN echo 'source /etc/profile' >>/root/.bashrc

ENV USER_TOKEN ""
ENV APISERVER "https://apiserver.cluster.local:6443"
ENV USER_NAME "admin"
Expand Down
3 changes: 1 addition & 2 deletions dockerimages/terminal/latest/scripts/ttyd-kubectl.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash


to_download_arch() {
case $ARCH in
amd64)
Expand All @@ -17,12 +16,12 @@ to_download_arch() {
to_download_arch
echo "download arch : $_ARCH"


wget https://storage.googleapis.com/kubernetes-release/release/v${kubeVersion}/bin/linux/${ARCH}/kubectl -O /usr/bin/kubectl && chmod a+x /usr/bin/kubectl
if [ $? != 0 ]; then
echo "====download kubectl failed!===="
exit 1
fi
echo 'source <(kubectl completion bash)' >>/etc/bash.bashrc

wget https://github.com/tsl0922/ttyd/releases/download/${ttydVersion}/ttyd.${_ARCH} && chmod +x ttyd.${_ARCH} && mv ttyd.${_ARCH} /usr/bin/ttyd
if [ $? != 0 ]; then
Expand Down