fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! General improvements

This commit is contained in:
2025-01-10 15:45:36 +00:00
parent f5b413e7fe
commit 2fab4267f5
4 changed files with 21 additions and 6 deletions
+2 -2
View File
@@ -10,9 +10,9 @@ description: |
type: application
version: 0.2.42
version: 0.2.43
appVersion: "0.2.42"
appVersion: "0.2.43"
home: https://github.com/lukaszraczylo/kubernetes-images-sync-operator
+1 -1
View File
@@ -12,7 +12,7 @@ sa:
- ALL
image:
repository: ghcr.io/lukaszraczylo/kubernetes-images-sync-operator
tag: 0.2.42
tag: 0.2.43
resources:
limits:
cpu: 500m
@@ -9,6 +9,7 @@ import (
"github.com/go-logr/logr"
appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
@@ -408,6 +409,21 @@ func (r *ClusterImageExportReconciler) runCleanupJob(ctx context.Context, cluste
mergedAnnotations[k] = v
}
// Set up environment variables for AWS configuration
envVars := []corev1.EnvVar{}
if clusterImageExport.Spec.Storage.StorageTarget == shared.STORAGE_S3 {
if clusterImageExport.Spec.Storage.S3.Region != "" {
envVars = append(envVars, corev1.EnvVar{
Name: "AWS_REGION",
Value: clusterImageExport.Spec.Storage.S3.Region,
})
envVars = append(envVars, corev1.EnvVar{
Name: "AWS_DEFAULT_REGION",
Value: clusterImageExport.Spec.Storage.S3.Region,
})
}
}
jobParams := shared.JobParams{
Name: normalisedImageName,
Namespace: clusterImageExport.Namespace,
@@ -418,6 +434,7 @@ func (r *ClusterImageExportReconciler) runCleanupJob(ctx context.Context, cluste
ImagePullSecrets: clusterImageExport.Spec.ImagePullSecrets,
BackoffLimit: &backoffLimit,
TTLSecondsAfterFinished: &ttlSecondsAfterFinished,
EnvVars: envVars,
}
cleanupJob := shared.CreateJob(jobParams, func(raczylocomv1.ClusterImageExport) []string { return nil })
+1 -3
View File
@@ -117,8 +117,6 @@ func SetupS3Params(s3Config raczylocomv1.ClusterImageStorageS3) []string {
if s3Config.Endpoint != "" {
params = append(params, fmt.Sprintf("--endpoint_url='%s'", s3Config.Endpoint))
}
if s3Config.Region != "" {
params = append(params, fmt.Sprintf("--region='%s'", s3Config.Region))
}
// Region is now handled via environment variables
return params
}