44
44
hack/cli-testing-environment.sh
45
45
46
46
# run a single e2e
47
- export KUBECONFIG=${HOME}/karmada/karmada-apiserver.config
47
+ export KUBECONFIG=${HOME}/.kube/karmada-host.config:${HOME}/ karmada/karmada-apiserver.config
48
48
GO111MODULE=on go install github.com/onsi/ginkgo/v2/ginkgo
49
49
ginkgo -v --race --trace -p --focus="[BasicPropagation] propagation testing deployment propagation testing" ./test/e2e/
50
50
- name : export logs
@@ -82,45 +82,25 @@ jobs:
82
82
- name : run karmadactl init with config file test
83
83
run : |
84
84
export CLUSTER_VERSION=kindest/node:${{ matrix.k8s }}
85
-
85
+
86
86
# Run custom test for workload configuration deployment
87
87
hack/cli-testing-init-with-config.sh
88
88
89
89
# run a single e2e
90
- export KUBECONFIG=${HOME}/karmada/karmada-apiserver.config
90
+ export KUBECONFIG=${HOME}/.kube/karmada-host.config:${HOME}/ karmada/karmada-apiserver.config
91
91
GO111MODULE=on go install github.com/onsi/ginkgo/v2/ginkgo
92
92
ginkgo -v --race --trace -p --focus="[BasicPropagation] propagation testing deployment propagation testing" ./test/e2e/
93
-
94
- - name : Get token info for registration
95
- id : token
96
- run : |
97
- export KUBECONFIG=${HOME}/karmada/karmada-apiserver.config
98
- CMD=$(karmadactl token create --print-register-command --kubeconfig $KUBECONFIG)
99
- TOKEN=$(echo "$CMD" | grep -o '\--token [^ ]*' | cut -d' ' -f2)
100
- HASH=$(echo "$CMD" | grep -o '\--discovery-token-ca-cert-hash [^ ]*' | cut -d' ' -f2)
101
- ENDPOINT=$(kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}' | sed 's|^https://||')
102
- echo "token=$TOKEN" >> $GITHUB_OUTPUT
103
- echo "hash=$HASH" >> $GITHUB_OUTPUT
104
- echo "endpoint=$ENDPOINT" >> $GITHUB_OUTPUT
105
-
106
- - name : Register cluster using token
107
- run : |
108
- karmadactl register ${{ steps.token.outputs.endpoint }} \
109
- --token ${{ steps.token.outputs.token }} \
110
- --discovery-token-ca-cert-hash ${{ steps.token.outputs.hash }} \
111
- --discovery-timeout=10m \
112
- --kubeconfig ${HOME}/karmada/karmada-apiserver.config
113
-
114
93
- name : export logs for config test
115
- if : always()
116
- run : |
117
- export ARTIFACTS_PATH=${{ github.workspace }}/karmadactl-test-logs/${{ matrix.k8s }}/config
118
- mkdir -p $ARTIFACTS_PATH
119
- mkdir -p $ARTIFACTS_PATH/karmada-host
120
- kind export logs --name=karmada-host $ARTIFACTS_PATH/karmada-host
121
- - name : upload config test logs
122
- if : always()
123
- uses : actions/upload-artifact@v4
124
- with :
125
- name : karmadactl_config_test_logs_${{ matrix.k8s }}
126
- path : ${{ github.workspace }}/karmadactl-test-logs/${{ matrix.k8s }}/config/
94
+ if : always()
95
+ run : |
96
+ export ARTIFACTS_PATH=${{ github.workspace }}/karmadactl-test-logs/${{ matrix.k8s }}/config
97
+ mkdir -p $ARTIFACTS_PATH
98
+
99
+ mkdir -p $ARTIFACTS_PATH/karmada-host
100
+ kind export logs --name=karmada-host $ARTIFACTS_PATH/karmada-host
101
+ - name : upload config test logs
102
+ if : always()
103
+ uses : actions/upload-artifact@v4
104
+ with :
105
+ name : karmadactl_config_test_logs_${{ matrix.k8s }}
106
+ path : ${{ github.workspace }}/karmadactl-test-logs/${{ matrix.k8s }}/config/
0 commit comments