pb-2360: Using GetStorkPodNamespace api for cmdexecutor  image extraction as well.
- This take care of the usecase even if stork is deployed on non kube-systen namespace
@@ -338,10 +338,15 @@ func executeCommandAction(
// The order of priority for image location value is Job annotation, environmental variable
// and then if both of them are missing, default to stork image repo
if len(os.Getenv(cmdExecutorImageRegistryEnvVar)) == 0 {
+ storkPodNs, err := k8sutils.GetStorkPodNamespace()
+ if err != nil {
+ logrus.Errorf("error in getting stork pod namespace: %v", err)
+ return err
+ }
// If env is not set get the values from stork deployment spec.
registry, registrySecret, err := k8sutils.GetImageRegistryFromDeployment(
k8sutils.StorkDeploymentName,
- k8sutils.DefaultAdminNamespace,
+ storkPodNs,
)
if err != nil {
return err
