@@ -109,27 +109,17 @@ jobs:
109109 - name : Debug cluster status
110110 if : ${{ env.DEBUG == 'true' }}
111111 run : |
112- echo "=== Debug Info ==="
113112 kubectl cluster-info || echo "Cluster info failed"
114113 kubectl get nodes -o wide || echo "Get nodes failed"
115114 kubectl get pods -A || echo "Get pods failed"
116115 kind get clusters || echo "Kind get clusters failed"
117- echo "=================="
118116 - name : Checkout dashboard repo
119117 uses : actions/checkout@v4
120118 with :
121119 path : karmada-dashboard
122120
123121 - name : Generate KARMADA_TOKEN for CI
124122 run : |
125- # kubectl --context=karmada-apiserver create sa e2e-test -n kube-system
126- # kubectl --context=karmada-apiserver create clusterrolebinding e2e-test-binding \
127- # --clusterrole=cluster-admin \
128- # --serviceaccount=kube-system:e2e-test
129-
130- # 使用 kubectl create token 命令生成临时 token
131- #TOKEN=$(kubectl --context=karmada-apiserver create token e2e-test -n kube-system --duration=3600s)
132- # kubectl --context=karmada-apiserver apply -f karmada-dashboard/artifacts/dashboard
133123 kubectl --context=karmada-host apply -k karmada-dashboard/artifacts/overlays/nodeport-mode
134124 kubectl --context=karmada-apiserver apply -f karmada-dashboard/artifacts/dashboard/karmada-dashboard-sa.yaml
135125 TOKEN=$(kubectl --context=karmada-apiserver -n karmada-system get secret/karmada-dashboard-secret -o go-template="{{.data.token | base64decode}}")
@@ -160,7 +150,6 @@ jobs:
160150 make run-api &
161151 echo $! > .api.pid
162152 sleep 5
163- # ===== 添加API服务器健康检查 =====
164153 - name : Wait for API server to be ready
165154 run : |
166155 echo "Waiting for API server to be ready..."
@@ -182,23 +171,20 @@ jobs:
182171 - name : Debug environment before starting dashboard
183172 if : ${{ env.DEBUG == 'true' }}
184173 run : |
185- echo "=== Environment Debug ==="
186174 echo "KARMADA_TOKEN is set: ${{ env.KARMADA_TOKEN != '' }}"
187175 echo "KUBECONFIG: $KUBECONFIG"
188176 echo "Current directory: $(pwd)"
189177 echo "Dashboard directory contents:"
190178 ls -la karmada-dashboard/ || echo "No dashboard directory"
191179 echo "Check if Makefile exists:"
192180 ls -la karmada-dashboard/Makefile || echo "No Makefile found"
193- echo "========================="
194181 - name : Build frontend (for e2e)
195182 working-directory : karmada-dashboard/ui/apps/dashboard
196183 run : |
197184 pnpm build
198185 - name : Test API connectivity before running tests
199186 run : |
200187 echo "Testing API connectivity..."
201- # 测试几个关键的API端点
202188 curl -f http://localhost:8000/api/v1/cluster && echo "✓ Cluster API works" || echo "✗ Cluster API failed"
203189 curl -f http://localhost:8000/api/v1/namespace && echo "✓ Namespace API works" || echo "✗ Namespace API failed"
204190 echo "API tests completed"
@@ -211,7 +197,6 @@ jobs:
211197 working-directory : karmada-dashboard/ui/apps/dashboard
212198 run : |
213199 pnpm exec playwright test
214- # ===== 添加进程清理 =====
215200 - name : Cleanup processes
216201 if : always()
217202 run : |
0 commit comments