mirror of
https://github.com/lukaszraczylo/kubernetes-images-sync-operator.git
synced 2026-06-10 23:29:11 +00:00
Clean up the code and basic improvements.
This commit is contained in:
@@ -10,10 +10,10 @@ import (
|
||||
var BACKUP_JOB_IMAGE string
|
||||
|
||||
func init() {
|
||||
BACKUP_JOB_IMAGE = os.Getenv("WORKER_IMAGE")
|
||||
if BACKUP_JOB_IMAGE == "" {
|
||||
BACKUP_JOB_IMAGE = "ghcr.io/lukaszraczylo/kubernetes-images-sync-worker:latest" // fallback
|
||||
}
|
||||
BACKUP_JOB_IMAGE = os.Getenv("WORKER_IMAGE")
|
||||
if BACKUP_JOB_IMAGE == "" {
|
||||
BACKUP_JOB_IMAGE = "ghcr.io/lukaszraczylo/kubernetes-images-sync-worker:0.5.54" // fallback to known stable version
|
||||
}
|
||||
}
|
||||
|
||||
const (
|
||||
|
||||
@@ -9,13 +9,13 @@ import (
|
||||
batchv1 "k8s.io/api/batch/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/utils/pointer"
|
||||
"k8s.io/utils/ptr"
|
||||
)
|
||||
|
||||
type JobParams struct {
|
||||
Name string
|
||||
Namespace string
|
||||
Annotations map[string]string
|
||||
Annotations map[string]string
|
||||
Image string
|
||||
Commands []string
|
||||
EnvVars []corev1.EnvVar
|
||||
@@ -88,7 +88,7 @@ func CreateJob[T any](params JobParams, setupFunc func(T) []string) *batchv1.Job
|
||||
VolumeMounts: volumeMounts,
|
||||
Env: params.EnvVars,
|
||||
SecurityContext: &corev1.SecurityContext{
|
||||
Privileged: pointer.Bool(true),
|
||||
Privileged: ptr.To(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user