Skip to content

Commit

Permalink
manifest templator: Fix var names (#1832)
Browse files Browse the repository at this point in the history
Command line variables of manifest generator should have "_image" suffix
for the image related ones.
In order to be backward compatible, lets first add those variable, use them, and then
we would able to drop the older ones.

Signed-off-by: Or Shoval <[email protected]>
  • Loading branch information
oshoval authored Jul 29, 2024
1 parent 48609d7 commit aa94304
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tools/manifest-templator/manifest-templator.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,27 @@ func main() {
coreDNSImage := flag.String("core-dns-image", components.CoreDNSImageDefault, "The coredns image used by CNA")
multusDynamicNetworksImage := flag.String("multus-dynamic-networks-image", components.MultusDynamicNetworksImageDefault, "The multus dynamic networks controller image managed by CNA")
kubeSecondaryDNSImage := flag.String("kube-secondary-dns", components.KubeSecondaryDNSImageDefault, "The kubesecondarydns-image managed by CNA")
kubeSecondaryDNSImageNew := flag.String("kube-secondary-dns-image", components.KubeSecondaryDNSImageDefault, "The kubesecondarydns-image managed by CNA")
kubevirtIpamControllerImage := flag.String("kubevirt-ipam-controller", components.KubevirtIpamControllerImageDefault, "The kubevirtipamcontroller-image managed by CNA")
kubevirtIpamControllerImageNew := flag.String("kubevirt-ipam-controller-image", components.KubevirtIpamControllerImageDefault, "The kubevirtipamcontroller-image managed by CNA")
passtBindingCNI := flag.String("passt-binding-cni", components.PasstBindingCNIImageDefault, "The passt binding cni image managed by CNA")
passtBindingCNIImage := flag.String("passt-binding-cni-image", components.PasstBindingCNIImageDefault, "The passt binding cni image managed by CNA")
dumpOperatorCRD := flag.Bool("dump-crds", false, "Append operator CRD to bottom of template. Used for csv-generator")
inputFile := flag.String("input-file", "", "Not used for csv-generator")
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
pflag.CommandLine.ParseErrorsWhitelist.UnknownFlags = true
pflag.Parse()

if *kubeSecondaryDNSImage == components.KubeSecondaryDNSImageDefault {
*kubeSecondaryDNSImage = *kubeSecondaryDNSImageNew
}
if *kubevirtIpamControllerImage == components.KubevirtIpamControllerImageDefault {
*kubevirtIpamControllerImage = *kubevirtIpamControllerImageNew
}
if *passtBindingCNI == components.PasstBindingCNIImageDefault {
*passtBindingCNI = *passtBindingCNIImage
}

data := templateData{
Version: *version,
VersionReplaces: *versionReplaces,
Expand Down

0 comments on commit aa94304

Please sign in to comment.