From a02f9cfd660295e31d4c261027cf7d048d61b550 Mon Sep 17 00:00:00 2001 From: Niraj Yadav Date: Thu, 8 Aug 2024 13:40:36 +0530 Subject: [PATCH] Include must-gather image name in ENV The request for such feature came from a Bugzilla for odf-must-gather. We want the must-gather containers to be able to check the image being used. This is useful in cases where we want to deduce if the customer is using the image we ask them to. While it is possible to call the k8s API internally (this is how it is implemented currently for odf-mg), it would be much efficient if the value is present inside the container as an ENV. This patch sets an ENV var `MUST_GATHER_IMAGE` to reflect the image source of the pods. Signed-off-by: Niraj Yadav --- pkg/cli/admin/mustgather/mustgather.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/cli/admin/mustgather/mustgather.go b/pkg/cli/admin/mustgather/mustgather.go index 9ad0ee5e64..2ec68cb4d3 100644 --- a/pkg/cli/admin/mustgather/mustgather.go +++ b/pkg/cli/admin/mustgather/mustgather.go @@ -988,6 +988,10 @@ func (o *MustGatherOptions) newPod(node, image string, hasMaster bool) *corev1.P }, }, }, + { + Name: "MUST_GATHER_IMAGE", + Value: image, + }, }, TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError, VolumeMounts: []corev1.VolumeMount{