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

Optionally override of session token in org token #536

Merged
merged 1 commit into from
May 28, 2024

Conversation

RedbackThomson
Copy link
Member

Description of your changes

Fixes #531

Add a new UP_TOKEN environment variable that can be used to override the session token present in the current profile.

I have:

  • Read and followed Upbound's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR, as appropriate.

How has this code been tested

Crafting a KUBECONFIG that uses UP_TOKEN instead of UP_PROFILE works!

apiVersion: v1
clusters:
- cluster:
    insecure-skip-tls-verify: true
    server: https://upbound-aws-us-east-1.space.u5d.dev/apis/spaces.upbound.io/v1beta1/namespaces/default/controlplanes/cbuto-test/k8s
  name: upbound
contexts:
- context:
    cluster: upbound
    extensions:
    - extension:
        apiVersion: upbound.io/v1alpha1
        kind: SpaceExtension
        spec:
          cloud:
            organization: upbound
      name: spaces.upbound.io/space
    namespace: default
    user: upbound
  name: upbound
current-context: upbound
kind: Config
preferences: {}
users:
- name: upbound
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1
      args:
      - organization
      - token
      command: up
      env:
      - name: ORGANIZATION
        value: upbound
      - name: UP_TOKEN
        value:  <redacted>
      interactiveMode: IfAvailable
      provideClusterInfo: false

Copy link
Member

@adamwg adamwg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@RedbackThomson RedbackThomson merged commit cd944f6 into upbound:main May 28, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support explicit session token as env var for up org token
2 participants