Skip to content

Commit

Permalink
kvstoremesh: don't disable by default
Browse files Browse the repository at this point in the history
In 1.16 we enabled kvstoremesh by default in helm.
Currently, cilium-cli was still setting kvstoremesh.enabled to false.
Now, if user does not explicitly specify if kvstoremesh should be
enabled or disabled, we will rely on default helm value.

Signed-off-by: Marcel Zieba <marcel.zieba@isovalent.com>
  • Loading branch information
marseel authored and michi-covalent committed Jul 6, 2024
1 parent c87b914 commit 5a87831
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion cli/clustermesh.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,11 @@ func newCmdClusterMeshEnableWithHelm() *cobra.Command {
Use: "enable",
Short: "Enable ClusterMesh ability in a cluster using Helm",
Long: ``,
RunE: func(_ *cobra.Command, _ []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
params.Namespace = namespace
params.HelmReleaseName = helmReleaseName
ctx := context.Background()
params.EnableKVStoreMeshChanged = cmd.Flags().Changed("enable-kvstoremesh")
if err := clustermesh.EnableWithHelm(ctx, k8sClient, params); err != nil {
fatalf("Unable to enable ClusterMesh: %s", err)
}
Expand Down
13 changes: 9 additions & 4 deletions clustermesh/clustermesh.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ type Parameters struct {
// EnableKVStoreMesh indicates whether kvstoremesh should be enabled.
// For Helm mode only.
EnableKVStoreMesh bool
// Indicates if we should actually set the kvstoremesh.enabled Helm value
// or rely on the default value. Default value of kvstoremesh changed in 1.16
EnableKVStoreMeshChanged bool

// HelmReleaseName specifies the Helm release name for the Cilium CLI.
// Useful for referencing Cilium installations installed directly through Helm
Expand Down Expand Up @@ -1494,10 +1497,12 @@ func generateEnableHelmValues(params Parameters, flavor k8s.Flavor) (map[string]
},
}

helmVals["clustermesh"].(map[string]interface{})["apiserver"].(map[string]interface{})["kvstoremesh"] =
map[string]interface{}{
"enabled": params.EnableKVStoreMesh,
}
if params.EnableKVStoreMeshChanged {
helmVals["clustermesh"].(map[string]interface{})["apiserver"].(map[string]interface{})["kvstoremesh"] =
map[string]interface{}{
"enabled": params.EnableKVStoreMesh,
}
}

return helmVals, nil
}
Expand Down

0 comments on commit 5a87831

Please sign in to comment.