Skip to content

Commit

Permalink
squash: use OPERATOR_IMAGE_VERSION instead of version module
Browse files Browse the repository at this point in the history
  • Loading branch information
petr-muller committed Feb 19, 2024
1 parent e93623b commit 6218129
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions install/0000_00_cluster-version-operator_03_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ spec:
name: kube-api-access
readOnly: true
env:
- name: OPERATOR_IMAGE_VERSION
value: "0.0.1-snapshot"
- name: KUBERNETES_SERVICE_PORT # allows CVO to communicate with apiserver directly on same host. Is substituted with port from infrastructures.status.apiServerInternalURL if available.
value: "6443"
- name: KUBERNETES_SERVICE_HOST # allows CVO to communicate with apiserver directly on same host. Is substituted with hostname from infrastructures.status.apiServerInternalURL if available.
Expand Down
7 changes: 5 additions & 2 deletions pkg/cvo/cvo.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
configinformersv1 "github.com/openshift/client-go/config/informers/externalversions/config/v1"
configlistersv1 "github.com/openshift/client-go/config/listers/config/v1"
"github.com/openshift/library-go/pkg/manifest"
"github.com/openshift/library-go/pkg/operator/status"
"github.com/openshift/library-go/pkg/verify"
"github.com/openshift/library-go/pkg/verify/store"
"github.com/openshift/library-go/pkg/verify/store/configmap"
Expand All @@ -49,7 +50,6 @@ import (
"github.com/openshift/cluster-version-operator/pkg/payload"
"github.com/openshift/cluster-version-operator/pkg/payload/precondition"
preconditioncv "github.com/openshift/cluster-version-operator/pkg/payload/precondition/clusterversion"
"github.com/openshift/cluster-version-operator/pkg/version"
)

const (
Expand Down Expand Up @@ -91,8 +91,11 @@ func DefaultGatesWhenUnknown() FeatureGates {

func GetCvoGatesFrom(gate *configv1.FeatureGate) FeatureGates {
enabledGates := DefaultGatesWhenUnknown()
operatorVersion := status.VersionForOperatorFromEnv()
klog.Infof("Looking up feature gates for version %s", operatorVersion)
for _, g := range gate.Status.FeatureGates {
if g.Version != version.Version.String() {

if g.Version != operatorVersion {
continue
}
// We found the matching version, so we do not need to run in the unknown version mode
Expand Down

0 comments on commit 6218129

Please sign in to comment.