Skip to content

Conversation

@chuliang
Copy link
Contributor

@chuliang chuliang commented Feb 4, 2026

Description

Add kubernetes part of the browser

Fixes #133 (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (improvement of existing commands)
  • Breaking change (fix or feature that can break a current behavior)
  • Documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code
  • I updated the documentation by running make doc
  • I ran go mod tidy
  • I have added tests that prove my fix is effective or that my feature works

@chuliang chuliang force-pushed the dev/jtanguy/browser-k8s branch 4 times, most recently from cbbd469 to 9688aff Compare February 5, 2026 17:17
@chuliang chuliang marked this pull request as ready for review February 5, 2026 17:21
@chuliang chuliang requested a review from a team as a code owner February 5, 2026 17:21
Your Name added 2 commits February 9, 2026 09:45
Signed-off-by: Julien Tanguy <julien.tanguy@corp.ovh.com>
Extract rendering logic into reusable view components with dedicated
packages for instances and kubernetes resources. Create shared styles,
common views (loading, error, empty), and fix label alignment issues
in detail views.

Signed-off-by: Julien Tanguy <julien.tanguy@corp.ovh.com>
@chuliang chuliang force-pushed the dev/jtanguy/browser-k8s branch 3 times, most recently from 46e5cf4 to d3e29d2 Compare February 9, 2026 08:52
@amstuta amstuta force-pushed the dev/jtanguy/browser-k8s branch 2 times, most recently from 3170d9f to 3b58f20 Compare February 9, 2026 10:25
Signed-off-by: Julien Tanguy <julien.tanguy@corp.ovh.com>
Signed-off-by: Arthur Amstutz <arthur.amstutz@corp.ovh.com>
@amstuta amstuta force-pushed the dev/jtanguy/browser-k8s branch from 3b58f20 to be386c0 Compare February 9, 2026 10:25
amstuta
amstuta previously approved these changes Feb 9, 2026
mxpetit
mxpetit previously approved these changes Feb 9, 2026
@rbeuque74 rbeuque74 requested a review from Copilot February 9, 2026 17:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Kubernetes support to the interactive “browser” TUI, including cluster listing, detail/actions, and node pool management.

Changes:

  • Introduces shared view primitives (interface/base/context), common views, and centralized styling helpers.
  • Adds Kubernetes-specific views (table/detail/node pools + action flows like upgrade/policy/delete and k9s integration).
  • Updates the browser command help text and regenerates CLI docs (adds --filter option docs for container-registry commands).

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
internal/services/browser/views/view.go Adds view interface, shared context, and base view helpers for the TUI views.
internal/services/browser/views/styles.go Centralizes lipgloss colors/styles and rendering helpers used across views.
internal/services/browser/views/kubernetes/table.go New Kubernetes clusters table view with filtering and selection behavior.
internal/services/browser/views/kubernetes/detail.go New Kubernetes cluster detail view with action selection and confirmation UX.
internal/services/browser/views/kubernetes/nodepools.go Adds node pools list/detail + scale/delete flows and related messages.
internal/services/browser/views/instances/table.go Adds instances table view with filtering (mirrors Kubernetes table UX).
internal/services/browser/views/instances/detail.go Adds instances detail view with action confirmation UX.
internal/services/browser/views/common.go Adds reusable Loading/Error/Empty views and navigation message types.
internal/services/browser/api.go Wires Kubernetes API calls + wizard handlers into the browser model/controller logic.
internal/cmd/browser.go Marks the browser feature as experimental in command description/help.
doc/ovhcloud_cloud_container-registry_ip-restrictions_registry_list.md Regenerated docs: documents new --filter option.
doc/ovhcloud_cloud_container-registry_ip-restrictions_management_list.md Regenerated docs: documents new --filter option.

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

Comment on lines 2963 to 2978
// Save kubeconfig to file
homeDir, err := os.UserHomeDir()
if err != nil {
return kubeActionMsg{err: fmt.Errorf("failed to get home directory: %w", err)}
}

kubeDir := filepath.Join(homeDir, ".kube")
if err := os.MkdirAll(kubeDir, 0700); err != nil {
return kubeActionMsg{err: fmt.Errorf("failed to create .kube directory: %w", err)}
}

kubeconfigPath := filepath.Join(kubeDir, "config")
if err := ioutil.WriteFile(kubeconfigPath, []byte(kubeconfig), 0600); err != nil {
return kubeActionMsg{err: fmt.Errorf("failed to save kubeconfig: %w", err)}
}

Copy link
Member

Choose a reason for hiding this comment

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

Maybe should be a temp dir, what do you think ?
Here, it will override the .kube/config of the user silently

Copy link
Collaborator

Choose a reason for hiding this comment

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

you're right, will do that !

Copy link
Collaborator

Choose a reason for hiding this comment

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

@rbeuque74 I added a selector to choose where to store the kubeconfig when running command kubeconfig, and when running K9S the kubeconfig is stored in a temp dir.

Signed-off-by: Arthur Amstutz <arthur.amstutz@corp.ovh.com>
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.

[Feature]: Generate kubeconfig and launch k9s/kubectl for selected cluster

4 participants