From c24c1e8c2e6e35835489c6b250e5dc61684409cd Mon Sep 17 00:00:00 2001 From: Peter Engelbert Date: Thu, 26 Feb 2026 12:52:05 -0500 Subject: [PATCH] Rename internal AllowlistEntry field to `Command` Signed-off-by: Peter Engelbert --- staging/src/k8s.io/kubectl/pkg/config/types.go | 6 +++--- staging/src/k8s.io/kubectl/pkg/config/v1beta1/types.go | 7 +++++++ staging/src/k8s.io/kubectl/pkg/kuberc/kuberc_test.go | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/staging/src/k8s.io/kubectl/pkg/config/types.go b/staging/src/k8s.io/kubectl/pkg/config/types.go index b310ceae4e8..3fecc679a8a 100644 --- a/staging/src/k8s.io/kubectl/pkg/config/types.go +++ b/staging/src/k8s.io/kubectl/pkg/config/types.go @@ -115,12 +115,12 @@ const ( // the logical AND of all checks corresponding to the specified fields within // the entry. type AllowlistEntry struct { - // Name matching is performed by first resolving the absolute path of both + // Command matching is performed by first resolving the absolute path of both // the plugin and the name in the allowlist entry using `exec.LookPath`. It // will be called on both, and the resulting strings must be equal. If - // either call to `exec.LookPath` results in an error, the `Name` check + // either call to `exec.LookPath` results in an error, the `Command` check // will be considered a failure. - Name string + Command string } // AliasOverride stores the alias definitions. diff --git a/staging/src/k8s.io/kubectl/pkg/config/v1beta1/types.go b/staging/src/k8s.io/kubectl/pkg/config/v1beta1/types.go index e1d5409a185..575840b6f0e 100644 --- a/staging/src/k8s.io/kubectl/pkg/config/v1beta1/types.go +++ b/staging/src/k8s.io/kubectl/pkg/config/v1beta1/types.go @@ -121,7 +121,14 @@ type AllowlistEntry struct { // will be called on both, and the resulting strings must be equal. If // either call to `exec.LookPath` results in an error, the `Name` check // will be considered a failure. + // Deprecated: use Command instead Name string `json:"name"` + // Name matching is performed by first resolving the absolute path of both + // the plugin and the name in the allowlist entry using `exec.LookPath`. It + // will be called on both, and the resulting strings must be equal. If + // either call to `exec.LookPath` results in an error, the `Name` check + // will be considered a failure. + Command string `json:"command"` } // AliasOverride stores the alias definitions. diff --git a/staging/src/k8s.io/kubectl/pkg/kuberc/kuberc_test.go b/staging/src/k8s.io/kubectl/pkg/kuberc/kuberc_test.go index 01afec48915..a1b6cd3a024 100644 --- a/staging/src/k8s.io/kubectl/pkg/kuberc/kuberc_test.go +++ b/staging/src/k8s.io/kubectl/pkg/kuberc/kuberc_test.go @@ -2978,8 +2978,8 @@ users: return &config.Preference{ CredentialPluginPolicy: config.CredentialPluginPolicy("Allowlist"), CredentialPluginAllowlist: []config.AllowlistEntry{ - {Name: "bar"}, - {Name: "baz"}, + {Command: "bar"}, + {Command: "baz"}, }, }, nil }