Skip to content

Commit 2b6c0f1

Browse files
sutaakaropenshift-merge-bot[bot]
authored andcommitted
Add GitHub action for exporting KinD logs
1 parent 78776a4 commit 2b6c0f1

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Export all KinD pod logs"
2+
description: "Step to export all KinD pod logs"
3+
4+
inputs:
5+
output-directory:
6+
description: "Directory to export log files to"
7+
required: true
8+
cluster-name:
9+
description: "Name of the KinD cluster"
10+
required: false
11+
default: cluster
12+
13+
runs:
14+
using: "composite"
15+
steps:
16+
- name: Export all KinD pod logs
17+
run: |
18+
echo "Export all KinD pod logs to ${{ inputs.output-directory }}"
19+
kind export logs ${{ inputs.output-directory }} --name ${{ inputs.cluster-name }}
20+
shell: bash

github-actions/kind/action.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ name: "Set up KinD"
22
description: "Step to start and configure KinD cluster"
33

44
inputs:
5-
kind-node-hostname:
5+
node-hostname:
66
description: "Hostname of the main kind node"
77
required: false
88
default: kind
9+
cluster-name:
10+
description: "Name of the KinD cluster"
11+
required: false
12+
default: cluster
913

1014
runs:
1115
using: "composite"
@@ -43,7 +47,7 @@ runs:
4347
- name: Setup KinD cluster
4448
uses: helm/kind-action@v1.8.0
4549
with:
46-
cluster_name: cluster
50+
cluster_name: ${{ inputs.cluster-name }}
4751
version: v0.17.0
4852
config: ${{ env.KIND_CONFIG_FILE }}
4953

@@ -63,12 +67,12 @@ runs:
6367
kubectl annotate ingressclass nginx "ingressclass.kubernetes.io/is-default-class=true"
6468
kubectl -n ingress-nginx wait --timeout=300s --for=condition=Available deployments --all
6569
66-
- name: Add ${{ inputs.kind-node-hostname }} host to machine hosts
70+
- name: Add ${{ inputs.node-hostname }} host to machine hosts
6771
shell: bash
68-
run: echo "127.0.0.1 ${{ inputs.kind-node-hostname }}" | sudo tee -a /etc/hosts
72+
run: echo "127.0.0.1 ${{ inputs.node-hostname }}" | sudo tee -a /etc/hosts
6973

7074
- name: Set env variables for tests to properly leverage KinD cluster
7175
shell: bash
7276
run: |
7377
echo "CLUSTER_TYPE=KIND" >> $GITHUB_ENV
74-
echo "CLUSTER_HOSTNAME=${{ inputs.kind-node-hostname }}" >> $GITHUB_ENV
78+
echo "CLUSTER_HOSTNAME=${{ inputs.node-hostname }}" >> $GITHUB_ENV

0 commit comments

Comments
 (0)