@@ -111,17 +111,14 @@ func (c ServiceCatalogControllerManagerOperator) sync() error {
111
111
}
112
112
}
113
113
114
- v1helpers .SetOperatorCondition (& operatorConfig .Status .Conditions , operatorapiv1.OperatorCondition {
115
- Type : operatorapiv1 .OperatorStatusTypeUpgradeable ,
116
- Status : operatorapiv1 .ConditionTrue ,
117
- Reason : "" ,
118
- Message : "" ,
119
- })
120
-
121
114
switch operatorConfig .Spec .ManagementState {
122
115
case operatorapiv1 .Managed :
123
- // redundant but it makes reading this switch later more clear
124
- break
116
+ v1helpers .SetOperatorCondition (& operatorConfig .Status .Conditions , operatorapiv1.OperatorCondition {
117
+ Type : operatorapiv1 .OperatorStatusTypeUpgradeable ,
118
+ Status : operatorapiv1 .ConditionFalse ,
119
+ Reason : "Managed" ,
120
+ Message : "the controller manager is in a managed state, upgrades are not possible." ,
121
+ })
125
122
case operatorapiv1 .Unmanaged :
126
123
// manage status
127
124
originalOperatorConfig := operatorConfig .DeepCopy ()
@@ -143,6 +140,12 @@ func (c ServiceCatalogControllerManagerOperator) sync() error {
143
140
Reason : "Unmanaged" ,
144
141
Message : "the controller manager is in an unmanaged state, therefore no operator actions are failing." ,
145
142
})
143
+ v1helpers .SetOperatorCondition (& operatorConfig .Status .Conditions , operatorapiv1.OperatorCondition {
144
+ Type : operatorapiv1 .OperatorStatusTypeUpgradeable ,
145
+ Status : operatorapiv1 .ConditionTrue ,
146
+ Reason : "Unmanaged" ,
147
+ Message : "the controller manager is in an unmanaged state, upgrades are possible." ,
148
+ })
146
149
147
150
if ! equality .Semantic .DeepEqual (operatorConfig .Status , originalOperatorConfig .Status ) {
148
151
if _ , err := c .operatorConfigClient .ServiceCatalogControllerManagers ().UpdateStatus (operatorConfig ); err != nil {
@@ -177,6 +180,12 @@ func (c ServiceCatalogControllerManagerOperator) sync() error {
177
180
Reason : "Removed" ,
178
181
Message : "" ,
179
182
})
183
+ v1helpers .SetOperatorCondition (& operatorConfig .Status .Conditions , operatorapiv1.OperatorCondition {
184
+ Type : operatorapiv1 .OperatorStatusTypeUpgradeable ,
185
+ Status : operatorapiv1 .ConditionTrue ,
186
+ Reason : "Removed" ,
187
+ Message : "the controller manager is in a removed state, upgrades are possible." ,
188
+ })
180
189
181
190
// The version must be reported even though the operand is not running
182
191
operatorConfig .Status .Version = os .Getenv ("RELEASE_VERSION" )
0 commit comments