Skip to content

Commit

Permalink
OSSM-5812 Ensure CNI is deployed when using the openshift profile (#1…
Browse files Browse the repository at this point in the history
…586)

Previously, when the openshift profile was selected, all the required values were added to the IstioRevision. However, upstream Istio has since changed this. Values from the profiles are now applied when the charts are rendered. This means that the operator can no longer check the IstioRevision.spec.values.cni.enabled field to determine whether it should deploy CNI. Instead, it should check IstioRevision.spec.components.cni.enabled, but we don't yet have the components field.

As a temporary solution, the operator will now also deploy CNI if the profile is set to "openshift".
  • Loading branch information
luksa authored Jan 23, 2024
1 parent f5d3c9e commit f7df2a4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions controllers/istiorevision/istiorevision_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@ func (r *IstioRevisionReconciler) isOldestRevisionWithCNI(ctx context.Context, r
}

func isCNIEnabled(values helm.HelmValues) (bool, error) {
// TODO: remove this temporary hack when we introduce Istio.spec.components.cni.enabled
if profile, _, err := values.GetString("profile"); err != nil {
return false, err
} else if profile == "openshift" {
return true, nil
}

enabled, _, err := values.GetBool("istio_cni.enabled")
return enabled, err
}
Expand Down

0 comments on commit f7df2a4

Please sign in to comment.