Skip to content

Commit

Permalink
set crictl alias on agents
Browse files Browse the repository at this point in the history
  • Loading branch information
poblin-orange committed Mar 25, 2021
1 parent d8a0510 commit ee932d5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jobs/k3s-agent/spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ templates:
bin/post-deploy.erb: bin/post-deploy
bin/drain.erb: bin/drain
bin/ctl.erb: bin/ctl
bin/envrc: bin/envrc
bin/setup-user-env.erb: bin/setup-user-env
bin/k3s-killall.sh: bin/k3s-killall.sh



config/registries.yaml.erb: config/registries.yaml
config/registry.ca.erb: config/registry.ca
config/registry.cert.erb: config/registry.cert
Expand Down
4 changes: 4 additions & 0 deletions jobs/k3s-agent/templates/bin/envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

export PATH=$PATH:/var/vcap/packages/k3s
alias crictl="k3s crictl"
15 changes: 15 additions & 0 deletions jobs/k3s-agent/templates/bin/setup-user-env.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

checkenv() {
trap "exit 0" INT TERM QUIT

command=". ${JOB_DIR}/bin/envrc"
for profile in /root/.profile /etc/skel/.profile; do
# toolbelt.auto is disabled; stripping envrc from .profiles
if ! grep -q "^${command}\$" ${profile} >/dev/null 2>&1; then
echo "${command}" >> ${profile}
fi
done
}

checkenv

0 comments on commit ee932d5

Please sign in to comment.