diff --git a/go.mod b/go.mod index 33adee9e5..c390da4d4 100644 --- a/go.mod +++ b/go.mod @@ -92,3 +92,5 @@ require ( sigs.k8s.io/kustomize/api v0.19.0 // indirect sigs.k8s.io/randfill v1.0.0 // indirect ) + +replace k8s.io/code-generator => k8s.io/code-generator v0.0.0-20250503071920-ec35be305d73 diff --git a/pkg/kuberc/kuberc.go b/pkg/kuberc/kuberc.go index 03c6a2ef9..ecd02ee0f 100644 --- a/pkg/kuberc/kuberc.go +++ b/pkg/kuberc/kuberc.go @@ -194,7 +194,7 @@ func (p *Preferences) applyAliases(rootCmd *cobra.Command, kuberc *config.Prefer var commandName string // first "non-flag" arguments var commandIndex int for index, arg := range args[1:] { - if !strings.HasPrefix(arg, "-") { + if !strings.HasPrefix(arg, "-") && !strings.HasPrefix(arg, cobra.ShellCompRequestCmd) { commandName = arg commandIndex = index + 1 break