mirror of
https://github.com/kairos-io/osbuilder.git
synced 2025-05-06 15:16:34 +00:00
Fallback to the spec name when a push image name is not provided
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
parent
4c8f1dd0f0
commit
04d46465a7
@ -65,11 +65,17 @@ func unpackContainer(id, containerImage, pullImage string, pullOptions buildv1al
|
||||
}
|
||||
}
|
||||
|
||||
func createImageContainer(containerImage string, artifact buildv1alpha1.OSArtifact) v1.Container {
|
||||
imageName := "dontpush" // No image was defined, use a dummy one to let luet work
|
||||
if artifact.Spec.PushOptions.ImageName != "" {
|
||||
imageName = artifact.Spec.PushOptions.ImageName
|
||||
func pushImageName(artifact buildv1alpha1.OSArtifact) string {
|
||||
pushName := artifact.Spec.PushOptions.ImageName
|
||||
if pushName != "" {
|
||||
return pushName
|
||||
}
|
||||
return artifact.Name
|
||||
}
|
||||
|
||||
func createImageContainer(containerImage string, artifact buildv1alpha1.OSArtifact) v1.Container {
|
||||
imageName := pushImageName(artifact)
|
||||
|
||||
return v1.Container{
|
||||
ImagePullPolicy: v1.PullAlways,
|
||||
Name: "create-image",
|
||||
|
Loading…
Reference in New Issue
Block a user