Allow the default setup tools image name to be overridden
This is intended for special cases where the controller binaries are deployed without access to the public image repository.
@@ -19,6 +19,7 @@ package setup
import (
"encoding/base64"
"fmt"
+ "os"
"path"
redskyv1alpha1 "github.com/redskyops/redskyops-controller/api/v1alpha1"
@@ -100,6 +101,12 @@ func NewJob(t *redskyv1alpha1.Trial, mode string) (*batchv1.Job, error) {
},
}
+ // Check the environment for a default setup tools image name
+ if c.Image == "" {
+ c.Image = os.Getenv("DEFAULT_SETUP_IMAGE")
+ c.ImagePullPolicy = corev1.PullPolicy(os.Getenv("DEFAULT_SETUP_IMAGE_PULL_POLICY"))
+ }
+
// Make sure we have an image
if c.Image == "" {
c.Image = Image
