Skip to content

Commit

Permalink
fix: simplify token retrieval in installation workflow for improved c…
Browse files Browse the repository at this point in the history
…larity

Signed-off-by: Akash <[email protected]>
  • Loading branch information
SkySingh04 committed Feb 2, 2025
1 parent 0fae004 commit cc9d564
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions .github/workflows/installation-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,7 @@ jobs:
ls -la $HOME/.kube/karmada.config
cat $HOME/.kube/karmada.config
- name: Get token info
id: token
run: |
export KUBECONFIG=$HOME/.kube/karmada.config
CMD=$(karmadactl token create --print-register-command --kubeconfig $HOME/.kube/karmada.config)
TOKEN=$(echo "$CMD" | grep -o '\--token [^ ]*' | cut -d' ' -f2)
HASH=$(echo "$CMD" | grep -o '\--discovery-token-ca-cert-hash [^ ]*' | cut -d' ' -f2)
ENDPOINT=$(echo "$CMD" | awk '{print $2}')
echo "token=$TOKEN" >> $GITHUB_OUTPUT
echo "hash=$HASH" >> $GITHUB_OUTPUT
echo "endpoint=$ENDPOINT" >> $GITHUB_OUTPUT
- name: Register cluster
run: |
karmadactl register ${{ steps.token.outputs.endpoint }} \
--token ${{ steps.token.outputs.token }} \
--discovery-token-ca-cert-hash ${{ steps.token.outputs.hash }} \
--kubeconfig $HOME/.kube/karmada.config
export KUBECONFIG=$HOME/.kube/karmada.config
$(karmadactl token create --print-register-command --kubeconfig $HOME/.kube/karmada.config)

0 comments on commit cc9d564

Please sign in to comment.