From 1dd3f013b09360d1f168c694a71e7c9260906d1f Mon Sep 17 00:00:00 2001 From: Zufar Dhiyaullhaq Date: Sun, 29 Sep 2024 00:10:59 +0700 Subject: [PATCH] feat: change waiting time from per week to per day for production & non production Signed-off-by: Zufar Dhiyaullhaq --- .env.example | 4 ++-- README.md | 4 ++-- charts/istio-upgrade-consumer/README.md | 4 ++-- .../templates/configmap.yaml | 4 ++-- charts/istio-upgrade-consumer/values.yaml | 4 ++-- charts/releases/index.yaml | 6 +++--- .../releases/istio-upgrade-consumer-1.0.0.tgz | Bin 2824 -> 2825 bytes settings/settings.go | 4 ++-- usecases/upgrade/upgrade.go | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.env.example b/.env.example index c22eb11..8f1fa42 100644 --- a/.env.example +++ b/.env.example @@ -5,7 +5,7 @@ export RECEIVER_HTTP_PORT=8080 export STORAGE_MODE=configmap export STORAGE_CONFIGMAP_NAME=istio-upgrade-config export STORAGE_CONFIGMAP_NAMESPACE=istio-system -export PRODUCTION_WAITING_WEEK=4 -export NON_PRODUCTION_WAITING_WEEK=1 +export PRODUCTION_WAITING_DAY=28 +export NON_PRODUCTION_WAITING_DAY=7 export TIME_LOCATION=Asia/Jakarta export TIME_FORMAT=2006-01-02 \ No newline at end of file diff --git a/README.md b/README.md index 0e36b07..97823ca 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ helm install my-istio-upgrade-consumer istio-upgrade-consumer/istio-upgrade-cons |-----|------|---------|-------------| | configuration.clusterEnvironment | string | `"production"` | | | configuration.clusterName | string | `"my-cluster"` | | -| configuration.nonProductionWaitingWeek | string | `"1"` | | -| configuration.productionWaitingWeek | string | `"4"` | | +| configuration.nonProductionWaitingDay | string | `"7"` | | +| configuration.productionWaitingDay | string | `"28"` | | | configuration.receiverHTTPPort | string | `"8080"` | | | configuration.receiverMode | string | `"http"` | | | configuration.storageConfigMapName | string | `"istio-auto-upgrade-config"` | | diff --git a/charts/istio-upgrade-consumer/README.md b/charts/istio-upgrade-consumer/README.md index 0e36b07..97823ca 100644 --- a/charts/istio-upgrade-consumer/README.md +++ b/charts/istio-upgrade-consumer/README.md @@ -19,8 +19,8 @@ helm install my-istio-upgrade-consumer istio-upgrade-consumer/istio-upgrade-cons |-----|------|---------|-------------| | configuration.clusterEnvironment | string | `"production"` | | | configuration.clusterName | string | `"my-cluster"` | | -| configuration.nonProductionWaitingWeek | string | `"1"` | | -| configuration.productionWaitingWeek | string | `"4"` | | +| configuration.nonProductionWaitingDay | string | `"7"` | | +| configuration.productionWaitingDay | string | `"28"` | | | configuration.receiverHTTPPort | string | `"8080"` | | | configuration.receiverMode | string | `"http"` | | | configuration.storageConfigMapName | string | `"istio-auto-upgrade-config"` | | diff --git a/charts/istio-upgrade-consumer/templates/configmap.yaml b/charts/istio-upgrade-consumer/templates/configmap.yaml index 6cd8698..7836d05 100644 --- a/charts/istio-upgrade-consumer/templates/configmap.yaml +++ b/charts/istio-upgrade-consumer/templates/configmap.yaml @@ -15,7 +15,7 @@ data: STORAGE_MODE: "{{ .Values.configuration.storageMode }}" STORAGE_CONFIGMAP_NAME: "{{ .Values.configuration.storageConfigMapName }}" STORAGE_CONFIGMAP_NAMESPACE: "{{ .Values.configuration.storageConfigMapNamespace }}" - PRODUCTION_WAITING_WEEK: "{{ .Values.configuration.productionWaitingWeek }}" - NON_PRODUCTION_WAITING_WEEK: "{{ .Values.configuration.nonProductionWaitingWeek }}" + PRODUCTION_WAITING_DAY: "{{ .Values.configuration.productionWaitingDay }}" + NON_PRODUCTION_WAITING_DAY: "{{ .Values.configuration.nonProductionWaitingDay }}" TIME_LOCATION: "{{ .Values.configuration.timeLocation }}" TIME_FORMAT: "{{ .Values.configuration.timeFormat }}" \ No newline at end of file diff --git a/charts/istio-upgrade-consumer/values.yaml b/charts/istio-upgrade-consumer/values.yaml index b1021d3..c1b1c88 100644 --- a/charts/istio-upgrade-consumer/values.yaml +++ b/charts/istio-upgrade-consumer/values.yaml @@ -25,7 +25,7 @@ configuration: storageMode: "configmap" storageConfigMapName: "istio-auto-upgrade-config" storageConfigMapNamespace: "istio-system" - productionWaitingWeek: "4" - nonProductionWaitingWeek: "1" + productionWaitingDay: "28" + nonProductionWaitingDay: "7" timeLocation: "Asia/Jakarta" timeFormat: "2006-01-02" \ No newline at end of file diff --git a/charts/releases/index.yaml b/charts/releases/index.yaml index 49e9a75..0359d7e 100644 --- a/charts/releases/index.yaml +++ b/charts/releases/index.yaml @@ -3,10 +3,10 @@ entries: istio-upgrade-consumer: - apiVersion: v2 appVersion: 1.0.0 - created: "2024-09-29T00:03:17.055556+07:00" + created: "2024-09-29T00:10:34.591044+07:00" description: Consumer for Istio Upgrade tooling to receive events related to Istio upgrade - digest: f4ebb9d1897ab7e1ed8f1a7d7223d99e868ac1d788db9e1fd0bd7b9dfefb7a75 + digest: 78764a7ee1b6ae84060bf75e15226677492f70f059db8ec3c2f1b44a0dc5519b home: https://github.com/gopaytech/istio-upgrade-consumer maintainers: - email: zufardhiyaulhaq@gmail.com @@ -17,4 +17,4 @@ entries: urls: - istio-upgrade-consumer-1.0.0.tgz version: 1.0.0 -generated: "2024-09-29T00:03:17.054611+07:00" +generated: "2024-09-29T00:10:34.590584+07:00" diff --git a/charts/releases/istio-upgrade-consumer-1.0.0.tgz b/charts/releases/istio-upgrade-consumer-1.0.0.tgz index c23aa09f9c322b53938b81e0edbdc877d05f5b1b..6491de597720e0789fe8d94433fbf2c5e176dfa5 100644 GIT binary patch delta 2794 zcmV!3h)@0Bboj_%zxHV$85g>^Bc&ngoF#k zUYTDlYyIQ?CV*n{2{TS;WW&tTP#iB`TZU_MpNP?Os#Cm z+6fZ*p?~K}B{agho)t7!b^T~Y7>!h)LL+9>O&m#{c8*ewY(QN}FSSmw_``TS98xCf z-kI-AS;Ylq$io>y+MW=_g{qz^8=yFAR611hV~gW8CEhj~9wTQ($md+(P~xtd{tF_4 zMBWLS+t9Gy$;yaE!_D=_YF3aCf265Kw4u@E1b;REAKfA*P+t9>vJ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{}L#>|Jm-W|NcX#)vDq@dx1irRar2GhmnI>Ez6R7P-36^ zMTit>6IS{w2tP@CF+tmaB<2y`jj{SciX2|$B~@Nh8yk?v5NXG-urrDCa3Us~f=P(cM1B=G+L00960Tb|na08Rh^#)pP3 diff --git a/settings/settings.go b/settings/settings.go index b0df82c..59d68ec 100644 --- a/settings/settings.go +++ b/settings/settings.go @@ -19,8 +19,8 @@ type Settings struct { StorageConfigMapName string `envconfig:"STORAGE_CONFIGMAP_NAME" default:"istio-upgrade"` StorageConfigMapNameSpace string `envconfig:"STORAGE_CONFIGMAP_NAMESPACE" default:"istio-system"` - ProductionWaitingWeek int `required:"true" envconfig:"PRODUCTION_WAITING_WEEK" default:"4"` - NonProductionWaitingWeek int `required:"true" envconfig:"NON_PRODUCTION_WAITING_WEEK" default:"1"` + ProductionWaitingDay int `required:"true" envconfig:"PRODUCTION_WAITING_DAY" default:"28"` + NonProductionWaitingDay int `required:"true" envconfig:"NON_PRODUCTION_WAITING_DAY" default:"7"` TimeLocation string `required:"true" envconfig:"TIME_LOCATION" default:"Asia/Jakarta"` TimeFormat string `required:"true" envconfig:"TIME_FORMAT" default:"2006-01-02"` diff --git a/usecases/upgrade/upgrade.go b/usecases/upgrade/upgrade.go index 4ab5599..326baaf 100644 --- a/usecases/upgrade/upgrade.go +++ b/usecases/upgrade/upgrade.go @@ -65,9 +65,9 @@ func (u *UpgradeImplementation) CalculateRolloutRestartDate(environment Environm } if environment == ProductionEnv { - return now.AddDate(0, 0, 7*u.Settings.ProductionWaitingWeek) + return now.AddDate(0, 0, u.Settings.ProductionWaitingDay) } - return now.AddDate(0, 0, 7*u.Settings.NonProductionWaitingWeek) + return now.AddDate(0, 0, u.Settings.NonProductionWaitingDay) } func NewUpgradeImplementation(settings settings.Settings, upgradeStorage storage.UpgradeInterface) UpgradeImplementation {