diff --git a/github-actions/kind-export-logs/action.yml b/github-actions/kind-export-logs/action.yml new file mode 100644 index 0000000..4146921 --- /dev/null +++ b/github-actions/kind-export-logs/action.yml @@ -0,0 +1,20 @@ +name: "Export all KinD pod logs" +description: "Step to export all KinD pod logs" + +inputs: + output-directory: + description: "Directory to export log files to" + required: true + cluster-name: + description: "Name of the KinD cluster" + required: false + default: cluster + +runs: + using: "composite" + steps: + - name: Export all KinD pod logs + run: | + echo "Export all KinD pod logs to ${{ inputs.output-directory }}" + kind export logs ${{ inputs.output-directory }} --name ${{ inputs.cluster-name }} + shell: bash diff --git a/github-actions/kind/action.yml b/github-actions/kind/action.yml index ea32bbf..7cd772f 100644 --- a/github-actions/kind/action.yml +++ b/github-actions/kind/action.yml @@ -2,10 +2,14 @@ name: "Set up KinD" description: "Step to start and configure KinD cluster" inputs: - kind-node-hostname: + node-hostname: description: "Hostname of the main kind node" required: false default: kind + cluster-name: + description: "Name of the KinD cluster" + required: false + default: cluster runs: using: "composite" @@ -43,7 +47,7 @@ runs: - name: Setup KinD cluster uses: helm/kind-action@v1.8.0 with: - cluster_name: cluster + cluster_name: ${{ inputs.cluster-name }} version: v0.17.0 config: ${{ env.KIND_CONFIG_FILE }} @@ -63,12 +67,12 @@ runs: kubectl annotate ingressclass nginx "ingressclass.kubernetes.io/is-default-class=true" kubectl -n ingress-nginx wait --timeout=300s --for=condition=Available deployments --all - - name: Add ${{ inputs.kind-node-hostname }} host to machine hosts + - name: Add ${{ inputs.node-hostname }} host to machine hosts shell: bash - run: echo "127.0.0.1 ${{ inputs.kind-node-hostname }}" | sudo tee -a /etc/hosts + run: echo "127.0.0.1 ${{ inputs.node-hostname }}" | sudo tee -a /etc/hosts - name: Set env variables for tests to properly leverage KinD cluster shell: bash run: | echo "CLUSTER_TYPE=KIND" >> $GITHUB_ENV - echo "CLUSTER_HOSTNAME=${{ inputs.kind-node-hostname }}" >> $GITHUB_ENV + echo "CLUSTER_HOSTNAME=${{ inputs.node-hostname }}" >> $GITHUB_ENV