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

Function printInfoOperatorResponse

cli/cmd/cluster.go:956–982  ·  view source on GitHub ↗
(clusterConfig clusterconfig.Config, stacks clusterstate.ClusterStacks, operatorEndpoint string)

Source from the content-addressed store, hash-verified

954}
955
956func 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
984func getInfoOperatorResponse(operatorEndpoint string) (*schema.InfoResponse, error) {
985 operatorConfig := cluster.OperatorConfig{

Callers 1

cmdInfoFunction · 0.85

Calls 6

BoldFunction · 0.92
getInfoOperatorResponseFunction · 0.85
printInfoPricingFunction · 0.85
printInfoNodesFunction · 0.85
TableStringMethod · 0.80
PrintMethod · 0.45

Tested by

no test coverage detected