Skip to content

Commit 69dc076

Browse files
Merge pull request #1911 from dinhxuanvu/upgradeable-type
Bug 1907792: Change the OperatorUpgradeable condition to Upgradeable
2 parents 1e74520 + d6d7fb5 commit 69dc076

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ require (
2525
github.com/onsi/gomega v1.10.2
2626
github.com/openshift/api v0.0.0-20200331152225-585af27e34fd
2727
github.com/openshift/client-go v0.0.0-20200326155132-2a6cd50aedd0
28-
github.com/operator-framework/api v0.5.0
28+
github.com/operator-framework/api v0.5.1
2929
github.com/operator-framework/operator-registry v1.13.6
3030
github.com/otiai10/copy v1.2.0
3131
github.com/pkg/errors v0.9.1

Diff for: go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -818,8 +818,8 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ
818818
github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
819819
github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
820820
github.com/operator-framework/api v0.3.7-0.20200602203552-431198de9fc2/go.mod h1:Xbje9x0SHmh0nihE21kpesB38vk3cyxnE6JdDS8Jo1Q=
821-
github.com/operator-framework/api v0.5.0 h1:pzlFOIyrbqoW5Fx6EgJNaEa2sipwPGhNhFxIwu9V6CY=
822-
github.com/operator-framework/api v0.5.0/go.mod h1:A4VYTXGHHutXy4VrVvr3voBkObOaCaKaGF2dn5i0Fnw=
821+
github.com/operator-framework/api v0.5.1 h1:3CVLatTCtgV+f/kPh36op7ZFRBPWro2SZDlQkE9Y4+w=
822+
github.com/operator-framework/api v0.5.1/go.mod h1:A4VYTXGHHutXy4VrVvr3voBkObOaCaKaGF2dn5i0Fnw=
823823
github.com/operator-framework/operator-registry v1.13.6 h1:h/dIjQQS7uneQNRifrSz7h0xg4Xyjg6C9f6XZofbMPg=
824824
github.com/operator-framework/operator-registry v1.13.6/go.mod h1:YhnIzOVjRU2ZwZtzt+fjcjW8ujJaSFynBEu7QVKaSdU=
825825
github.com/otiai10/copy v1.2.0 h1:HvG945u96iNadPoG2/Ja2+AUJeW5YuFQMixq9yirC+k=

Diff for: pkg/controller/operators/olm/operatorconditions.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func (a *Operator) isOperatorUpgradeable(csv *v1alpha1.ClusterServiceVersion) (b
2626

2727
// Check condition overrides
2828
for _, override := range cond.Spec.Overrides {
29-
if override.Type == operatorsv1.OperatorUpgradeable {
29+
if override.Type == operatorsv1.Upgradeable {
3030
if override.Status == metav1.ConditionTrue {
3131
return true, nil
3232
}
@@ -35,7 +35,7 @@ func (a *Operator) isOperatorUpgradeable(csv *v1alpha1.ClusterServiceVersion) (b
3535
}
3636

3737
// Check for OperatorUpgradeable condition status
38-
if c := meta.FindStatusCondition(cond.Status.Conditions, operatorsv1.OperatorUpgradeable); c != nil {
38+
if c := meta.FindStatusCondition(cond.Status.Conditions, operatorsv1.Upgradeable); c != nil {
3939
if c.Status == metav1.ConditionFalse {
4040
return false, fmt.Errorf("The operator is not upgradeable: %s", c.Message)
4141
}

Diff for: test/e2e/operator_condition_e2e_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ var _ = Describe("Operator Condition", func() {
2222
TearDown(testNamespace)
2323
})
2424

25-
It("OperatorUpgradeable condition and overrides", func() {
25+
It("OperatorCondition Upgradeable type and overrides", func() {
2626
By("This test proves that an operator can upgrade successfully when" +
27-
"OperatorUpgrade condition is set in OperatorCondition CR. Plus, an operator" +
27+
"Upgrade condition type is set in OperatorCondition CR. Plus, an operator" +
2828
"chooses not to use OperatorCondition, the upgrade process will proceed as" +
2929
" asexpected. The overrides specification in OperatorCondition can be used to" +
3030
" override the status condition. The overrides spec will remain in place until" +
@@ -93,7 +93,7 @@ var _ = Describe("Operator Condition", func() {
9393
// Get the OperatorCondition for csvA and report that it is not upgradeable
9494
var cond *operatorsv1.OperatorCondition
9595
upgradeableFalseCondition := metav1.Condition{
96-
Type: operatorsv1.OperatorUpgradeable,
96+
Type: operatorsv1.Upgradeable,
9797
Status: metav1.ConditionFalse,
9898
Reason: "test",
9999
Message: "test",
@@ -134,7 +134,7 @@ var _ = Describe("Operator Condition", func() {
134134

135135
// Get the OperatorCondition for csvA and report that it is upgradeable, unblocking csvB
136136
upgradeableTrueCondition := metav1.Condition{
137-
Type: operatorsv1.OperatorUpgradeable,
137+
Type: operatorsv1.Upgradeable,
138138
Status: metav1.ConditionTrue,
139139
Reason: "test",
140140
Message: "test",
@@ -195,7 +195,7 @@ var _ = Describe("Operator Condition", func() {
195195
// Set Condition overrides to True
196196
cond.Spec = operatorsv1.OperatorConditionSpec{
197197
Overrides: []metav1.Condition{{
198-
Type: operatorsv1.OperatorUpgradeable,
198+
Type: operatorsv1.Upgradeable,
199199
Status: metav1.ConditionTrue,
200200
Reason: "test",
201201
Message: "test",

Diff for: vendor/github.com/operator-framework/api/pkg/operators/v1/operatorcondition_types.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: vendor/modules.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ github.com/openshift/client-go/config/informers/externalversions/config
439439
github.com/openshift/client-go/config/informers/externalversions/config/v1
440440
github.com/openshift/client-go/config/informers/externalversions/internalinterfaces
441441
github.com/openshift/client-go/config/listers/config/v1
442-
# github.com/operator-framework/api v0.5.0
442+
# github.com/operator-framework/api v0.5.1
443443
github.com/operator-framework/api/crds
444444
github.com/operator-framework/api/pkg/lib/version
445445
github.com/operator-framework/api/pkg/manifests

0 commit comments

Comments
 (0)