MCPcopy
hub / github.com/cortexlabs/cortex / MustGetOperatorConfig

Function MustGetOperatorConfig

cli/cmd/lib_cli_config.go:439–462  ·  view source on GitHub ↗
(envName string)

Source from the content-addressed store, hash-verified

437}
438
439func MustGetOperatorConfig(envName string) cluster.OperatorConfig {
440 clientID := clientID()
441 env, err := readEnv(envName)
442 if err != nil {
443 exit.Error(err)
444 }
445
446 if env == nil {
447 exit.Error(ErrorEnvironmentNotFound(envName))
448 }
449
450 operatorConfig := cluster.OperatorConfig{
451 Telemetry: isTelemetryEnabled(),
452 ClientID: clientID,
453 EnvName: env.Name,
454 }
455
456 if env.OperatorEndpoint == "" {
457 exit.Error(ErrorFieldNotFoundInEnvironment(cliconfig.OperatorEndpointKey, env.Name))
458 }
459 operatorConfig.OperatorEndpoint = env.OperatorEndpoint
460
461 return operatorConfig
462}
463
464func listConfiguredEnvs() ([]*cliconfig.Environment, error) {
465 cliConfig, err := readCLIConfig()

Callers 13

logs.goFile · 0.85
getTaskJobFunction · 0.85
refresh.goFile · 0.85
delete.goFile · 0.85
trafficSplitTableFunction · 0.85
describeAPIFunction · 0.85
get.goFile · 0.85
getAPIsInAllEnvironmentsFunction · 0.85
getAPIsByEnvFunction · 0.85
getAPIFunction · 0.85
deploy.goFile · 0.85
version.goFile · 0.85

Calls 6

ErrorFunction · 0.92
clientIDFunction · 0.85
readEnvFunction · 0.85
ErrorEnvironmentNotFoundFunction · 0.85
isTelemetryEnabledFunction · 0.85

Tested by

no test coverage detected