|
|
|
@ -17,7 +17,6 @@ limitations under the License.
|
|
|
|
package cmd
|
|
|
|
package cmd
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"log"
|
|
|
|
"log"
|
|
|
|
"log/slog"
|
|
|
|
"log/slog"
|
|
|
|
@ -28,8 +27,6 @@ import (
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/spf13/pflag"
|
|
|
|
"github.com/spf13/pflag"
|
|
|
|
|
|
|
|
|
|
|
|
"k8s.io/klog/v2"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"helm.sh/helm/v4/pkg/action"
|
|
|
|
"helm.sh/helm/v4/pkg/action"
|
|
|
|
"helm.sh/helm/v4/pkg/cli"
|
|
|
|
"helm.sh/helm/v4/pkg/cli"
|
|
|
|
"helm.sh/helm/v4/pkg/cli/output"
|
|
|
|
"helm.sh/helm/v4/pkg/cli/output"
|
|
|
|
@ -284,24 +281,3 @@ func compVersionFlag(chartRef string, _ string) ([]string, cobra.ShellCompDirect
|
|
|
|
|
|
|
|
|
|
|
|
return versions, cobra.ShellCompDirectiveNoFileComp
|
|
|
|
return versions, cobra.ShellCompDirectiveNoFileComp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// addKlogFlags adds flags from k8s.io/klog
|
|
|
|
|
|
|
|
// marks the flags as hidden to avoid polluting the help text
|
|
|
|
|
|
|
|
func addKlogFlags(fs *pflag.FlagSet) {
|
|
|
|
|
|
|
|
local := flag.NewFlagSet("klog", flag.ExitOnError)
|
|
|
|
|
|
|
|
klog.InitFlags(local)
|
|
|
|
|
|
|
|
local.VisitAll(func(fl *flag.Flag) {
|
|
|
|
|
|
|
|
fl.Name = normalize(fl.Name)
|
|
|
|
|
|
|
|
if fs.Lookup(fl.Name) != nil {
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
newflag := pflag.PFlagFromGoFlag(fl)
|
|
|
|
|
|
|
|
newflag.Hidden = true
|
|
|
|
|
|
|
|
fs.AddFlag(newflag)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// normalize replaces underscores with hyphens
|
|
|
|
|
|
|
|
func normalize(s string) string {
|
|
|
|
|
|
|
|
return strings.ReplaceAll(s, "_", "-")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|