Skip to content

Commit

Permalink
Custom image name in the CSV generator
Browse files Browse the repository at this point in the history
Let the user specify a custom image name
for the operator running the CSV generator.

Fixes: https://bugzilla.redhat.com/1757798

Signed-off-by: Simone Tiraboschi <[email protected]>
  • Loading branch information
tiraboschi committed Oct 2, 2019
1 parent 7b55bbe commit e7e880d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/components/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ func (ai *AddonsImages) FillDefaults() *AddonsImages {
return ai
}

func GetDeployment(version string, operatorVersion string, namespace string, repository string, tag string, imagePullPolicy string, addonsImages *AddonsImages) *appsv1.Deployment {
image := fmt.Sprintf("%s/%s:%s", repository, Name, tag)
func GetDeployment(version string, operatorVersion string, namespace string, repository string, imageName string, tag string, imagePullPolicy string, addonsImages *AddonsImages) *appsv1.Deployment {
image := fmt.Sprintf("%s/%s:%s", repository, imageName, tag)
deployment := &appsv1.Deployment{
TypeMeta: metav1.TypeMeta{
APIVersion: "apps/v1",
Expand Down
4 changes: 4 additions & 0 deletions tools/manifest-templator/manifest-templator.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type templateData struct {
OperatorVersion string
Namespace string
ContainerPrefix string
ImageName string
ContainerTag string
ImagePullPolicy string
CNA *operatorData
Expand Down Expand Up @@ -142,6 +143,7 @@ func getCNA(data *templateData) {
data.OperatorVersion,
data.Namespace,
data.ContainerPrefix,
data.ImageName,
data.ContainerTag,
data.ImagePullPolicy,
data.AddonsImages,
Expand Down Expand Up @@ -218,6 +220,7 @@ func main() {
operatorVersion := flag.String("operator-version", "", "The operator version")
namespace := flag.String("namespace", components.Namespace, "Namespace used by csv")
containerPrefix := flag.String("container-prefix", "quay.io/kubevirt", "The container repository used for the operator image")
imageName := flag.String("image-name", components.Name, "The operator image's name")
containerTag := flag.String("container-tag", "latest", "The operator image's container tag")
imagePullPolicy := flag.String("image-pull-policy", "Always", "The pull policy to use on the operator image")
multusImage := flag.String("multus-image", components.MultusImageDefault, "The multus image managed by CNA")
Expand All @@ -239,6 +242,7 @@ func main() {
OperatorVersion: *operatorVersion,
Namespace: *namespace,
ContainerPrefix: *containerPrefix,
ImageName: *imageName,
ContainerTag: *containerTag,
ImagePullPolicy: *imagePullPolicy,
AddonsImages: (&components.AddonsImages{
Expand Down

0 comments on commit e7e880d

Please sign in to comment.