From b35e491a6671a0b9ab6a6430c13c77401672a882 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Fri, 6 Sep 2024 16:11:19 -0400 Subject: [PATCH] use correct namespace --- pkg/kotsutil/kots.go | 6 +++--- pkg/snapshot/filesystem_minio.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/kotsutil/kots.go b/pkg/kotsutil/kots.go index 99b8639b80..c4a736b938 100644 --- a/pkg/kotsutil/kots.go +++ b/pkg/kotsutil/kots.go @@ -1153,10 +1153,10 @@ func GetInstallationParams(configMapName string) (InstallationParams, error) { return autoConfig, errors.Wrap(err, "failed to get k8s clientset") } - return GetInstallationParamsWithClientset(clientset, configMapName) + return GetInstallationParamsWithClientset(clientset, configMapName, util.PodNamespace) } -func GetInstallationParamsWithClientset(clientset kubernetes.Interface, configMapName string) (InstallationParams, error) { +func GetInstallationParamsWithClientset(clientset kubernetes.Interface, configMapName string, namespace string) (InstallationParams, error) { autoConfig := InstallationParams{} isKurl, err := kurl.IsKurl(clientset) @@ -1164,7 +1164,7 @@ func GetInstallationParamsWithClientset(clientset kubernetes.Interface, configMa return autoConfig, errors.Wrap(err, "failed to check if cluster is kurl") } - kotsadmConfigMap, err := clientset.CoreV1().ConfigMaps(util.PodNamespace).Get(context.TODO(), configMapName, metav1.GetOptions{}) + kotsadmConfigMap, err := clientset.CoreV1().ConfigMaps(namespace).Get(context.TODO(), configMapName, metav1.GetOptions{}) if err != nil { if kuberneteserrors.IsNotFound(err) { return autoConfig, nil diff --git a/pkg/snapshot/filesystem_minio.go b/pkg/snapshot/filesystem_minio.go index 4464610df6..9cac5ba903 100644 --- a/pkg/snapshot/filesystem_minio.go +++ b/pkg/snapshot/filesystem_minio.go @@ -301,7 +301,7 @@ func fileSystemMinioDeploymentResource(clientset kubernetes.Interface, secretChe } } - globalOptions, err := kotsutil.GetInstallationParamsWithClientset(clientset, kotsadmtypes.KotsadmConfigMap) + globalOptions, err := kotsutil.GetInstallationParamsWithClientset(clientset, kotsadmtypes.KotsadmConfigMap, deployOptions.Namespace) if err != nil { return nil, errors.Wrap(err, "failed to get global options") } @@ -854,7 +854,7 @@ func fileSystemMinioConfigPod(clientset kubernetes.Interface, deployOptions File } } - globalOptions, err := kotsutil.GetInstallationParamsWithClientset(clientset, kotsadmtypes.KotsadmConfigMap) + globalOptions, err := kotsutil.GetInstallationParamsWithClientset(clientset, kotsadmtypes.KotsadmConfigMap, deployOptions.Namespace) if err != nil { return nil, errors.Wrap(err, "failed to get global options") }