Skip to content

Commit 64d5330

Browse files
drohnowDexterYanchris-sandersxavpaice
authored
certificate collector (#1112)
* adding pkg/collect/certificates.go and pkg/collect/certificates_test.go files * adding collector.go and collector_shared.go files * ran make schemas * update zz_generated.deepcopy.go Co-authored-by: Dexter Yan <[email protected]> Co-authored-by: Chris Sanders <[email protected]> Co-authored-by: Xav Paice <[email protected]>
1 parent b020c76 commit 64d5330

11 files changed

+703
-0
lines changed

config/crds/troubleshoot.sh_collectors.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,27 @@ spec:
8282
required:
8383
- namespace
8484
type: object
85+
certificates:
86+
properties:
87+
collectorName:
88+
type: string
89+
configMaps:
90+
additionalProperties:
91+
items:
92+
type: string
93+
type: array
94+
type: object
95+
exclude:
96+
type: BoolString
97+
name:
98+
type: string
99+
secrets:
100+
additionalProperties:
101+
items:
102+
type: string
103+
type: array
104+
type: object
105+
type: object
85106
clusterInfo:
86107
properties:
87108
collectorName:

config/crds/troubleshoot.sh_preflights.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,6 +1526,27 @@ spec:
15261526
required:
15271527
- namespace
15281528
type: object
1529+
certificates:
1530+
properties:
1531+
collectorName:
1532+
type: string
1533+
configMaps:
1534+
additionalProperties:
1535+
items:
1536+
type: string
1537+
type: array
1538+
type: object
1539+
exclude:
1540+
type: BoolString
1541+
name:
1542+
type: string
1543+
secrets:
1544+
additionalProperties:
1545+
items:
1546+
type: string
1547+
type: array
1548+
type: object
1549+
type: object
15291550
clusterInfo:
15301551
properties:
15311552
collectorName:

config/crds/troubleshoot.sh_supportbundles.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,6 +1557,27 @@ spec:
15571557
required:
15581558
- namespace
15591559
type: object
1560+
certificates:
1561+
properties:
1562+
collectorName:
1563+
type: string
1564+
configMaps:
1565+
additionalProperties:
1566+
items:
1567+
type: string
1568+
type: array
1569+
type: object
1570+
exclude:
1571+
type: BoolString
1572+
name:
1573+
type: string
1574+
secrets:
1575+
additionalProperties:
1576+
items:
1577+
type: string
1578+
type: array
1579+
type: object
1580+
type: object
15601581
clusterInfo:
15611582
properties:
15621583
collectorName:

pkg/apis/troubleshoot/v1beta2/collector_shared.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,13 @@ type RegistryImages struct {
216216
ImagePullSecrets *ImagePullSecrets `json:"imagePullSecret,omitempty" yaml:"imagePullSecret,omitempty"`
217217
}
218218

219+
type Certificates struct {
220+
CollectorMeta `json:",inline" yaml:",inline"`
221+
Name string `json:"name,omitempty" yaml:"name,omitempty"`
222+
Secrets map[string][]string `json:"secrets,omitempty" yaml:"secrets,omitempty"`
223+
ConfigMaps map[string][]string `json:"configMaps,omitempty" yaml:"configMaps,omitempty"`
224+
}
225+
219226
type Collect struct {
220227
ClusterInfo *ClusterInfo `json:"clusterInfo,omitempty" yaml:"clusterInfo,omitempty"`
221228
ClusterResources *ClusterResources `json:"clusterResources,omitempty" yaml:"clusterResources,omitempty"`
@@ -238,6 +245,7 @@ type Collect struct {
238245
Longhorn *Longhorn `json:"longhorn,omitempty" yaml:"longhorn,omitempty"`
239246
RegistryImages *RegistryImages `json:"registryImages,omitempty" yaml:"registryImages,omitempty"`
240247
Sysctl *Sysctl `json:"sysctl,omitempty" yaml:"sysctl,omitempty"`
248+
Certificates *Certificates `json:"certificates,omitempty" yaml:"certificates,omitempty"`
241249
}
242250

243251
func (c *Collect) AccessReviewSpecs(overrideNS string) []authorizationv1.SelfSubjectAccessReviewSpec {
@@ -539,6 +547,10 @@ func (c *Collect) GetName() string {
539547
collector = "sysctl"
540548
name = c.Sysctl.Name
541549
}
550+
if c.Certificates != nil {
551+
collector = "certificates"
552+
name = c.Certificates.CollectorName
553+
}
542554

543555
if collector == "" {
544556
return "<none>"

pkg/apis/troubleshoot/v1beta2/zz_generated.deepcopy.go

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)