INNER CODE UNIT · Go
init
FairwindsOps/goldilocks · cmd/controller.go:39
func init() {
rootCmd.AddCommand(controllerCmd)
controllerCmd.PersistentFlags().BoolVar(&onByDefault, "on-by-default", false, "Add goldilocks to every namespace that isn't explicitly excluded.")
controllerCmd.PersistentFlags().BoolVar(&dryRun, "dry-run", false, "If true, don't mutate resources, just list what would have been created.")
controllerCmd.PersistentFlags().StringSliceVar(&includeNamespaces, "include-namespaces", []string{}, "Comma delimited list of namespaces to include from recommendations.")
controllerCmd.PersistentFlags().StringSliceVar(&excludeNamespaces, "exclude-namespaces", []string{}, "Comma delimited list of namespaces to exclude from recommendations.")
controllerCmd.PersistentFlags().StringSliceVar(&ignoreControllerKind, "ignore-controller-kind", []string{}, "Comma delimited list of controller kinds to exclude from recommendations.")
controllerCmd.PersistentFlags().IntVar(&metricsPort, "metrics-port", 8080, "The port to serve /metrics and /healthz on.")
}
var controllerCmd = &cobra.Command{
Use: "controller",
Short: "Run goldilocks as a controller inside a kubernetes cluster.",
Long: `Run goldilocks as a controller.`,
Run: func(cmd *cobra.Command, args []string) {
vpaReconciler := vpa.GetInstance()
vpaReconciler.OnByDefault = onByDefault
vpaReconciler.IncludeNamespaces = includeNamespaces