INNER CODE UNIT · Go

init

controlplaneio/kubesec · cmd/scan.go:37

func init() {
	scanCmd.Flags().BoolVar(&debug, "debug", false, "turn on debug logs")
	scanCmd.Flags().BoolVar(&absolutePath, "absolute-path", false, "use the absolute path for the file name")
	scanCmd.Flags().StringVarP(&format, "format", "f", "json", "Set output format (json, table, template)")
	scanCmd.Flags().StringVar(&k8sVersion, "kubernetes-version", "", "Kubernetes version to validate manifets")
	scanCmd.Flags().StringSliceVar(&schemaLocations, "schema-location", []string{}, "Override schema location search path, local or http (can be specified multiple times)")
	scanCmd.Flags().StringVarP(&template, "template", "t", "", "Set output template, it will check for a file or read input as the template")
	scanCmd.Flags().StringSliceVarP(&rulesIDs, "rules", "r", []string{}, "Comma-separated list of rule IDs to scan (empty scans all rules). Run 'kubesec print-rules' to see all rules")
	scanCmd.Flags().StringVarP(&outputLocation, "output", "o", "", "Set output location")
	scanCmd.Flags().IntVar(&exitCode, "exit-code", 2, "Set the exit-code to use on failure")
	rootCmd.AddCommand(scanCmd)
}

// File holds the name and contents
type File struct {
	fileName  string
	fileBytes []byte
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…