(envName string)
| 437 | } |
| 438 | |
| 439 | func 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 | |
| 464 | func listConfiguredEnvs() ([]*cliconfig.Environment, error) { |
| 465 | cliConfig, err := readCLIConfig() |
no test coverage detected