1
0
mirror of https://github.com/kairos-io/osbuilder.git synced 2025-05-08 08:06:18 +00:00

Un-hardcode the copier image

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
Dimitris Karakasilis 2022-12-15 12:29:49 +02:00
parent 4e5e383b78
commit cfc4ebf308
No known key found for this signature in database
GPG Key ID: 286DCAFD2C97DDE3
3 changed files with 10 additions and 10 deletions

View File

@ -326,7 +326,6 @@ func (r *OSArtifactReconciler) genJob(artifact buildv1alpha1.OSArtifact) *batchv
pod.InitContainers = append(pod.InitContainers, buildGCECloudImageContainer)
}
// TODO: Shell out to `kubectl cp`? Why not?
// TODO: Does it make sense to build the image and not push it? Maybe remove
// this flag?
if pushImage {
@ -334,9 +333,7 @@ func (r *OSArtifactReconciler) genJob(artifact buildv1alpha1.OSArtifact) *batchv
}
pod.Containers = []v1.Container{
// TODO: Add kubectl to osbuilder-tools?
//createPushToServerImageContainer(r.ToolImage),
createPushToServerImageContainer("bitnami/kubectl", r.ArtifactPodInfo),
createPushToServerImageContainer(r.CopierImage, r.ArtifactPodInfo),
}
jobLabels := genJobLabel(artifact.Name)

View File

@ -48,11 +48,11 @@ type ArtifactPodInfo struct {
// OSArtifactReconciler reconciles a OSArtifact object
type OSArtifactReconciler struct {
client.Client
Scheme *runtime.Scheme
restConfig *rest.Config
clientSet *kubernetes.Clientset
ServingImage, ToolImage string
ArtifactPodInfo ArtifactPodInfo
Scheme *runtime.Scheme
restConfig *rest.Config
clientSet *kubernetes.Clientset
ServingImage, ToolImage, CopierImage string
ArtifactPodInfo ArtifactPodInfo
}
func genObjectMeta(artifact buildv1alpha1.OSArtifact) metav1.ObjectMeta {

View File

@ -52,10 +52,12 @@ func main() {
var metricsAddr string
var enableLeaderElection bool
var probeAddr string
var serveImage, toolImage string
var serveImage, toolImage, copierImage string
var copyToPodLabel, copyToNamespace, copyToPath, copierRole string
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
flag.StringVar(&copierImage, "copier-image", "quay.io/kairos/kubectl", "The image that is used to copy artifacts to the server pod.")
flag.StringVar(&serveImage, "serve-image", "nginx", "Serve image.")
// It needs luet inside
flag.StringVar(&toolImage, "tool-image", "quay.io/kairos/osbuilder-tools:latest", "Tool image.")
@ -106,6 +108,7 @@ func main() {
Client: mgr.GetClient(),
ServingImage: serveImage,
ToolImage: toolImage,
CopierImage: copierImage,
ArtifactPodInfo: controllers.ArtifactPodInfo{
Label: copyToPodLabel,
Namespace: copyToNamespace,