Skip to content

Commit

Permalink
fix(ec): solve make kotsadm-up-ec fail (#4943)
Browse files Browse the repository at this point in the history
  • Loading branch information
DexterYan authored Oct 13, 2024
1 parent b5330da commit eec10d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dev/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function ec_exec() {
# Patches a component deployment in the embedded cluster
function ec_patch() {
ec_render dev/patches/$1-up.yaml > dev/patches/$1-up-ec.yaml.tmp
ec_exec k0s kubectl patch deployment $(deployment $1) -n kotsadm --patch-file dev/patches/$1-up-ec.yaml.tmp
ec_exec k0s kubectl --kubeconfig=/var/lib/embedded-cluster/k0s/pki/admin.conf patch deployment $(deployment $1) -n kotsadm --patch-file dev/patches/$1-up-ec.yaml.tmp
rm dev/patches/$1-up-ec.yaml.tmp
}

Expand Down Expand Up @@ -118,5 +118,5 @@ function up() {
}

function ec_up() {
ec_exec k0s kubectl exec -it deployment/$(deployment $1) -n kotsadm -- bash
ec_exec k0s kubectl --kubeconfig=/var/lib/embedded-cluster/k0s/pki/admin.conf exec -it deployment/$(deployment $1) -n kotsadm -- bash
}
4 changes: 2 additions & 2 deletions dev/scripts/down-ec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ fi
echo "Reverting..."

if [ "$component" == "kotsadm" ]; then
ec_exec k0s kubectl delete -f dev/manifests/kotsadm-web -n kotsadm
ec_exec k0s kubectl --kubeconfig=/var/lib/embedded-cluster/k0s/pki/admin.conf delete -f dev/manifests/kotsadm-web -n kotsadm
fi

ec_exec k0s kubectl replace -f dev/patches/$component-down-ec.yaml.tmp --force
ec_exec k0s kubectl --kubeconfig=/var/lib/embedded-cluster/k0s/pki/admin.conf replace -f dev/patches/$component-down-ec.yaml.tmp --force
ec_exec rm dev/patches/$component-down-ec.yaml.tmp
6 changes: 3 additions & 3 deletions dev/scripts/up-ec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ ec_build_and_load "$component"
# we can achieve a faster dev experience with hot reloading.
if [ "$component" == "kotsadm" ]; then
ec_build_and_load "kotsadm-web"
ec_exec k0s kubectl apply -f dev/manifests/kotsadm-web -n kotsadm
ec_exec k0s kubectl --kubeconfig=/var/lib/embedded-cluster/k0s/pki/admin.conf apply -f dev/manifests/kotsadm-web -n kotsadm
ec_patch "kotsadm-web"
fi

# Save original state
if [ ! -f "dev/patches/$component-down-ec.yaml.tmp" ]; then
ec_exec k0s kubectl get deployment $(deployment $component) -n kotsadm -oyaml > dev/patches/$component-down-ec.yaml.tmp
ec_exec k0s kubectl --kubeconfig=/var/lib/embedded-cluster/k0s/pki/admin.conf get deployment $(deployment $component) -n kotsadm -oyaml > dev/patches/$component-down-ec.yaml.tmp
fi

# Patch the deployment
ec_patch $component

# Wait for rollout to complete
ec_exec k0s kubectl rollout status deployment/$(deployment $component) -n kotsadm
ec_exec k0s kubectl --kubeconfig=/var/lib/embedded-cluster/k0s/pki/admin.conf rollout status deployment/$(deployment $component) -n kotsadm

# Up into the updated deployment
ec_up $component

0 comments on commit eec10d8

Please sign in to comment.