From 10484eb3d3768bec2222341e77b65f9338d7cb5a Mon Sep 17 00:00:00 2001 From: Johannes Kleinlercher Date: Mon, 5 Jun 2023 20:13:57 +0200 Subject: [PATCH] feat: support arbitrary uid for openshift environments (#126) * feat: support arbitrary uid for openshift environments Signed-off-by: Johannes Kleinlercher * feat: rename k8sgpt volume and dirs Signed-off-by: Johannes Kleinlercher --------- Signed-off-by: Johannes Kleinlercher Co-authored-by: Alex Jones --- pkg/resources/k8sgpt.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkg/resources/k8sgpt.go b/pkg/resources/k8sgpt.go index 2c333b41..8d01c172 100644 --- a/pkg/resources/k8sgpt.go +++ b/pkg/resources/k8sgpt.go @@ -194,6 +194,14 @@ func GetDeployment(config v1alpha1.K8sGPT) (*appsv1.Deployment, error) { Name: "K8SGPT_BACKEND", Value: string(config.Spec.Backend), }, + { + Name: "XDG_CONFIG_HOME", + Value: "/k8sgpt-data/.config", + }, + { + Name: "XDG_CACHE_HOME", + Value: "/k8sgpt-data/.cache", + }, }, Ports: []v1.ContainerPort{ { @@ -210,6 +218,18 @@ func GetDeployment(config v1alpha1.K8sGPT) (*appsv1.Deployment, error) { v1.ResourceMemory: resource.MustParse("156Mi"), }, }, + VolumeMounts: []v1.VolumeMount{ + { + MountPath: "/k8sgpt-data", + Name: "k8sgpt-vol", + }, + }, + }, + }, + Volumes: []v1.Volume{ + { + VolumeSource: v1.VolumeSource{EmptyDir: &v1.EmptyDirVolumeSource{}}, + Name: "k8sgpt-vol", }, }, },