Skip to content

feat: pinnable context names per profile#32

Merged
juliamertz merged 2 commits into
mainfrom
feat/context-pinning
Jun 4, 2026
Merged

feat: pinnable context names per profile#32
juliamertz merged 2 commits into
mainfrom
feat/context-pinning

Conversation

@juliamertz

Copy link
Copy Markdown
Member

to prevent deploying to the wrong cluster you can now enforce a specific context name per profile with something like

contextMappings:
    local: k3d-brainpod-local
    test: brainpod-test
    ...

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds an optional safety check to prevent deploying with the “wrong” active Kubernetes context by allowing profiles to pin an expected current-context name via contextMappings.

Changes:

  • Introduces contextMappings in configuration to map profile names to expected kubeconfig context names.
  • Passes the selected profile into the deploy command so it can enforce the expected context.
  • Adds deploy-time validation that compares the active kubeconfig context to the configured expected value and errors on mismatch.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/main.rs Threads profile through to cmd::deploy::run(...) so deploy can apply profile-specific checks.
src/config.rs Adds context_mappings (contextMappings in YAML) to the config model with a default empty map.
src/cmd/deploy.rs Implements context enforcement and introduces contextual error types for mismatch/missing kube context.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/cmd/deploy.rs Outdated
Comment thread src/cmd/deploy.rs
@juliamertz juliamertz force-pushed the feat/context-pinning branch from 4320e5e to 28ac29c Compare June 4, 2026 07:25

@dmeijboom dmeijboom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM (one comment)

Comment thread src/cmd/deploy.rs Outdated
@juliamertz juliamertz force-pushed the feat/context-pinning branch from 28ac29c to 7f8f55d Compare June 4, 2026 07:42
@juliamertz juliamertz merged commit e730075 into main Jun 4, 2026
10 checks passed
@juliamertz juliamertz deleted the feat/context-pinning branch June 4, 2026 07:46
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.

3 participants