diff --git a/pkg/controller/installation/core_controller.go b/pkg/controller/installation/core_controller.go index b2ab7664e1..d721b134ae 100644 --- a/pkg/controller/installation/core_controller.go +++ b/pkg/controller/installation/core_controller.go @@ -1100,7 +1100,7 @@ func (r *ReconcileInstallation) Reconcile(ctx context.Context, request reconcile return reconcile.Result{}, err } - calicoVersion := r.ext.ProductVersion() + calicoVersion := r.ext.ProductVersion(&instance.Spec) ci := controller.Inputs{ RenderInputs: render.Inputs{ diff --git a/pkg/enterprise/installation/core.go b/pkg/enterprise/installation/core.go index fd6236b5d6..fd92aaa20a 100644 --- a/pkg/enterprise/installation/core.go +++ b/pkg/enterprise/installation/core.go @@ -93,9 +93,12 @@ func collectProcessPathEnabled(lc *operatorv1.LogCollector) bool { *lc.Spec.CollectProcessPath == operatorv1.CollectProcessPathEnable } -// Validate rejects installation config Calico Enterprise does not support. -// ProductVersion is the Calico Enterprise release the operator reports in status. -func (e *Extension) ProductVersion() string { +// ProductVersion is the release the operator reports in status. The Enterprise +// operator also manages Calico variant installs, during migration. +func (e *Extension) ProductVersion(install *operatorv1.InstallationSpec) string { + if !install.Variant.IsEnterprise() { + return components.CalicoRelease + } return components.EnterpriseRelease } diff --git a/pkg/extensions/extensions_test.go b/pkg/extensions/extensions_test.go index 81b273d9b6..1ed6cecf56 100644 --- a/pkg/extensions/extensions_test.go +++ b/pkg/extensions/extensions_test.go @@ -84,7 +84,7 @@ var _ = Describe("the zero value Extensions", func() { It("runs the base behavior for every controller", func() { var e extensions.Extensions - Expect(e.Installation().ProductVersion()).NotTo(BeEmpty()) + Expect(e.Installation().ProductVersion(&operatorv1.InstallationSpec{})).NotTo(BeEmpty()) Expect(e.Installation().KubeControllersImage()).To(BeNil()) Expect(e.Windows().Watches(nil)).NotTo(HaveOccurred()) diff --git a/pkg/extensions/installation.go b/pkg/extensions/installation.go index d6c923fd62..1191f80268 100644 --- a/pkg/extensions/installation.go +++ b/pkg/extensions/installation.go @@ -41,8 +41,9 @@ type InstallationExtension interface { // it changed fc. It runs before Felix defaulting persists. DefaultFelixConfiguration(install *operatorv1.InstallationSpec, fc *v3.FelixConfiguration) (bool, error) - // ProductVersion is the version the operator writes to the Installation status. - ProductVersion() string + // ProductVersion is the version the operator writes to the Installation status + // for the variant the given spec installs. + ProductVersion(install *operatorv1.InstallationSpec) string // KubeControllersImage overrides the image kube-controllers runs, or nil to run // the variant's combined calico image. Calico Cloud is the only caller. @@ -69,7 +70,7 @@ func (noopInstallation) DefaultFelixConfiguration(*operatorv1.InstallationSpec, return false, nil } -func (noopInstallation) ProductVersion() string { +func (noopInstallation) ProductVersion(*operatorv1.InstallationSpec) string { return components.CalicoRelease }