Skip to content

Commit

Permalink
feat: change waiting time from per week to per day for production & n…
Browse files Browse the repository at this point in the history
…on production

Signed-off-by: Zufar Dhiyaullhaq <[email protected]>
  • Loading branch information
zufardhiyaulhaq committed Sep 28, 2024
1 parent 2035507 commit 1dd3f01
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"` | |
Expand Down
4 changes: 2 additions & 2 deletions charts/istio-upgrade-consumer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"` | |
Expand Down
4 changes: 2 additions & 2 deletions charts/istio-upgrade-consumer/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
4 changes: 2 additions & 2 deletions charts/istio-upgrade-consumer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 3 additions & 3 deletions charts/releases/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
Expand All @@ -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"
Binary file modified charts/releases/istio-upgrade-consumer-1.0.0.tgz
Binary file not shown.
4 changes: 2 additions & 2 deletions settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
4 changes: 2 additions & 2 deletions usecases/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1dd3f01

Please sign in to comment.