Skip to content

Commit

Permalink
fix k9s old configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
ogrand committed Jan 12, 2024
1 parent d23f436 commit 69aef8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 10 additions & 1 deletion tools/k9s-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
# Run k9s with custom configuration
#===========================================================================

#--- Customize k9s configuration
K9S_CONFIG_FILE="${K9S_CONFIG_DIR}/config.yaml"

#--- Clean obsolete configuration files
if [ -f ${K9S_CONFIG_DIR}/config.yml ] ; then
rm -f {K9S_CONFIG_DIR}/config.yml > /dev/null 2>&1
fi
if [ -f ${K9S_CONFIG_DIR}/plugin.yml ] ; then
rm -f {K9S_CONFIG_DIR}/plugin.yml > /dev/null 2>&1
fi

#--- Customize k9s configuration
if [ -f ${K9S_CONFIG_FILE} ] ; then
#--- Disable K9S logo to display options
sed -i "s+logoless:.*+logoless: true+" ${K9S_CONFIG_FILE}
Expand All @@ -17,4 +25,5 @@ if [ -f ${K9S_CONFIG_FILE} ] ; then
sed -i "s+skipLatestRevCheck:.*+skipLatestRevCheck: true+" ${K9S_CONFIG_FILE}
fi

#--- Run k9s binary
k9s
8 changes: 1 addition & 7 deletions tools/profile
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,10 @@ EOF
export KUBE_EDITOR="/usr/local/bin/kubectl-ro-editor.sh"

#--- Set k9s config path, delete obsolete configurations and create k9s plugins
export K9S_CONFIG_DIR=${HOME}/.k9s
export K9S_CONFIG_DIR="${HOME}/.k9s"
if [ ! -d ${K9S_CONFIG_DIR} ] ; then
mkdir -p ${K9S_CONFIG_DIR}
fi
if [ -f ${K9S_CONFIG_DIR}/config.yml ] ; then
rm -f {K9S_CONFIG_DIR}/config.yml > /dev/null 2>&1
fi
if [ -f ${K9S_CONFIG_DIR}/plugin.yml ] ; then
rm -f {K9S_CONFIG_DIR}/plugin.yml > /dev/null 2>&1
fi

cp /home/bosh/.k9s/plugins.yaml ${K9S_CONFIG_DIR}/plugins.yaml

Expand Down

0 comments on commit 69aef8b

Please sign in to comment.