Skip to content

Commit

Permalink
fix(cni): pass experimental image version to install command (#4695)
Browse files Browse the repository at this point in the history
* fix(cni): pass experimental image version to the default control plane install

Signed-off-by: slonka <slonka@users.noreply.github.com>
  • Loading branch information
slonka authored Aug 3, 2022
1 parent f4afd69 commit e3969e8
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions app/kumactl/cmd/completion/testdata/bash.golden
Original file line number Diff line number Diff line change
Expand Up @@ -3430,8 +3430,6 @@ _kumactl_install_control-plane()
local_nonpersistent_flags+=("--cni-conf-name=")
flags+=("--cni-enabled")
local_nonpersistent_flags+=("--cni-enabled")
flags+=("--cni-experimental")
local_nonpersistent_flags+=("--cni-experimental")
flags+=("--cni-net-dir=")
two_word_flags+=("--cni-net-dir")
local_nonpersistent_flags+=("--cni-net-dir")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ type InstallControlPlaneArgs struct {
Cni_image_registry string `helm:"cni.image.registry,omitempty"`
Cni_image_repository string `helm:"cni.image.repository"`
Cni_image_tag string `helm:"cni.image.tag"`
Cni_imageExperimental_repository string `helm:"cni.imageExperimental.repository"`
Cni_imageExperimental_tag string `helm:"cni.imageExperimental.tag"`
Cni_nodeSelector map[string]string `helm:"cni.nodeSelector"`
ControlPlane_mode string `helm:"controlPlane.mode"`
ControlPlane_zone string `helm:"controlPlane.zone"`
Expand Down Expand Up @@ -104,6 +106,8 @@ func DefaultInstallCpContext() InstallCpContext {
Cni_image_registry: "",
Cni_image_repository: "install-cni",
Cni_image_tag: "0.0.10",
Cni_imageExperimental_repository: "kuma-cni",
Cni_imageExperimental_tag: kuma_version.Build.Version,
ControlPlane_mode: core.Standalone,
ControlPlane_zone: "",
ControlPlane_globalZoneSyncService_type: "LoadBalancer",
Expand Down
2 changes: 1 addition & 1 deletion app/kumactl/cmd/install/install_control_plane.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func (cv *componentVersion) Set(v string) error {
cv.args.ControlPlane_image_tag = v
cv.args.DataPlane_image_tag = v
cv.args.DataPlane_initImage_tag = v
cv.args.Cni_imageExperimental_tag = v
return nil
}

Expand Down Expand Up @@ -184,7 +185,6 @@ This command requires that the KUBECONFIG environment is set`,
cmd.Flags().StringVar(&args.DataPlane_initImage_tag, "dataplane-init-version", args.DataPlane_initImage_tag, "version of the init image of the Kuma DataPlane component")
cmd.Flags().StringVar(&args.ControlPlane_kdsGlobalAddress, "kds-global-address", args.ControlPlane_kdsGlobalAddress, "URL of Global Kuma CP (example: grpcs://192.168.0.1:5685)")
cmd.Flags().BoolVar(&args.Cni_enabled, "cni-enabled", args.Cni_enabled, "install Kuma with CNI instead of proxy init container")
cmd.Flags().BoolVar(&args.Cni_experimental, "cni-experimental", args.Cni_experimental, "install Kuma with new version of the CNI (experimental)")
cmd.Flags().BoolVar(&args.Cni_chained, "cni-chained", args.Cni_chained, "enable chained CNI installation")
cmd.Flags().StringVar(&args.Cni_net_dir, "cni-net-dir", args.Cni_net_dir, "set the CNI install directory")
cmd.Flags().StringVar(&args.Cni_bin_dir, "cni-bin-dir", args.Cni_bin_dir, "set the CNI binary directory")
Expand Down
3 changes: 2 additions & 1 deletion app/kumactl/cmd/install/install_control_plane_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ var _ = Describe("kumactl install control-plane", func() {
Entry("should generate Kubernetes resources with new CNI plugin (experimental)", testCase{
extraArgs: []string{
"--cni-enabled",
"--cni-experimental",
"--without-kubernetes-connection",
"--set",
"experimental.cni=true",
},
goldenFile: "install-control-plane.cni-experimental-enabled.golden.yaml",
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2035,7 +2035,7 @@ spec:
terminationGracePeriodSeconds: 5
containers:
- name: install-cni
image: "docker.io/kumahq/kuma-cni:1.7.0"
image: "docker.io/kumahq/kuma-cni:0.0.1"
imagePullPolicy: IfNotPresent
command: ["/install-cni"]
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ kumactl install control-plane [flags]
--cni-chained enable chained CNI installation
--cni-conf-name string set the CNI configuration name (default "kuma-cni.conf")
--cni-enabled install Kuma with CNI instead of proxy init container
--cni-experimental install Kuma with new version of the CNI (experimental)
--cni-net-dir string set the CNI install directory (default "/etc/cni/multus/net.d")
--cni-node-selector stringToString node selector for CNI deployment (default [])
--cni-registry string registry for the image of the Kuma CNI component
Expand Down
4 changes: 0 additions & 4 deletions test/framework/k8s_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,6 @@ func (c *K8sCluster) yamlForKumaViaKubectl(mode string) (string, error) {
argsMap["--cni-conf-name"] = Config.CNIConf.ConfName
}

if c.opts.cniExperimental {
argsMap["--cni-experimental"] = ""
}

if Config.XDSApiVersion != "" {
argsMap["--env-var"] = "KUMA_BOOTSTRAP_SERVER_API_VERSION=" + Config.XDSApiVersion
}
Expand Down

0 comments on commit e3969e8

Please sign in to comment.