diff --git a/config/crds/troubleshoot.sh_collectors.yaml b/config/crds/troubleshoot.sh_collectors.yaml index 02a85fa29..41665245c 100644 --- a/config/crds/troubleshoot.sh_collectors.yaml +++ b/config/crds/troubleshoot.sh_collectors.yaml @@ -354,6 +354,8 @@ spec: type: string exclude: type: BoolString + image: + type: string namespace: type: string podLaunchOptions: diff --git a/config/crds/troubleshoot.sh_preflights.yaml b/config/crds/troubleshoot.sh_preflights.yaml index 38e900de7..d762ce2c6 100644 --- a/config/crds/troubleshoot.sh_preflights.yaml +++ b/config/crds/troubleshoot.sh_preflights.yaml @@ -2083,6 +2083,8 @@ spec: type: string exclude: type: BoolString + image: + type: string namespace: type: string podLaunchOptions: diff --git a/pkg/apis/troubleshoot/v1beta2/collector_shared.go b/pkg/apis/troubleshoot/v1beta2/collector_shared.go index 04181d7ac..1cc212f52 100644 --- a/pkg/apis/troubleshoot/v1beta2/collector_shared.go +++ b/pkg/apis/troubleshoot/v1beta2/collector_shared.go @@ -279,6 +279,7 @@ type Helm struct { type Goldpinger struct { CollectorMeta `json:",inline" yaml:",inline"` Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` + Image string `json:"image,omitempty" yaml:"image,omitempty"` ServiceAccountName string `json:"serviceAccountName,omitempty" yaml:"serviceAccountName,omitempty"` CollectDelay string `json:"collectDelay,omitempty" yaml:"collectDelay,omitempty"` PodLaunchOptions *PodLaunchOptions `json:"podLaunchOptions,omitempty" yaml:"podLaunchOptions,omitempty"` diff --git a/pkg/collect/goldpinger.go b/pkg/collect/goldpinger.go index c7142b949..b7a7eb801 100644 --- a/pkg/collect/goldpinger.go +++ b/pkg/collect/goldpinger.go @@ -26,6 +26,8 @@ import ( "k8s.io/utils/ptr" ) +var goldpingerImage = "bloomberg/goldpinger:3.10.1" + // Collect goldpinger results from goldpinger service running in a cluster // The results are stored in goldpinger/check_all.json since we use // the /check_all endpoint @@ -299,6 +301,10 @@ func (c *CollectGoldpinger) createGoldpingerRoleBinding(ns string) (*rbacv1.Role func (c *CollectGoldpinger) createGoldpingerDaemonSet(ns, svcAccName string) (*appsv1.DaemonSet, error) { ds := &appsv1.DaemonSet{} + if c.Collector.Image != "" { + goldpingerImage = c.Collector.Image + } + ds.ObjectMeta = metav1.ObjectMeta{ Name: "ts-goldpinger", Namespace: ns, @@ -320,7 +326,7 @@ func (c *CollectGoldpinger) createGoldpingerDaemonSet(ns, svcAccName string) (*a Containers: []corev1.Container{ { Name: "goldpinger-daemon", - Image: "bloomberg/goldpinger:3.10.1", + Image: goldpingerImage, ImagePullPolicy: corev1.PullIfNotPresent, Env: []corev1.EnvVar{ { @@ -479,6 +485,7 @@ func (c *CollectGoldpinger) runPodAndCollectGPResults(url string, progressChan c namespace := "default" serviceAccountName := "" image := constants.GP_DEFAULT_IMAGE + var imagePullSecret *troubleshootv1beta2.ImagePullSecrets if c.Collector.PodLaunchOptions != nil { diff --git a/schemas/collector-troubleshoot-v1beta2.json b/schemas/collector-troubleshoot-v1beta2.json index 21241d7fd..a539ae297 100644 --- a/schemas/collector-troubleshoot-v1beta2.json +++ b/schemas/collector-troubleshoot-v1beta2.json @@ -484,6 +484,9 @@ "exclude": { "oneOf": [{"type": "string"},{"type": "boolean"}] }, + "image": { + "type": "string" + }, "namespace": { "type": "string" }, diff --git a/schemas/preflight-troubleshoot-v1beta2.json b/schemas/preflight-troubleshoot-v1beta2.json index 0555adce9..7b4ddd0f7 100644 --- a/schemas/preflight-troubleshoot-v1beta2.json +++ b/schemas/preflight-troubleshoot-v1beta2.json @@ -3148,6 +3148,9 @@ "exclude": { "oneOf": [{"type": "string"},{"type": "boolean"}] }, + "image": { + "type": "string" + }, "namespace": { "type": "string" },