From 2b8e3fb6bb25c97c7c83039e3bcb8f72e0fac662 Mon Sep 17 00:00:00 2001 From: Dexter Yan Date: Thu, 1 Jun 2023 20:46:34 +1200 Subject: [PATCH] fix(collector): removed unused name in certificates collector (#1200) --- config/crds/troubleshoot.sh_collectors.yaml | 2 -- config/crds/troubleshoot.sh_preflights.yaml | 2 -- config/crds/troubleshoot.sh_supportbundles.yaml | 2 -- pkg/apis/troubleshoot/v1beta2/collector_shared.go | 1 - pkg/collect/certificates_test.go | 4 ---- pkg/collect/collector.go | 1 - schemas/collector-troubleshoot-v1beta2.json | 3 --- schemas/preflight-troubleshoot-v1beta2.json | 3 --- schemas/supportbundle-troubleshoot-v1beta2.json | 3 --- 9 files changed, 21 deletions(-) diff --git a/config/crds/troubleshoot.sh_collectors.yaml b/config/crds/troubleshoot.sh_collectors.yaml index ae9dcf0f..e5e2d85f 100644 --- a/config/crds/troubleshoot.sh_collectors.yaml +++ b/config/crds/troubleshoot.sh_collectors.yaml @@ -99,8 +99,6 @@ spec: type: array exclude: type: BoolString - name: - type: string secrets: items: properties: diff --git a/config/crds/troubleshoot.sh_preflights.yaml b/config/crds/troubleshoot.sh_preflights.yaml index b2e95b71..8db66053 100644 --- a/config/crds/troubleshoot.sh_preflights.yaml +++ b/config/crds/troubleshoot.sh_preflights.yaml @@ -1594,8 +1594,6 @@ spec: type: array exclude: type: BoolString - name: - type: string secrets: items: properties: diff --git a/config/crds/troubleshoot.sh_supportbundles.yaml b/config/crds/troubleshoot.sh_supportbundles.yaml index e933138d..774e0e6b 100644 --- a/config/crds/troubleshoot.sh_supportbundles.yaml +++ b/config/crds/troubleshoot.sh_supportbundles.yaml @@ -1625,8 +1625,6 @@ spec: type: array exclude: type: BoolString - name: - type: string secrets: items: properties: diff --git a/pkg/apis/troubleshoot/v1beta2/collector_shared.go b/pkg/apis/troubleshoot/v1beta2/collector_shared.go index 6ccd4ba2..41077578 100644 --- a/pkg/apis/troubleshoot/v1beta2/collector_shared.go +++ b/pkg/apis/troubleshoot/v1beta2/collector_shared.go @@ -218,7 +218,6 @@ type RegistryImages struct { type Certificates struct { CollectorMeta `json:",inline" yaml:",inline"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` Secrets []CertificateSource `json:"secrets,omitempty" yaml:"secrets,omitempty"` ConfigMaps []CertificateSource `json:"configMaps,omitempty" yaml:"configMaps,omitempty"` } diff --git a/pkg/collect/certificates_test.go b/pkg/collect/certificates_test.go index 06409de9..bded2ccc 100644 --- a/pkg/collect/certificates_test.go +++ b/pkg/collect/certificates_test.go @@ -143,7 +143,6 @@ func TestCertParser(t *testing.T) { CollectorMeta: troubleshootv1beta2.CollectorMeta{ CollectorName: "collectorname", }, - Name: "expired certificate", Secrets: []troubleshootv1beta2.CertificateSource{ { Name: "expiredCert", @@ -183,7 +182,6 @@ func TestCertParser(t *testing.T) { CollectorMeta: troubleshootv1beta2.CollectorMeta{ CollectorName: "collectorname", }, - Name: "multiple certificate", Secrets: []troubleshootv1beta2.CertificateSource{ { Name: "multiCert", @@ -232,7 +230,6 @@ func TestCertParser(t *testing.T) { CollectorMeta: troubleshootv1beta2.CollectorMeta{ CollectorName: "collectorname", }, - Name: "valid certificate", Secrets: []troubleshootv1beta2.CertificateSource{ { Name: "validCert", @@ -277,7 +274,6 @@ func TestCertParser(t *testing.T) { CollectorMeta: troubleshootv1beta2.CollectorMeta{ CollectorName: "collectorname", }, - Name: "non valid certificate", Secrets: []troubleshootv1beta2.CertificateSource{ { Name: "nonCert", diff --git a/pkg/collect/collector.go b/pkg/collect/collector.go index 90d6c08c..2df153e7 100644 --- a/pkg/collect/collector.go +++ b/pkg/collect/collector.go @@ -180,7 +180,6 @@ func getCollectorName(c interface{}) string { name = v.Collector.Name case *CollectCertificates: collector = "certificates" - name = v.Collector.Name default: collector = "" } diff --git a/schemas/collector-troubleshoot-v1beta2.json b/schemas/collector-troubleshoot-v1beta2.json index 24febc44..acf1c40a 100644 --- a/schemas/collector-troubleshoot-v1beta2.json +++ b/schemas/collector-troubleshoot-v1beta2.json @@ -114,9 +114,6 @@ "exclude": { "oneOf": [{"type": "string"},{"type": "boolean"}] }, - "name": { - "type": "string" - }, "secrets": { "type": "array", "items": { diff --git a/schemas/preflight-troubleshoot-v1beta2.json b/schemas/preflight-troubleshoot-v1beta2.json index a47b8b8a..07e498d6 100644 --- a/schemas/preflight-troubleshoot-v1beta2.json +++ b/schemas/preflight-troubleshoot-v1beta2.json @@ -2417,9 +2417,6 @@ "exclude": { "oneOf": [{"type": "string"},{"type": "boolean"}] }, - "name": { - "type": "string" - }, "secrets": { "type": "array", "items": { diff --git a/schemas/supportbundle-troubleshoot-v1beta2.json b/schemas/supportbundle-troubleshoot-v1beta2.json index efe76cfa..49aff906 100644 --- a/schemas/supportbundle-troubleshoot-v1beta2.json +++ b/schemas/supportbundle-troubleshoot-v1beta2.json @@ -2463,9 +2463,6 @@ "exclude": { "oneOf": [{"type": "string"},{"type": "boolean"}] }, - "name": { - "type": "string" - }, "secrets": { "type": "array", "items": {