From 0a607bab28df970e58871868b0cd47cfcb230a15 Mon Sep 17 00:00:00 2001 From: Stefan Koelle <50440224+skoelle@users.noreply.github.com> Date: Sun, 9 Aug 2026 13:51:36 +0200 Subject: [PATCH] Remove context-pair logic, superseded by env-template based context resolution --- internal/kctl/pairs.go | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 internal/kctl/pairs.go diff --git a/internal/kctl/pairs.go b/internal/kctl/pairs.go deleted file mode 100644 index 26e5656..0000000 --- a/internal/kctl/pairs.go +++ /dev/null @@ -1,35 +0,0 @@ -// Package kctl contains the core, non-interactive logic of kctl-tui. -// Functions here are pure (no kubectl/tmux side effects) so they can be -// unit tested without a live cluster. -package kctl - -// ContextPair groups a set of related kubectl contexts that should be -// switchable via TAB while keeping the same namespace (e.g. staging/prod). -type ContextPair struct { - Name string `yaml:"name"` - Contexts []string `yaml:"contexts"` -} - -// FindNextContext returns the next context in the same pair/group as -// current, cycling through the group. Returns "", false if current is not -// part of any configured pair. -func FindNextContext(current string, pairs []ContextPair) (string, bool) { - for _, pair := range pairs { - idx := indexOf(pair.Contexts, current) - if idx == -1 { - continue - } - next := pair.Contexts[(idx+1)%len(pair.Contexts)] - return next, true - } - return "", false -} - -func indexOf(items []string, target string) int { - for i, v := range items { - if v == target { - return i - } - } - return -1 -}