INNER CODE UNIT · Go

main

inspektor-gadget/inspektor-gadget · cmd/kubectl-gadget/main.go:56

func main() {
	if experimental.Enabled() {
		log.Info("Experimental features enabled")
	}

	common.AddConfigFlag(rootCmd)
	common.AddVerboseFlag(rootCmd)

	// Some commands don't need the gadget namespace. Run then before to avoid
	// printing warnings about gadget namespace not found.
	needGadgetNamespace := true
	isHelp := len(os.Args) == 1

	// Need to loop through all arguments to skip flags...
	for _, arg := range os.Args[1:] {
		switch arg {
		case "completion", "deploy", "version":
			needGadgetNamespace = false

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…