Documentation ¶
Overview ¶
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var All = &cobra.Command{ Use: "all", Run: func(cmd *cobra.Command, args []string) { jsonPathTemplate := helpers.GetJsonTemplate(vars.OutputStringVar) empty := core.GetPods(vars.MustGatherRootPath, vars.Namespace, "", vars.AllNamespaceBoolVar, vars.OutputStringVar, vars.ShowLabelsBoolVar, jsonPathTemplate, true) if !empty { fmt.Println("") } empty = core.GetReplicationControllers(vars.MustGatherRootPath, vars.Namespace, "", vars.AllNamespaceBoolVar, vars.OutputStringVar, vars.ShowLabelsBoolVar, jsonPathTemplate, true) if !empty { fmt.Println("") } empty = core.GetServices(vars.MustGatherRootPath, vars.Namespace, "", vars.AllNamespaceBoolVar, vars.OutputStringVar, vars.ShowLabelsBoolVar, jsonPathTemplate, true) if !empty { fmt.Println("") } empty = apps.GetDaemonSets(vars.MustGatherRootPath, vars.Namespace, "", vars.AllNamespaceBoolVar, vars.OutputStringVar, vars.ShowLabelsBoolVar, jsonPathTemplate, true) if !empty { fmt.Println("") } empty = apps.GetDeployments(vars.MustGatherRootPath, vars.Namespace, "", vars.AllNamespaceBoolVar, vars.OutputStringVar, vars.ShowLabelsBoolVar, jsonPathTemplate, true) if !empty { fmt.Println("") } empty = apps.GetReplicaSets(vars.MustGatherRootPath, vars.Namespace, "", vars.AllNamespaceBoolVar, vars.OutputStringVar, vars.ShowLabelsBoolVar, jsonPathTemplate, true) if !empty { fmt.Println("") } empty = batch.GetJobs(vars.MustGatherRootPath, vars.Namespace, "", vars.AllNamespaceBoolVar, vars.OutputStringVar, vars.ShowLabelsBoolVar, jsonPathTemplate, true) if !empty { fmt.Println("") } empty = appz.GetDeploymentConfigs(vars.MustGatherRootPath, vars.Namespace, "", vars.AllNamespaceBoolVar, vars.OutputStringVar, vars.ShowLabelsBoolVar, jsonPathTemplate, true) if !empty { fmt.Println("") } empty = build.GetBuildConfigs(vars.MustGatherRootPath, vars.Namespace, "", vars.AllNamespaceBoolVar, vars.OutputStringVar, vars.ShowLabelsBoolVar, jsonPathTemplate, true) if !empty { fmt.Println("") } empty = build.GetBuilds(vars.MustGatherRootPath, vars.Namespace, "", vars.AllNamespaceBoolVar, vars.OutputStringVar, vars.ShowLabelsBoolVar, jsonPathTemplate, true) if !empty { fmt.Println("") } empty = image.GetImageStreams(vars.MustGatherRootPath, vars.Namespace, "", vars.AllNamespaceBoolVar, vars.OutputStringVar, vars.ShowLabelsBoolVar, jsonPathTemplate, true) if !empty { fmt.Println("") } empty = route.GetRoutes(vars.MustGatherRootPath, vars.Namespace, "", vars.AllNamespaceBoolVar, vars.OutputStringVar, vars.ShowLabelsBoolVar, jsonPathTemplate, true) if !empty { fmt.Println("") } }, Hidden: true, }
var MustGather = &cobra.Command{ Use: "mg", Run: func(cmd *cobra.Command, args []string) { file, _ := ioutil.ReadFile(viper.ConfigFileUsed()) omcConfigJson := types.Config{} _ = json.Unmarshal([]byte(file), &omcConfigJson) var data [][]string var emptyData [][]string headers := []string{"current", "id", "path", "namespace"} var mg []types.Context mg = omcConfigJson.Contexts for _, context := range mg { _list := []string{context.Current, context.Id, context.Path, context.Project} data = append(data, _list) } if reflect.DeepEqual(data, emptyData) { fmt.Println("There are no must-gather resources defined.") os.Exit(1) } else { helpers.PrintTable(headers, data) } }, Hidden: true, }
contextsCmd represents the mg command
Functions ¶
This section is empty.
Types ¶
This section is empty.