diff --git a/config/crds/troubleshoot.sh_analyzers.yaml b/config/crds/troubleshoot.sh_analyzers.yaml index 1f4f2453..ce1d8b5f 100644 --- a/config/crds/troubleshoot.sh_analyzers.yaml +++ b/config/crds/troubleshoot.sh_analyzers.yaml @@ -128,7 +128,6 @@ spec: type: object type: array required: - - namespaces - outcomes type: object clusterVersion: @@ -316,6 +315,10 @@ spec: type: string namespace: type: string + namespaces: + items: + type: string + type: array outcomes: items: properties: @@ -350,7 +353,6 @@ spec: type: array required: - name - - namespace - outcomes type: object distribution: @@ -495,6 +497,10 @@ spec: type: string namespace: type: string + namespaces: + items: + type: string + type: array outcomes: items: properties: @@ -529,7 +535,6 @@ spec: type: array required: - name - - namespace - outcomes type: object longhorn: @@ -837,6 +842,10 @@ spec: type: string namespace: type: string + namespaces: + items: + type: string + type: array outcomes: items: properties: @@ -875,7 +884,6 @@ spec: type: array required: - name - - namespace - outcomes - selector type: object @@ -938,6 +946,10 @@ spec: type: string namespace: type: string + namespaces: + items: + type: string + type: array outcomes: items: properties: @@ -972,7 +984,6 @@ spec: type: array required: - name - - namespace - outcomes type: object storageClass: diff --git a/config/crds/troubleshoot.sh_hostcollectors.yaml b/config/crds/troubleshoot.sh_hostcollectors.yaml index 92e57d75..02128242 100644 --- a/config/crds/troubleshoot.sh_hostcollectors.yaml +++ b/config/crds/troubleshoot.sh_hostcollectors.yaml @@ -1060,22 +1060,6 @@ spec: items: type: string type: array - required: - - amzn - - amzn2 - - centos - - centos7 - - centos8 - - ol - - ol7 - - ol8 - - rhel - - rhel7 - - rhel8 - - ubuntu - - ubuntu16 - - ubuntu18 - - ubuntu20 type: object tcpConnect: properties: diff --git a/config/crds/troubleshoot.sh_hostpreflights.yaml b/config/crds/troubleshoot.sh_hostpreflights.yaml index b7d64d73..4ca46017 100644 --- a/config/crds/troubleshoot.sh_hostpreflights.yaml +++ b/config/crds/troubleshoot.sh_hostpreflights.yaml @@ -1060,22 +1060,6 @@ spec: items: type: string type: array - required: - - amzn - - amzn2 - - centos - - centos7 - - centos8 - - ol - - ol7 - - ol8 - - rhel - - rhel7 - - rhel8 - - ubuntu - - ubuntu16 - - ubuntu18 - - ubuntu20 type: object tcpConnect: properties: diff --git a/config/crds/troubleshoot.sh_preflights.yaml b/config/crds/troubleshoot.sh_preflights.yaml index 6f38415c..41f694d7 100644 --- a/config/crds/troubleshoot.sh_preflights.yaml +++ b/config/crds/troubleshoot.sh_preflights.yaml @@ -128,7 +128,6 @@ spec: type: object type: array required: - - namespaces - outcomes type: object clusterVersion: @@ -316,6 +315,10 @@ spec: type: string namespace: type: string + namespaces: + items: + type: string + type: array outcomes: items: properties: @@ -350,7 +353,6 @@ spec: type: array required: - name - - namespace - outcomes type: object distribution: @@ -495,6 +497,10 @@ spec: type: string namespace: type: string + namespaces: + items: + type: string + type: array outcomes: items: properties: @@ -529,7 +535,6 @@ spec: type: array required: - name - - namespace - outcomes type: object longhorn: @@ -837,6 +842,10 @@ spec: type: string namespace: type: string + namespaces: + items: + type: string + type: array outcomes: items: properties: @@ -875,7 +884,6 @@ spec: type: array required: - name - - namespace - outcomes - selector type: object @@ -938,6 +946,10 @@ spec: type: string namespace: type: string + namespaces: + items: + type: string + type: array outcomes: items: properties: @@ -972,7 +984,6 @@ spec: type: array required: - name - - namespace - outcomes type: object storageClass: diff --git a/config/crds/troubleshoot.sh_supportbundles.yaml b/config/crds/troubleshoot.sh_supportbundles.yaml index 440be230..856b47ea 100644 --- a/config/crds/troubleshoot.sh_supportbundles.yaml +++ b/config/crds/troubleshoot.sh_supportbundles.yaml @@ -159,7 +159,6 @@ spec: type: object type: array required: - - namespaces - outcomes type: object clusterVersion: @@ -347,6 +346,10 @@ spec: type: string namespace: type: string + namespaces: + items: + type: string + type: array outcomes: items: properties: @@ -381,7 +384,6 @@ spec: type: array required: - name - - namespace - outcomes type: object distribution: @@ -526,6 +528,10 @@ spec: type: string namespace: type: string + namespaces: + items: + type: string + type: array outcomes: items: properties: @@ -560,7 +566,6 @@ spec: type: array required: - name - - namespace - outcomes type: object longhorn: @@ -868,6 +873,10 @@ spec: type: string namespace: type: string + namespaces: + items: + type: string + type: array outcomes: items: properties: @@ -906,7 +915,6 @@ spec: type: array required: - name - - namespace - outcomes - selector type: object @@ -969,6 +977,10 @@ spec: type: string namespace: type: string + namespaces: + items: + type: string + type: array outcomes: items: properties: @@ -1003,7 +1015,6 @@ spec: type: array required: - name - - namespace - outcomes type: object storageClass: diff --git a/pkg/apis/troubleshoot/v1beta2/analyzer_shared.go b/pkg/apis/troubleshoot/v1beta2/analyzer_shared.go index 679b6887..ac3417aa 100644 --- a/pkg/apis/troubleshoot/v1beta2/analyzer_shared.go +++ b/pkg/apis/troubleshoot/v1beta2/analyzer_shared.go @@ -53,32 +53,32 @@ type ImagePullSecret struct { type DeploymentStatus struct { AnalyzeMeta `json:",inline" yaml:",inline"` Outcomes []*Outcome `json:"outcomes" yaml:"outcomes"` - Namespace string `json:"namespace" yaml:"namespace"` - Namespaces []string `json:"namespaces" yaml:"namespaces"` + Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` + Namespaces []string `json:"namespaces,omitempty" yaml:"namespaces,omitempty"` Name string `json:"name" yaml:"name"` } type StatefulsetStatus struct { AnalyzeMeta `json:",inline" yaml:",inline"` Outcomes []*Outcome `json:"outcomes" yaml:"outcomes"` - Namespace string `json:"namespace" yaml:"namespace"` - Namespaces []string `json:"namespaces" yaml:"namespaces"` + Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` + Namespaces []string `json:"namespaces,omitempty" yaml:"namespaces,omitempty"` Name string `json:"name" yaml:"name"` } type JobStatus struct { AnalyzeMeta `json:",inline" yaml:",inline"` Outcomes []*Outcome `json:"outcomes" yaml:"outcomes"` - Namespace string `json:"namespace" yaml:"namespace"` - Namespaces []string `json:"namespaces" yaml:"namespaces"` + Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` + Namespaces []string `json:"namespaces,omitempty" yaml:"namespaces,omitempty"` Name string `json:"name" yaml:"name"` } type ReplicaSetStatus struct { AnalyzeMeta `json:",inline" yaml:",inline"` Outcomes []*Outcome `json:"outcomes" yaml:"outcomes"` - Namespace string `json:"namespace" yaml:"namespace"` - Namespaces []string `json:"namespaces" yaml:"namespaces"` + Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` + Namespaces []string `json:"namespaces,omitempty" yaml:"namespaces,omitempty"` Name string `json:"name" yaml:"name"` Selector []string `json:"selector" yaml:"selector"` } @@ -86,7 +86,7 @@ type ReplicaSetStatus struct { type ClusterPodStatuses struct { AnalyzeMeta `json:",inline" yaml:",inline"` Outcomes []*Outcome `json:"outcomes" yaml:"outcomes"` - Namespaces []string `json:"namespaces" yaml:"namespaces"` + Namespaces []string `json:"namespaces,omitempty" yaml:"namespaces,omitempty"` } type ContainerRuntime struct { diff --git a/pkg/apis/troubleshoot/v1beta2/hostcollector_shared.go b/pkg/apis/troubleshoot/v1beta2/hostcollector_shared.go index 707c216d..60317e28 100644 --- a/pkg/apis/troubleshoot/v1beta2/hostcollector_shared.go +++ b/pkg/apis/troubleshoot/v1beta2/hostcollector_shared.go @@ -69,21 +69,21 @@ type HostBlockDevices struct { type HostSystemPackages struct { HostCollectorMeta `json:",inline" yaml:",inline"` - Ubuntu []string `json:"ubuntu"` - Ubuntu16 []string `json:"ubuntu16"` - Ubuntu18 []string `json:"ubuntu18"` - Ubuntu20 []string `json:"ubuntu20"` - RHEL []string `json:"rhel"` - RHEL7 []string `json:"rhel7"` - RHEL8 []string `json:"rhel8"` - CentOS []string `json:"centos"` - CentOS7 []string `json:"centos7"` - CentOS8 []string `json:"centos8"` - OracleLinux []string `json:"ol"` - OracleLinux7 []string `json:"ol7"` - OracleLinux8 []string `json:"ol8"` - AmazonLinux []string `json:"amzn"` - AmazonLinux2 []string `json:"amzn2"` + Ubuntu []string `json:"ubuntu,omitempty"` + Ubuntu16 []string `json:"ubuntu16,omitempty"` + Ubuntu18 []string `json:"ubuntu18,omitempty"` + Ubuntu20 []string `json:"ubuntu20,omitempty"` + RHEL []string `json:"rhel,omitempty"` + RHEL7 []string `json:"rhel7,omitempty"` + RHEL8 []string `json:"rhel8,omitempty"` + CentOS []string `json:"centos,omitempty"` + CentOS7 []string `json:"centos7,omitempty"` + CentOS8 []string `json:"centos8,omitempty"` + OracleLinux []string `json:"ol,omitempty"` + OracleLinux7 []string `json:"ol7,omitempty"` + OracleLinux8 []string `json:"ol8,omitempty"` + AmazonLinux []string `json:"amzn,omitempty"` + AmazonLinux2 []string `json:"amzn2,omitempty"` } type HostKernelModules struct { diff --git a/pkg/client/troubleshootclientset/fake/clientset_generated.go b/pkg/client/troubleshootclientset/fake/clientset_generated.go index a6ef3f96..01dcb504 100644 --- a/pkg/client/troubleshootclientset/fake/clientset_generated.go +++ b/pkg/client/troubleshootclientset/fake/clientset_generated.go @@ -75,7 +75,10 @@ func (c *Clientset) Tracker() testing.ObjectTracker { return c.tracker } -var _ clientset.Interface = &Clientset{} +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) // TroubleshootV1beta1 retrieves the TroubleshootV1beta1Client func (c *Clientset) TroubleshootV1beta1() troubleshootv1beta1.TroubleshootV1beta1Interface {