Add OIDC authentication plugin import#302
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for OIDC authentication by importing Kubernetes client-go authentication plugins, addressing issue #300. The change enables Helm operations to work with clusters using OIDC, Azure AD, GCP, and exec-based authentication methods.
- Adds new
plugins.gofile with side-effect imports for Kubernetes authentication plugins - Reorganizes imports in
helm.goto follow standard Go grouping conventions
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| native/internal/helm/plugins.go | Introduces authentication plugin imports (azure, exec, gcp, oidc) to enable various Kubernetes authentication methods |
| native/internal/helm/helm.go | Refactors import statements to group standard library and third-party imports separately |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import _ "k8s.io/client-go/plugin/pkg/client/auth/azure" | ||
| import _ "k8s.io/client-go/plugin/pkg/client/auth/exec" | ||
| import _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" | ||
| import _ "k8s.io/client-go/plugin/pkg/client/auth/oidc" |
There was a problem hiding this comment.
The import statements should be grouped together in a single import block with parentheses, following the Go convention and the style used throughout this codebase. Consider formatting like this:
import (
_ "k8s.io/client-go/plugin/pkg/client/auth/azure"
_ "k8s.io/client-go/plugin/pkg/client/auth/exec"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
)This is the standard Go style for multiple imports and matches the pattern used in other files in this project (e.g., helm.go, install.go, version.go).
| import _ "k8s.io/client-go/plugin/pkg/client/auth/azure" | |
| import _ "k8s.io/client-go/plugin/pkg/client/auth/exec" | |
| import _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" | |
| import _ "k8s.io/client-go/plugin/pkg/client/auth/oidc" | |
| import ( | |
| _ "k8s.io/client-go/plugin/pkg/client/auth/azure" | |
| _ "k8s.io/client-go/plugin/pkg/client/auth/exec" | |
| _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" | |
| _ "k8s.io/client-go/plugin/pkg/client/auth/oidc" | |
| ) |
Fixes #300