@@ -44,10 +44,18 @@ const (
44
44
)
45
45
46
46
var (
47
- // some default Helm values
48
- defaultChartValues = HelmValues {
47
+ // some default Helm values for new installations
48
+ defaultChartValuesNewInstallations = HelmValues {
49
49
"deploymentTool" : "amb-oper" ,
50
+ "licenseKey" : map [string ]interface {}{
51
+ "createSecret" : true ,
52
+ },
53
+ }
50
54
55
+ // default Helm values when doing upgrades or re-installations
56
+ // TODO: remove the duplication with `defaultChartValuesNewInstallations`
57
+ defaultChartValuesUpgrades = HelmValues {
58
+ "deploymentTool" : "amb-oper" ,
51
59
"licenseKey" : map [string ]interface {}{
52
60
"createSecret" : false ,
53
61
},
@@ -224,6 +232,10 @@ func (r *ReconcileAmbassadorInstallation) Reconcile(request reconcile.Request) (
224
232
return reconcile.Result {}, nil
225
233
}
226
234
235
+ lastCondition := status .LastCondition (ambassador.AmbInsCondition {})
236
+ log .V (2 ).Info ("Last condition" ,
237
+ "type" , lastCondition .Type , "reason" , lastCondition .Reason , "status" , lastCondition .Status )
238
+
227
239
// check if this is the first and only AmbassadorInstallation in this namespace
228
240
// if it is not, mark the status as Duplicate
229
241
isFirstAmbIns , err := r .isFirstAmbInst (ambIns )
@@ -265,7 +277,13 @@ func (r *ReconcileAmbassadorInstallation) Reconcile(request reconcile.Request) (
265
277
266
278
// process all static Helm values: the default ones, the ones coming from files, etc...
267
279
helmValues := HelmValues {}
268
- helmValues .AppendFrom (defaultChartValues , true ) // copy the default values
280
+
281
+ // copy the default Helm values
282
+ if lastCondition .Type == ambassador .ConditionDeployed {
283
+ helmValues .AppendFrom (defaultChartValuesUpgrades , true )
284
+ } else {
285
+ helmValues .AppendFrom (defaultChartValuesNewInstallations , true )
286
+ }
269
287
270
288
for _ , f := range defExtraValuesFiles {
271
289
log .Info ("Looking for helm values in file" , "filename" , f )
0 commit comments