MCPcopy Index your code
hub / github.com/cortexlabs/cortex / clusterInit

Function clusterInit

cli/cmd/cluster.go:80–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78var _eksctlPrefixRegex = regexp.MustCompile(`^.*[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} \[.+] {2}`)
79
80func clusterInit() {
81 _clusterUpCmd.Flags().SortFlags = false
82 _clusterUpCmd.Flags().StringVarP(&_flagClusterUpEnv, "configure-env", "e", "", "name of environment to configure (default: the name of your cluster)")
83 _clusterUpCmd.Flags().BoolVarP(&_flagClusterDisallowPrompt, "yes", "y", false, "skip prompts")
84 _clusterCmd.AddCommand(_clusterUpCmd)
85
86 _clusterInfoCmd.Flags().SortFlags = false
87 addClusterConfigFlag(_clusterInfoCmd)
88 addClusterNameFlag(_clusterInfoCmd)
89 addClusterRegionFlag(_clusterInfoCmd)
90 _clusterInfoCmd.Flags().VarP(&_flagOutput, "output", "o", fmt.Sprintf("output format: one of %s", strings.Join(flags.OutputTypeStrings(), "|")))
91 _clusterInfoCmd.Flags().StringVarP(&_flagClusterInfoEnv, "configure-env", "e", "", "name of environment to configure")
92 _clusterInfoCmd.Flags().BoolVarP(&_flagClusterInfoDebug, "debug", "d", false, "save the current cluster state to a file")
93 _clusterInfoCmd.Flags().BoolVarP(&_flagClusterInfoPrintConfig, "print-config", "", false, "print the cluster config")
94 _clusterInfoCmd.Flags().BoolVarP(&_flagClusterDisallowPrompt, "yes", "y", false, "skip prompts")
95 _clusterCmd.AddCommand(_clusterInfoCmd)
96
97 _clusterConfigureCmd.Flags().SortFlags = false
98 _clusterConfigureCmd.Flags().BoolVarP(&_flagClusterDisallowPrompt, "yes", "y", false, "skip prompts")
99 _clusterCmd.AddCommand(_clusterConfigureCmd)
100
101 _clusterDownCmd.Flags().SortFlags = false
102 addClusterConfigFlag(_clusterDownCmd)
103 addClusterNameFlag(_clusterDownCmd)
104 addClusterRegionFlag(_clusterDownCmd)
105 _clusterDownCmd.Flags().BoolVarP(&_flagClusterDisallowPrompt, "yes", "y", false, "skip prompts")
106 _clusterDownCmd.Flags().BoolVar(&_flagClusterDownKeepAWSResources, "keep-aws-resources", false, "skip deletion of resources that cortex provisioned on aws (bucket contents, ebs volumes, log group)")
107 _clusterCmd.AddCommand(_clusterDownCmd)
108
109 _clusterExportCmd.Flags().SortFlags = false
110 addClusterConfigFlag(_clusterExportCmd)
111 addClusterNameFlag(_clusterExportCmd)
112 addClusterRegionFlag(_clusterExportCmd)
113 _clusterCmd.AddCommand(_clusterExportCmd)
114
115 _clusterHealthCmd.Flags().SortFlags = false
116 addClusterConfigFlag(_clusterHealthCmd)
117 addClusterNameFlag(_clusterHealthCmd)
118 addClusterRegionFlag(_clusterHealthCmd)
119 _clusterHealthCmd.Flags().VarP(&_flagOutput, "output", "o", fmt.Sprintf("output format: one of %s", strings.Join(flags.OutputTypeStringsExcluding(flags.YAMLOutputType), "|")))
120 _clusterCmd.AddCommand(_clusterHealthCmd)
121}
122
123func addClusterConfigFlag(cmd *cobra.Command) {
124 cmd.Flags().StringVarP(&_flagClusterConfig, "config", "c", "", "path to a cluster configuration file")

Callers 1

initFunction · 0.85

Calls 5

OutputTypeStringsFunction · 0.92
addClusterConfigFlagFunction · 0.85
addClusterNameFlagFunction · 0.85
addClusterRegionFlagFunction · 0.85

Tested by

no test coverage detected