(clusterConfig clusterconfig.Config, stacks clusterstate.ClusterStacks, operatorEndpoint string)
| 954 | } |
| 955 | |
| 956 | func printInfoOperatorResponse(clusterConfig clusterconfig.Config, stacks clusterstate.ClusterStacks, operatorEndpoint string) error { |
| 957 | fmt.Print("fetching cluster status ...\n\n") |
| 958 | |
| 959 | fmt.Println(stacks.TableString()) |
| 960 | |
| 961 | yamlBytes, err := yaml.Marshal(clusterConfig) |
| 962 | if err != nil { |
| 963 | return err |
| 964 | } |
| 965 | yamlString := string(yamlBytes) |
| 966 | |
| 967 | infoResponse, err := getInfoOperatorResponse(operatorEndpoint) |
| 968 | if err != nil { |
| 969 | fmt.Println(yamlString) |
| 970 | return err |
| 971 | } |
| 972 | infoResponse.ClusterConfig.Config = clusterConfig |
| 973 | |
| 974 | fmt.Println(console.Bold("cluster config:")) |
| 975 | fmt.Println(fmt.Sprintf("cluster version: %s", infoResponse.ClusterConfig.APIVersion)) |
| 976 | fmt.Print(yamlString) |
| 977 | |
| 978 | printInfoPricing(infoResponse, clusterConfig) |
| 979 | printInfoNodes(infoResponse) |
| 980 | |
| 981 | return nil |
| 982 | } |
| 983 | |
| 984 | func getInfoOperatorResponse(operatorEndpoint string) (*schema.InfoResponse, error) { |
| 985 | operatorConfig := cluster.OperatorConfig{ |
no test coverage detected