Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documented kubeconfig_path output is never set #290

Closed
mikepilat opened this issue Jan 3, 2024 · 0 comments · Fixed by #292 or #294
Closed

Documented kubeconfig_path output is never set #290

mikepilat opened this issue Jan 3, 2024 · 0 comments · Fixed by #292 or #294
Labels
bug Something isn't working

Comments

@mikepilat
Copy link
Contributor

TL;DR

The documentation and action.yaml describe the output value kubeconfig_path that is supposed to point to the generated kubeconfig file, but it is empty after authenticating to a cluster.

Expected behavior

The output should be set.

Observed behavior

The output is not set.

Action YAML

jobs:
  deploy-kubernetes:
    name: Deploy to Kubernetes
    runs-on: ubuntu-latest
    permissions:
      contents: "read"
      id-token: "write"
    steps:
      - id: "auth"
        name: "Authenticate to Google Cloud"
        uses: "google-github-actions/auth@v1"
        with:
          workload_identity_provider: "my_wip"
          service_account: "my_sa"

      - id: "creds"
        name: Get GKE Credentials
        uses: "google-github-actions/get-gke-credentials@v1"
        with:
          cluster_name: "my_cluster"
          location: "my_region"
          use_internal_ip: true

      - id: "echo-path"
        name: Echo Kubeconfig Path
        run: |
          echo ${{ steps.creds.outputs.kubeconfig_path }}

Log output

No response

Additional information

This feature is helpful in my case since I am coordinating actions across multiple GKE clusters. Being able to auth to each cluster once and then act on all of them based on kubeconfig as needed is useful; Relying on solely the env vars output by the action makes this difficult, or multiple auths necessary.

You can of course work around this issue by capturing the KUBE_CONFIG_PATH env var to a GitHub output:

      - id: "capture-config"
        name: Capture Kubeconfig
        run: |
          echo "kubeconfig_path=$(echo -n $KUBE_CONFIG_PATH)" >> "$GITHUB_OUTPUT"

You can refer to this in later steps as steps.capture-config.outputs.kubeconfig_path.

PR incoming with the fix...

@mikepilat mikepilat added the bug Something isn't working label Jan 3, 2024
mikepilat added a commit to mikepilat/get-gke-credentials that referenced this issue Jan 3, 2024
mikepilat added a commit to mikepilat/get-gke-credentials that referenced this issue Jan 3, 2024
sethvargo added a commit that referenced this issue Jan 4, 2024
Closes
#291
Fixes
#290

Co-authored-by: Michael Pilat <mike@mikepilat.com>
sethvargo pushed a commit that referenced this issue Jan 23, 2024
## What's Changed
* Update README and CI to use latest version by @sethvargo in
#289
* Fix #290 - Set kubeconfig_path output by @sethvargo in
#292
* Update deps by @sethvargo in
#293


**Full Changelog**:
v2.0.0...a82b2b1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
1 participant