From b2c32806238f8587357f4bf96b7277f44ff68a0a Mon Sep 17 00:00:00 2001 From: Edgar Lanting Date: Thu, 1 Sep 2022 14:58:51 +0200 Subject: [PATCH 1/2] EL 20220901 - Implement new type for #682 --- config/samples/troubleshoot_v1beta2_collector.yaml | 1 + pkg/apis/troubleshoot/v1beta2/supportbundle_types.go | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/config/samples/troubleshoot_v1beta2_collector.yaml b/config/samples/troubleshoot_v1beta2_collector.yaml index b3b8e008..6a4595c6 100644 --- a/config/samples/troubleshoot_v1beta2_collector.yaml +++ b/config/samples/troubleshoot_v1beta2_collector.yaml @@ -3,6 +3,7 @@ kind: Collector metadata: name: collector-sample spec: + uri: https://raw.githubusercontent.com/replicatedhq/troubleshoot-specs/main/in-cluster/default.yaml collectors: - clusterInfo: {} - clusterResources: {} diff --git a/pkg/apis/troubleshoot/v1beta2/supportbundle_types.go b/pkg/apis/troubleshoot/v1beta2/supportbundle_types.go index 0da842a9..9fd7c28b 100644 --- a/pkg/apis/troubleshoot/v1beta2/supportbundle_types.go +++ b/pkg/apis/troubleshoot/v1beta2/supportbundle_types.go @@ -27,6 +27,13 @@ type SupportBundleSpec struct { HostCollectors []*HostCollect `json:"hostCollectors,omitempty" yaml:"hostCollectors,omitempty"` Analyzers []*Analyze `json:"analyzers,omitempty" yaml:"analyzers,omitempty"` HostAnalyzers []*HostAnalyze `json:"hostAnalyzers,omitempty" yaml:"hostAnalyzers,omitempty"` + // Uri defines the location of the spec file that needs to be used. This is optional and can be + // either a secret, url or spec yaml file. + // When presented with a spec document that contains a URI, if that spec is one of the specs provided + // on the command line or initial call to Troubleshoot, attempt to collect a replacement spec from that URI. + // If successful, it will replace the entire spec with the one downloaded. + // If unsuccessful, log the error and use the spec provided. + Uri string `json:"uri,omitempty" yaml:"uri,omitempty"` } // SupportBundleStatus defines the observed state of SupportBundle From 8fcb65d2a66249b07122f5cde7c1cb90b4b1400c Mon Sep 17 00:00:00 2001 From: Edgar Lanting Date: Fri, 2 Sep 2022 12:21:40 +0200 Subject: [PATCH 2/2] Update supportbundle_types.go Alter comment for the additional `uri` field into one single sentence. --- pkg/apis/troubleshoot/v1beta2/supportbundle_types.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkg/apis/troubleshoot/v1beta2/supportbundle_types.go b/pkg/apis/troubleshoot/v1beta2/supportbundle_types.go index 9fd7c28b..40465f89 100644 --- a/pkg/apis/troubleshoot/v1beta2/supportbundle_types.go +++ b/pkg/apis/troubleshoot/v1beta2/supportbundle_types.go @@ -27,12 +27,7 @@ type SupportBundleSpec struct { HostCollectors []*HostCollect `json:"hostCollectors,omitempty" yaml:"hostCollectors,omitempty"` Analyzers []*Analyze `json:"analyzers,omitempty" yaml:"analyzers,omitempty"` HostAnalyzers []*HostAnalyze `json:"hostAnalyzers,omitempty" yaml:"hostAnalyzers,omitempty"` - // Uri defines the location of the spec file that needs to be used. This is optional and can be - // either a secret, url or spec yaml file. - // When presented with a spec document that contains a URI, if that spec is one of the specs provided - // on the command line or initial call to Troubleshoot, attempt to collect a replacement spec from that URI. - // If successful, it will replace the entire spec with the one downloaded. - // If unsuccessful, log the error and use the spec provided. + // URI optionally defines a location which is the source of this spec to allow updating of the spec at runtime Uri string `json:"uri,omitempty" yaml:"uri,omitempty"` }