Skip to content

Commit 8fc7d12

Browse files
committed
mark a number of fields as not being required
namespace/namepsaces in resource status analyzers, and the OS list in host package collectors
1 parent 877e43d commit 8fc7d12

File tree

8 files changed

+76
-72
lines changed

8 files changed

+76
-72
lines changed

config/crds/troubleshoot.sh_analyzers.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ spec:
128128
type: object
129129
type: array
130130
required:
131-
- namespaces
132131
- outcomes
133132
type: object
134133
clusterVersion:
@@ -316,6 +315,10 @@ spec:
316315
type: string
317316
namespace:
318317
type: string
318+
namespaces:
319+
items:
320+
type: string
321+
type: array
319322
outcomes:
320323
items:
321324
properties:
@@ -350,7 +353,6 @@ spec:
350353
type: array
351354
required:
352355
- name
353-
- namespace
354356
- outcomes
355357
type: object
356358
distribution:
@@ -495,6 +497,10 @@ spec:
495497
type: string
496498
namespace:
497499
type: string
500+
namespaces:
501+
items:
502+
type: string
503+
type: array
498504
outcomes:
499505
items:
500506
properties:
@@ -529,7 +535,6 @@ spec:
529535
type: array
530536
required:
531537
- name
532-
- namespace
533538
- outcomes
534539
type: object
535540
longhorn:
@@ -837,6 +842,10 @@ spec:
837842
type: string
838843
namespace:
839844
type: string
845+
namespaces:
846+
items:
847+
type: string
848+
type: array
840849
outcomes:
841850
items:
842851
properties:
@@ -875,7 +884,6 @@ spec:
875884
type: array
876885
required:
877886
- name
878-
- namespace
879887
- outcomes
880888
- selector
881889
type: object
@@ -938,6 +946,10 @@ spec:
938946
type: string
939947
namespace:
940948
type: string
949+
namespaces:
950+
items:
951+
type: string
952+
type: array
941953
outcomes:
942954
items:
943955
properties:
@@ -972,7 +984,6 @@ spec:
972984
type: array
973985
required:
974986
- name
975-
- namespace
976987
- outcomes
977988
type: object
978989
storageClass:

config/crds/troubleshoot.sh_hostcollectors.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,22 +1060,6 @@ spec:
10601060
items:
10611061
type: string
10621062
type: array
1063-
required:
1064-
- amzn
1065-
- amzn2
1066-
- centos
1067-
- centos7
1068-
- centos8
1069-
- ol
1070-
- ol7
1071-
- ol8
1072-
- rhel
1073-
- rhel7
1074-
- rhel8
1075-
- ubuntu
1076-
- ubuntu16
1077-
- ubuntu18
1078-
- ubuntu20
10791063
type: object
10801064
tcpConnect:
10811065
properties:

config/crds/troubleshoot.sh_hostpreflights.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,22 +1060,6 @@ spec:
10601060
items:
10611061
type: string
10621062
type: array
1063-
required:
1064-
- amzn
1065-
- amzn2
1066-
- centos
1067-
- centos7
1068-
- centos8
1069-
- ol
1070-
- ol7
1071-
- ol8
1072-
- rhel
1073-
- rhel7
1074-
- rhel8
1075-
- ubuntu
1076-
- ubuntu16
1077-
- ubuntu18
1078-
- ubuntu20
10791063
type: object
10801064
tcpConnect:
10811065
properties:

config/crds/troubleshoot.sh_preflights.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ spec:
128128
type: object
129129
type: array
130130
required:
131-
- namespaces
132131
- outcomes
133132
type: object
134133
clusterVersion:
@@ -316,6 +315,10 @@ spec:
316315
type: string
317316
namespace:
318317
type: string
318+
namespaces:
319+
items:
320+
type: string
321+
type: array
319322
outcomes:
320323
items:
321324
properties:
@@ -350,7 +353,6 @@ spec:
350353
type: array
351354
required:
352355
- name
353-
- namespace
354356
- outcomes
355357
type: object
356358
distribution:
@@ -495,6 +497,10 @@ spec:
495497
type: string
496498
namespace:
497499
type: string
500+
namespaces:
501+
items:
502+
type: string
503+
type: array
498504
outcomes:
499505
items:
500506
properties:
@@ -529,7 +535,6 @@ spec:
529535
type: array
530536
required:
531537
- name
532-
- namespace
533538
- outcomes
534539
type: object
535540
longhorn:
@@ -837,6 +842,10 @@ spec:
837842
type: string
838843
namespace:
839844
type: string
845+
namespaces:
846+
items:
847+
type: string
848+
type: array
840849
outcomes:
841850
items:
842851
properties:
@@ -875,7 +884,6 @@ spec:
875884
type: array
876885
required:
877886
- name
878-
- namespace
879887
- outcomes
880888
- selector
881889
type: object
@@ -938,6 +946,10 @@ spec:
938946
type: string
939947
namespace:
940948
type: string
949+
namespaces:
950+
items:
951+
type: string
952+
type: array
941953
outcomes:
942954
items:
943955
properties:
@@ -972,7 +984,6 @@ spec:
972984
type: array
973985
required:
974986
- name
975-
- namespace
976987
- outcomes
977988
type: object
978989
storageClass:

config/crds/troubleshoot.sh_supportbundles.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ spec:
159159
type: object
160160
type: array
161161
required:
162-
- namespaces
163162
- outcomes
164163
type: object
165164
clusterVersion:
@@ -347,6 +346,10 @@ spec:
347346
type: string
348347
namespace:
349348
type: string
349+
namespaces:
350+
items:
351+
type: string
352+
type: array
350353
outcomes:
351354
items:
352355
properties:
@@ -381,7 +384,6 @@ spec:
381384
type: array
382385
required:
383386
- name
384-
- namespace
385387
- outcomes
386388
type: object
387389
distribution:
@@ -526,6 +528,10 @@ spec:
526528
type: string
527529
namespace:
528530
type: string
531+
namespaces:
532+
items:
533+
type: string
534+
type: array
529535
outcomes:
530536
items:
531537
properties:
@@ -560,7 +566,6 @@ spec:
560566
type: array
561567
required:
562568
- name
563-
- namespace
564569
- outcomes
565570
type: object
566571
longhorn:
@@ -868,6 +873,10 @@ spec:
868873
type: string
869874
namespace:
870875
type: string
876+
namespaces:
877+
items:
878+
type: string
879+
type: array
871880
outcomes:
872881
items:
873882
properties:
@@ -906,7 +915,6 @@ spec:
906915
type: array
907916
required:
908917
- name
909-
- namespace
910918
- outcomes
911919
- selector
912920
type: object
@@ -969,6 +977,10 @@ spec:
969977
type: string
970978
namespace:
971979
type: string
980+
namespaces:
981+
items:
982+
type: string
983+
type: array
972984
outcomes:
973985
items:
974986
properties:
@@ -1003,7 +1015,6 @@ spec:
10031015
type: array
10041016
required:
10051017
- name
1006-
- namespace
10071018
- outcomes
10081019
type: object
10091020
storageClass:

pkg/apis/troubleshoot/v1beta2/analyzer_shared.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,40 +53,40 @@ type ImagePullSecret struct {
5353
type DeploymentStatus struct {
5454
AnalyzeMeta `json:",inline" yaml:",inline"`
5555
Outcomes []*Outcome `json:"outcomes" yaml:"outcomes"`
56-
Namespace string `json:"namespace" yaml:"namespace"`
57-
Namespaces []string `json:"namespaces" yaml:"namespaces"`
56+
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
57+
Namespaces []string `json:"namespaces,omitempty" yaml:"namespaces,omitempty"`
5858
Name string `json:"name" yaml:"name"`
5959
}
6060

6161
type StatefulsetStatus struct {
6262
AnalyzeMeta `json:",inline" yaml:",inline"`
6363
Outcomes []*Outcome `json:"outcomes" yaml:"outcomes"`
64-
Namespace string `json:"namespace" yaml:"namespace"`
65-
Namespaces []string `json:"namespaces" yaml:"namespaces"`
64+
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
65+
Namespaces []string `json:"namespaces,omitempty" yaml:"namespaces,omitempty"`
6666
Name string `json:"name" yaml:"name"`
6767
}
6868

6969
type JobStatus struct {
7070
AnalyzeMeta `json:",inline" yaml:",inline"`
7171
Outcomes []*Outcome `json:"outcomes" yaml:"outcomes"`
72-
Namespace string `json:"namespace" yaml:"namespace"`
73-
Namespaces []string `json:"namespaces" yaml:"namespaces"`
72+
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
73+
Namespaces []string `json:"namespaces,omitempty" yaml:"namespaces,omitempty"`
7474
Name string `json:"name" yaml:"name"`
7575
}
7676

7777
type ReplicaSetStatus struct {
7878
AnalyzeMeta `json:",inline" yaml:",inline"`
7979
Outcomes []*Outcome `json:"outcomes" yaml:"outcomes"`
80-
Namespace string `json:"namespace" yaml:"namespace"`
81-
Namespaces []string `json:"namespaces" yaml:"namespaces"`
80+
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
81+
Namespaces []string `json:"namespaces,omitempty" yaml:"namespaces,omitempty"`
8282
Name string `json:"name" yaml:"name"`
8383
Selector []string `json:"selector" yaml:"selector"`
8484
}
8585

8686
type ClusterPodStatuses struct {
8787
AnalyzeMeta `json:",inline" yaml:",inline"`
8888
Outcomes []*Outcome `json:"outcomes" yaml:"outcomes"`
89-
Namespaces []string `json:"namespaces" yaml:"namespaces"`
89+
Namespaces []string `json:"namespaces,omitempty" yaml:"namespaces,omitempty"`
9090
}
9191

9292
type ContainerRuntime struct {

pkg/apis/troubleshoot/v1beta2/hostcollector_shared.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,21 @@ type HostBlockDevices struct {
6969

7070
type HostSystemPackages struct {
7171
HostCollectorMeta `json:",inline" yaml:",inline"`
72-
Ubuntu []string `json:"ubuntu"`
73-
Ubuntu16 []string `json:"ubuntu16"`
74-
Ubuntu18 []string `json:"ubuntu18"`
75-
Ubuntu20 []string `json:"ubuntu20"`
76-
RHEL []string `json:"rhel"`
77-
RHEL7 []string `json:"rhel7"`
78-
RHEL8 []string `json:"rhel8"`
79-
CentOS []string `json:"centos"`
80-
CentOS7 []string `json:"centos7"`
81-
CentOS8 []string `json:"centos8"`
82-
OracleLinux []string `json:"ol"`
83-
OracleLinux7 []string `json:"ol7"`
84-
OracleLinux8 []string `json:"ol8"`
85-
AmazonLinux []string `json:"amzn"`
86-
AmazonLinux2 []string `json:"amzn2"`
72+
Ubuntu []string `json:"ubuntu,omitempty"`
73+
Ubuntu16 []string `json:"ubuntu16,omitempty"`
74+
Ubuntu18 []string `json:"ubuntu18,omitempty"`
75+
Ubuntu20 []string `json:"ubuntu20,omitempty"`
76+
RHEL []string `json:"rhel,omitempty"`
77+
RHEL7 []string `json:"rhel7,omitempty"`
78+
RHEL8 []string `json:"rhel8,omitempty"`
79+
CentOS []string `json:"centos,omitempty"`
80+
CentOS7 []string `json:"centos7,omitempty"`
81+
CentOS8 []string `json:"centos8,omitempty"`
82+
OracleLinux []string `json:"ol,omitempty"`
83+
OracleLinux7 []string `json:"ol7,omitempty"`
84+
OracleLinux8 []string `json:"ol8,omitempty"`
85+
AmazonLinux []string `json:"amzn,omitempty"`
86+
AmazonLinux2 []string `json:"amzn2,omitempty"`
8787
}
8888

8989
type HostKernelModules struct {

pkg/client/troubleshootclientset/fake/clientset_generated.go

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)