Skip to content

Commit 2064fa9

Browse files
authored
Merge pull request #783 from 3scale/upgrade-system-sphinx-secret-key
THREESCALE-8491 upgrade system sphinx secret key env var
2 parents 235b58e + 019d105 commit 2064fa9

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

pkg/3scale/amp/operator/system_reconciler.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55

66
appsv1alpha1 "github.com/3scale/3scale-operator/apis/apps/v1alpha1"
77
"github.com/3scale/3scale-operator/pkg/3scale/amp/component"
8+
"github.com/3scale/3scale-operator/pkg/3scale/amp/upgrade"
89
"github.com/3scale/3scale-operator/pkg/common"
910
"github.com/3scale/3scale-operator/pkg/helper"
1011
"github.com/3scale/3scale-operator/pkg/reconcilers"
@@ -118,6 +119,7 @@ func (r *SystemReconciler) Reconcile() (reconcile.Result, error) {
118119
reconcilers.DeploymentConfigAffinityMutator,
119120
reconcilers.DeploymentConfigTolerationsMutator,
120121
reconcilers.DeploymentConfigPodTemplateLabelsMutator,
122+
upgrade.SphinxSecretKeyEnvVarMutator,
121123
)
122124
err = r.ReconcileDeploymentConfig(system.SphinxDeploymentConfig(), sphinxDCmutator)
123125
if err != nil {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package upgrade
2+
3+
import (
4+
"github.com/3scale/3scale-operator/pkg/reconcilers"
5+
appsv1 "github.com/openshift/api/apps/v1"
6+
)
7+
8+
func SphinxSecretKeyEnvVarMutator(desired, existing *appsv1.DeploymentConfig) (bool, error) {
9+
// SECRET_KEY_BASE added
10+
updated := reconcilers.DeploymentConfigEnvVarReconciler(desired, existing, "SECRET_KEY_BASE")
11+
// DELTA_INDEX_INTERVAL removed
12+
tmp := reconcilers.DeploymentConfigEnvVarReconciler(desired, existing, "DELTA_INDEX_INTERVAL")
13+
updated = updated || tmp
14+
// FULL_REINDEX_INTERVAL removed
15+
tmp = reconcilers.DeploymentConfigEnvVarReconciler(desired, existing, "FULL_REINDEX_INTERVAL")
16+
updated = updated || tmp
17+
return updated, nil
18+
}

0 commit comments

Comments
 (0)