Skip to content

Commit 3e51c46

Browse files
committed
fix ct install kubeconfig
1 parent 6108e85 commit 3e51c46

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

.github/workflows/mlflow-ci.yml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,13 @@ jobs:
235235
- name: Run Helm installation test with charts from Replicated registry
236236
run: |
237237
cd applications/mlflow
238+
# Save kubeconfig to a file
239+
KUBECONFIG_FILE="/tmp/kubeconfig-${{ github.run_id }}"
240+
echo "$KUBECONFIG" > "$KUBECONFIG_FILE"
241+
echo "Saved kubeconfig to $KUBECONFIG_FILE"
242+
238243
# Pass env vars directly to make
239-
KUBECONFIG="$KUBECONFIG" REPLICATED_APP="$REPLICATED_APP" REPLICATED_CHANNEL="$REPLICATED_CHANNEL" REPLICATED_LICENSE_ID="$REPLICATED_LICENSE_ID" make test-replicated-helm
244+
KUBECONFIG="$KUBECONFIG_FILE" REPLICATED_APP="$REPLICATED_APP" REPLICATED_CHANNEL="$REPLICATED_CHANNEL" REPLICATED_LICENSE_ID="$REPLICATED_LICENSE_ID" make test-replicated-helm
240245
env:
241246
KUBECONFIG: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
242247
REPLICATED_APP: ${{ env.APP_SLUG }}
@@ -248,8 +253,16 @@ jobs:
248253
if: failure()
249254

250255
- name: Collect bundle
251-
run: ./support-bundle --kubeconfig=${{ steps.create-cluster.outputs.cluster-kubeconfig }} --interactive=false -o ci-bundle-${{ matrix.cluster.distribution }}-${{ matrix.cluster.version }} https://raw.githubusercontent.com/replicatedhq/troubleshoot-specs/main/in-cluster/default.yaml
256+
run: |
257+
# Save kubeconfig to a file
258+
KUBECONFIG_FILE="/tmp/kubeconfig-helm-bundle-${{ github.run_id }}"
259+
echo "$KUBECONFIG" > "$KUBECONFIG_FILE"
260+
echo "Saved kubeconfig to $KUBECONFIG_FILE"
261+
262+
./support-bundle --kubeconfig="$KUBECONFIG_FILE" --interactive=false -o ci-bundle-${{ matrix.cluster.distribution }}-${{ matrix.cluster.version }} https://raw.githubusercontent.com/replicatedhq/troubleshoot-specs/main/in-cluster/default.yaml
252263
if: failure()
264+
env:
265+
KUBECONFIG: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
253266

254267
- name: Upload support bundle artifact
255268
uses: actions/upload-artifact@v4
@@ -350,8 +363,16 @@ jobs:
350363
if: failure()
351364

352365
- name: Collect bundle
353-
run: ./support-bundle --kubeconfig=${{ steps.create-cluster.outputs.cluster-kubeconfig }} --interactive=false -o kots-ci-bundle-${{ matrix.cluster.distribution }}-${{ matrix.cluster.version }} https://raw.githubusercontent.com/replicatedhq/troubleshoot-specs/main/in-cluster/default.yaml
366+
run: |
367+
# Save kubeconfig to a file
368+
KUBECONFIG_FILE="/tmp/kubeconfig-kots-bundle-${{ github.run_id }}"
369+
echo "$KUBECONFIG" > "$KUBECONFIG_FILE"
370+
echo "Saved kubeconfig to $KUBECONFIG_FILE"
371+
372+
./support-bundle --kubeconfig="$KUBECONFIG_FILE" --interactive=false -o kots-ci-bundle-${{ matrix.cluster.distribution }}-${{ matrix.cluster.version }} https://raw.githubusercontent.com/replicatedhq/troubleshoot-specs/main/in-cluster/default.yaml
354373
if: failure()
374+
env:
375+
KUBECONFIG: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
355376

356377
- name: Upload support bundle artifact
357378
uses: actions/upload-artifact@v4
@@ -370,16 +391,17 @@ jobs:
370391
cleanup-test-release:
371392
runs-on: ubuntu-22.04
372393
needs: [create-release, kots-install-test, helm-install-test]
394+
if: always()
373395
steps:
374396
- name: Archive Customer
375-
if: ${{ needs.create-release.outputs.customer-id != '' }}
397+
if: ${{ always() && needs.create-release.outputs.customer-id != '' }}
376398
uses: replicatedhq/replicated-actions/[email protected]
377399
with:
378400
api-token: ${{ secrets.REPLICATED_PLATFORM_EXAMPLES_TOKEN }}
379401
customer-id: ${{ needs.create-release.outputs.customer-id }}
380402

381403
- name: Archive Channel
382-
if: ${{ needs.create-release.outputs.channel-slug != '' }}
404+
if: ${{ always() && needs.create-release.outputs.channel-slug != '' }}
383405
uses: replicatedhq/replicated-actions/[email protected]
384406
with:
385407
app-slug: ${{ env.APP_SLUG }}

0 commit comments

Comments
 (0)