mirror of
https://github.com/lukaszraczylo/kubernetes-images-sync-operator.git
synced 2026-07-07 03:44:38 +00:00
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:
+2
-2
@@ -10,9 +10,9 @@ description: |
|
|||||||
|
|
||||||
type: application
|
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
|
home: https://github.com/lukaszraczylo/kubernetes-images-sync-operator
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ sa:
|
|||||||
- ALL
|
- ALL
|
||||||
image:
|
image:
|
||||||
repository: ghcr.io/lukaszraczylo/kubernetes-images-sync-operator
|
repository: ghcr.io/lukaszraczylo/kubernetes-images-sync-operator
|
||||||
tag: 0.2.42
|
tag: 0.2.43
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: 500m
|
cpu: 500m
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/go-logr/logr"
|
"github.com/go-logr/logr"
|
||||||
appsv1 "k8s.io/api/apps/v1"
|
appsv1 "k8s.io/api/apps/v1"
|
||||||
batchv1 "k8s.io/api/batch/v1"
|
batchv1 "k8s.io/api/batch/v1"
|
||||||
|
corev1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
@@ -408,6 +409,21 @@ func (r *ClusterImageExportReconciler) runCleanupJob(ctx context.Context, cluste
|
|||||||
mergedAnnotations[k] = v
|
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{
|
jobParams := shared.JobParams{
|
||||||
Name: normalisedImageName,
|
Name: normalisedImageName,
|
||||||
Namespace: clusterImageExport.Namespace,
|
Namespace: clusterImageExport.Namespace,
|
||||||
@@ -418,6 +434,7 @@ func (r *ClusterImageExportReconciler) runCleanupJob(ctx context.Context, cluste
|
|||||||
ImagePullSecrets: clusterImageExport.Spec.ImagePullSecrets,
|
ImagePullSecrets: clusterImageExport.Spec.ImagePullSecrets,
|
||||||
BackoffLimit: &backoffLimit,
|
BackoffLimit: &backoffLimit,
|
||||||
TTLSecondsAfterFinished: &ttlSecondsAfterFinished,
|
TTLSecondsAfterFinished: &ttlSecondsAfterFinished,
|
||||||
|
EnvVars: envVars,
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanupJob := shared.CreateJob(jobParams, func(raczylocomv1.ClusterImageExport) []string { return nil })
|
cleanupJob := shared.CreateJob(jobParams, func(raczylocomv1.ClusterImageExport) []string { return nil })
|
||||||
|
|||||||
@@ -117,8 +117,6 @@ func SetupS3Params(s3Config raczylocomv1.ClusterImageStorageS3) []string {
|
|||||||
if s3Config.Endpoint != "" {
|
if s3Config.Endpoint != "" {
|
||||||
params = append(params, fmt.Sprintf("--endpoint_url='%s'", s3Config.Endpoint))
|
params = append(params, fmt.Sprintf("--endpoint_url='%s'", s3Config.Endpoint))
|
||||||
}
|
}
|
||||||
if s3Config.Region != "" {
|
// Region is now handled via environment variables
|
||||||
params = append(params, fmt.Sprintf("--region='%s'", s3Config.Region))
|
|
||||||
}
|
|
||||||
return params
|
return params
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user