Skip to content

Commit

Permalink
use correct namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya committed Sep 6, 2024
1 parent 77eaad3 commit b35e491
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/kotsutil/kots.go
Original file line number Diff line number Diff line change
Expand Up @@ -1153,18 +1153,18 @@ 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)
if err != nil {
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
Expand Down
4 changes: 2 additions & 2 deletions pkg/snapshot/filesystem_minio.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down Expand Up @@ -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")
}
Expand Down

0 comments on commit b35e491

Please sign in to comment.