Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support arbitrary uid for openshift environments #126

Merged
merged 4 commits into from
Jun 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions pkg/resources/k8sgpt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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-config/",
},
{
Name: "XDG_CACHE_HOME",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to have a different path for cache, e.g /k8sgpt-config/.cache and use subPath in the ConfigMap.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arbreezy what do you think about my last namings? I use k8sgpt-data for the volume mountpath and .config and .cache sub directories

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

Value: "/k8sgpt-config/",
},
},
Ports: []v1.ContainerPort{
{
Expand All @@ -210,6 +218,18 @@ func GetDeployment(config v1alpha1.K8sGPT) (*appsv1.Deployment, error) {
v1.ResourceMemory: resource.MustParse("156Mi"),
},
},
VolumeMounts: []v1.VolumeMount{
{
MountPath: "/k8sgpt-config",
Name: "config",
},
},
},
},
Volumes: []v1.Volume{
{
VolumeSource: v1.VolumeSource{EmptyDir: &v1.EmptyDirVolumeSource{}},
Name: "config",
},
},
},
Expand Down