diff --git a/deploy/job_analyze_resource.yml b/deploy/job_analyze_resource.yml index fa02d7070..9eb0de2c8 100644 --- a/deploy/job_analyze_resource.yml +++ b/deploy/job_analyze_resource.yml @@ -25,6 +25,7 @@ spec: - name: RESOURCE_NAME - name: BUCKET - name: ENDPOINT + - name: REGION - name: S3_SIGNATURE_VERSION - name: HTTP_PROXY - name: HTTPS_PROXY diff --git a/pkg/bundle/deploy.go b/pkg/bundle/deploy.go index 26e5d901e..2d169f53c 100644 --- a/pkg/bundle/deploy.go +++ b/pkg/bundle/deploy.go @@ -5051,7 +5051,7 @@ const File_deploy_internal_text_system_status_readme_rejected_tmpl = ` NooBaa Operator Version: {{.OperatorVersion}} ` -const Sha256_deploy_job_analyze_resource_yml = "a171cf51d8c8561de04d921fbccb43b87f25daadd86211900765a4cf1ae080a5" +const Sha256_deploy_job_analyze_resource_yml = "c80810baeda94fd9dd97a6c62241be5c582e08009bdbb1f2a13992c99d90ea33" const File_deploy_job_analyze_resource_yml = `apiVersion: batch/v1 kind: Job @@ -5080,6 +5080,7 @@ spec: - name: RESOURCE_NAME - name: BUCKET - name: ENDPOINT + - name: REGION - name: S3_SIGNATURE_VERSION - name: HTTP_PROXY - name: HTTPS_PROXY diff --git a/pkg/diagnostics/analyze.go b/pkg/diagnostics/analyze.go index 21d13b937..9c459618a 100644 --- a/pkg/diagnostics/analyze.go +++ b/pkg/diagnostics/analyze.go @@ -270,6 +270,16 @@ func setBackingStoreDetailsInJob(backingStore *nbv1.BackingStore, cmd *cobra.Com backingStore.Kind, backingStore.Name, backingStore.Namespace) } + // in case it is aws endpoint, we would pass the region + if backingStore.Spec.Type == nbv1.StoreTypeAWSS3 { + region := util.GetEnvVariable(&analyzeResourceJob.Spec.Template.Spec.Containers[0].Env, "REGION") + if region == nil { + log.Fatalf("❌ Could not get region in %s %q in Namespace %q", + analyzeResourceJob.Kind, analyzeResourceJob.Name, analyzeResourceJob.Namespace) + } + region.Value = backingStore.Spec.AWSS3.Region + } + // signature version signatureVersion := util.GetEnvVariable(&analyzeResourceJob.Spec.Template.Spec.Containers[0].Env, "S3_SIGNATURE_VERSION") if signatureVersion == nil { @@ -338,6 +348,16 @@ func setNamespacetoreDetailsInJob(namespaceStore *nbv1.NamespaceStore, cmd *cobr namespaceStore.Kind, namespaceStore.Name, namespaceStore.Namespace) } + // in case it is aws endpoint, we would pass the region + if namespaceStore.Spec.Type == nbv1.NSStoreTypeAWSS3 { + region := util.GetEnvVariable(&analyzeResourceJob.Spec.Template.Spec.Containers[0].Env, "REGION") + if region == nil { + log.Fatalf("❌ Could not get region in %s %q in Namespace %q", + analyzeResourceJob.Kind, analyzeResourceJob.Name, analyzeResourceJob.Namespace) + } + region.Value = namespaceStore.Spec.AWSS3.Region + } + // signature version signatureVersion := util.GetEnvVariable(&analyzeResourceJob.Spec.Template.Spec.Containers[0].Env, "S3_SIGNATURE_VERSION") if signatureVersion == nil {