Skip to content

Commit

Permalink
fix: invalid default values (#15)
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Hutter <[email protected]>
Co-authored-by: Nick Marti <[email protected]>
  • Loading branch information
mhutter and martini-source authored Aug 10, 2023
1 parent cec0edc commit f5f79ec
Show file tree
Hide file tree
Showing 26 changed files with 55 additions and 55 deletions.
28 changes: 14 additions & 14 deletions internal/defaults/exoscalev1.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ func (d *Defaults) GetExoscalePostgreSQLDefault() *exoscalev1.ExoscalePostgreSQL

postgreSQLdefault.Spec.Parameters.Service.MajorVersion = "15"
postgreSQLdefault.Spec.Parameters.Service.Zone = "ch-dk-2"
postgreSQLdefault.Spec.Parameters.Size.Plan = "hobbyist-2 "
postgreSQLdefault.Spec.Parameters.Size.Plan = "hobbyist-2"
postgreSQLdefault.Spec.Parameters.Backup.TimeOfDay = "12:00:00"
postgreSQLdefault.Spec.Parameters.Maintenance.DayOfWeek = "Sunday"
postgreSQLdefault.Spec.Parameters.Maintenance.TimeOfDay = "24:00:00"
postgreSQLdefault.Spec.Parameters.Maintenance.DayOfWeek = "sunday"
postgreSQLdefault.Spec.Parameters.Maintenance.TimeOfDay = "00:00:00"

return &postgreSQLdefault
}

func (d *Defaults) GetExoscaleRedisDefault() *exoscalev1.ExoscaleRedis {
var redisDefault exoscalev1.ExoscaleRedis

redisDefault.Spec.Parameters.Maintenance.DayOfWeek = "Sunday"
redisDefault.Spec.Parameters.Maintenance.TimeOfDay = "24:00:00"
redisDefault.Spec.Parameters.Maintenance.DayOfWeek = "sunday"
redisDefault.Spec.Parameters.Maintenance.TimeOfDay = "00:00:00"
redisDefault.Spec.Parameters.Service.Zone = "ch-dk-2"

return &redisDefault
Expand All @@ -32,9 +32,9 @@ func (d *Defaults) GetExoscaleKafkaDefault() *exoscalev1.ExoscaleKafka {

kafkaDefault.Spec.Parameters.Service.Version = "3.4.0"
kafkaDefault.Spec.Parameters.Service.Zone = "ch-dk-2"
kafkaDefault.Spec.Parameters.Size.Plan = "startup-2 "
kafkaDefault.Spec.Parameters.Maintenance.DayOfWeek = "Sunday"
kafkaDefault.Spec.Parameters.Maintenance.TimeOfDay = "24:00:00"
kafkaDefault.Spec.Parameters.Size.Plan = "startup-2"
kafkaDefault.Spec.Parameters.Maintenance.DayOfWeek = "sunday"
kafkaDefault.Spec.Parameters.Maintenance.TimeOfDay = "00:00:00"

return &kafkaDefault
}
Expand All @@ -44,10 +44,10 @@ func (d *Defaults) GetExoscaleMySQLDefault() *exoscalev1.ExoscaleMySQL {

mySQLdefault.Spec.Parameters.Service.MajorVersion = "8"
mySQLdefault.Spec.Parameters.Service.Zone = "ch-dk-2"
mySQLdefault.Spec.Parameters.Size.Plan = "hobbyist-2 "
mySQLdefault.Spec.Parameters.Size.Plan = "hobbyist-2"
mySQLdefault.Spec.Parameters.Backup.TimeOfDay = "12:00:00"
mySQLdefault.Spec.Parameters.Maintenance.DayOfWeek = "Sunday"
mySQLdefault.Spec.Parameters.Maintenance.TimeOfDay = "24:00:00"
mySQLdefault.Spec.Parameters.Maintenance.DayOfWeek = "sunday"
mySQLdefault.Spec.Parameters.Maintenance.TimeOfDay = "00:00:00"

return &mySQLdefault
}
Expand All @@ -57,10 +57,10 @@ func (d *Defaults) GetExoscaleOpenSearchDefault() *exoscalev1.ExoscaleOpenSearch

openSearchDefault.Spec.Parameters.Service.MajorVersion = "2"
openSearchDefault.Spec.Parameters.Service.Zone = "ch-dk-2"
openSearchDefault.Spec.Parameters.Size.Plan = "hobbyist-2 "
openSearchDefault.Spec.Parameters.Size.Plan = "hobbyist-2"
openSearchDefault.Spec.Parameters.Backup.TimeOfDay = "12:00:00"
openSearchDefault.Spec.Parameters.Maintenance.DayOfWeek = "Sunday"
openSearchDefault.Spec.Parameters.Maintenance.TimeOfDay = "24:00:00"
openSearchDefault.Spec.Parameters.Maintenance.DayOfWeek = "sunday"
openSearchDefault.Spec.Parameters.Maintenance.TimeOfDay = "00:00:00"

return &openSearchDefault
}
4 changes: 2 additions & 2 deletions tests/golden/exoKafka.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"default": "kafka-default --kind ExoscaleKafka",
"parameters": "kafka-parameters --kind ExoscaleKafka --spec.parameters.maintenance.dayOfWeek=Monday --spec.parameters.service.zone ch-fr-1 --spec.parameters.size.plan enterprise-large",
"parameters": "kafka-parameters --kind ExoscaleKafka --spec.parameters.maintenance.dayOfWeek=monday --spec.parameters.service.zone ch-fr-1 --spec.parameters.size.plan enterprise-large",
"unset": "kafka-unset --kind ExoscaleKafka --spec.parameters.maintenance.dayOfWeek- --spec.parameters.service- --spec.parameters.size.plan-",
"jsonInput": "kafka-jsonInput --kind ExoscaleKafka --spec.parameters.maintenance={\"DayOfWeek\":\"Monday\",\"TimeOfDay\":\"00:00:00\"} --spec.parameters.service {\"Zone\":\"ch-fr-99\"} --spec.parameters.size.plan {\"Foo\":\"Bar\"}"
"jsonInput": "kafka-jsonInput --kind ExoscaleKafka --spec.parameters.maintenance={\"DayOfWeek\":\"monday\",\"TimeOfDay\":\"00:00:00\"} --spec.parameters.service {\"Zone\":\"ch-fr-99\"} --spec.parameters.size.plan {\"Foo\":\"Bar\"}"
}
6 changes: 3 additions & 3 deletions tests/golden/exoKafka/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ metadata:
spec:
parameters:
maintenance:
dayOfWeek: Sunday
timeOfDay: "24:00:00"
dayOfWeek: sunday
timeOfDay: "00:00:00"
network: {}
service:
kafkaSettings: null
version: 3.4.0
zone: ch-dk-2
size:
plan: 'startup-2 '
plan: startup-2
writeConnectionSecretToRef: {}
status: {}
2 changes: 1 addition & 1 deletion tests/golden/exoKafka/jsonInput.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
spec:
parameters:
maintenance:
dayOfWeek: Monday
dayOfWeek: monday
timeOfDay: "00:00:00"
network: {}
service:
Expand Down
4 changes: 2 additions & 2 deletions tests/golden/exoKafka/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
spec:
parameters:
maintenance:
dayOfWeek: Monday
timeOfDay: "24:00:00"
dayOfWeek: monday
timeOfDay: "00:00:00"
network: {}
service:
kafkaSettings: null
Expand Down
2 changes: 1 addition & 1 deletion tests/golden/exoKafka/unset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
spec:
parameters:
maintenance:
timeOfDay: "24:00:00"
timeOfDay: "00:00:00"
network: {}
service:
kafkaSettings: null
Expand Down
4 changes: 2 additions & 2 deletions tests/golden/exoMySQL.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"default": "mysql-default --kind ExoscaleMySQL",
"parameters": "mysql-parameters --kind ExoscaleMySQL --spec.parameters.backup.timeOfDay=24:00:00 --spec.parameters.maintenance.dayOfWeek Monday --spec.parameters.service.majorVersion 9999",
"parameters": "mysql-parameters --kind ExoscaleMySQL --spec.parameters.backup.timeOfDay=24:00:00 --spec.parameters.maintenance.dayOfWeek monday --spec.parameters.service.majorVersion 9999",
"unset": "mysql-unset --kind ExoscaleMySQL --spec.parameters.maintenance.dayOfWeek- --spec.parameters.service- --spec.parameters.size.plan-",
"jsonInput": "mysql-jsonInput --kind ExoscaleMySQL --spec.parameters.maintenance={\"DayOfWeek\":\"Monday\",\"TimeOfDay\":\"00:00:00\"} --spec.parameters.service {\"Zone\":\"ch-fr-99\"} --spec.parameters.size.plan {\"Foo\":\"Bar\"}"
"jsonInput": "mysql-jsonInput --kind ExoscaleMySQL --spec.parameters.maintenance={\"DayOfWeek\":\"monday\",\"TimeOfDay\":\"00:00:00\"} --spec.parameters.service {\"Zone\":\"ch-fr-99\"} --spec.parameters.size.plan {\"Foo\":\"Bar\"}"
}
6 changes: 3 additions & 3 deletions tests/golden/exoMySQL/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ spec:
backup:
timeOfDay: "12:00:00"
maintenance:
dayOfWeek: Sunday
timeOfDay: "24:00:00"
dayOfWeek: sunday
timeOfDay: "00:00:00"
network: {}
service:
majorVersion: "8"
mysqlSettings: null
zone: ch-dk-2
size:
plan: 'hobbyist-2 '
plan: hobbyist-2
writeConnectionSecretToRef: {}
status: {}
2 changes: 1 addition & 1 deletion tests/golden/exoMySQL/jsonInput.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
backup:
timeOfDay: "12:00:00"
maintenance:
dayOfWeek: Monday
dayOfWeek: monday
timeOfDay: "00:00:00"
network: {}
service:
Expand Down
6 changes: 3 additions & 3 deletions tests/golden/exoMySQL/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ spec:
backup:
timeOfDay: "24:00:00"
maintenance:
dayOfWeek: Monday
timeOfDay: "24:00:00"
dayOfWeek: monday
timeOfDay: "00:00:00"
network: {}
service:
majorVersion: "9999"
mysqlSettings: null
zone: ch-dk-2
size:
plan: 'hobbyist-2 '
plan: hobbyist-2
writeConnectionSecretToRef: {}
status: {}
2 changes: 1 addition & 1 deletion tests/golden/exoMySQL/unset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
backup:
timeOfDay: "12:00:00"
maintenance:
timeOfDay: "24:00:00"
timeOfDay: "00:00:00"
network: {}
service:
mysqlSettings: null
Expand Down
2 changes: 1 addition & 1 deletion tests/golden/exoOpenSearch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"default": "opensearch-default --kind ExoscaleOpenSearch",
"parameters": "opensearch-parameters --kind ExoscaleOpenSearch --spec.parameters.backup.timeOfDay=24:00:00 --spec.parameters.size.plan enterprise-large --spec.parameters.service.majorVersion 9999",
"unset": "opensearch-unset --kind ExoscaleOpenSearch --spec.parameters.maintenance.dayOfWeek- --spec.parameters.service- --spec.parameters.size.plan-",
"jsonInput": "opensearch-jsonInput --kind ExoscaleOpenSearch --spec.parameters.maintenance={\"DayOfWeek\":\"Monday\",\"TimeOfDay\":\"00:00:00\"} --spec.parameters.service {\"Zone\":\"ch-fr-99\"} --spec.parameters.size.plan {\"Foo\":\"Bar\"}"
"jsonInput": "opensearch-jsonInput --kind ExoscaleOpenSearch --spec.parameters.maintenance={\"DayOfWeek\":\"monday\",\"TimeOfDay\":\"00:00:00\"} --spec.parameters.service {\"Zone\":\"ch-fr-99\"} --spec.parameters.size.plan {\"Foo\":\"Bar\"}"
}
6 changes: 3 additions & 3 deletions tests/golden/exoOpenSearch/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ spec:
backup:
timeOfDay: "12:00:00"
maintenance:
dayOfWeek: Sunday
timeOfDay: "24:00:00"
dayOfWeek: sunday
timeOfDay: "00:00:00"
network: {}
service:
majorVersion: "2"
opensearchSettings: null
zone: ch-dk-2
size:
plan: 'hobbyist-2 '
plan: hobbyist-2
writeConnectionSecretToRef: {}
status: {}
2 changes: 1 addition & 1 deletion tests/golden/exoOpenSearch/jsonInput.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
backup:
timeOfDay: "12:00:00"
maintenance:
dayOfWeek: Monday
dayOfWeek: monday
timeOfDay: "00:00:00"
network: {}
service:
Expand Down
4 changes: 2 additions & 2 deletions tests/golden/exoOpenSearch/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ spec:
backup:
timeOfDay: "24:00:00"
maintenance:
dayOfWeek: Sunday
timeOfDay: "24:00:00"
dayOfWeek: sunday
timeOfDay: "00:00:00"
network: {}
service:
majorVersion: "9999"
Expand Down
2 changes: 1 addition & 1 deletion tests/golden/exoOpenSearch/unset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
backup:
timeOfDay: "12:00:00"
maintenance:
timeOfDay: "24:00:00"
timeOfDay: "00:00:00"
network: {}
service:
opensearchSettings: null
Expand Down
2 changes: 1 addition & 1 deletion tests/golden/exoPostgreSQL.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"default": "postgres-default --kind ExoscalePostgreSQL",
"parameters": "postgres-parameters --kind ExoscalePostgreSQL --spec.parameters.backup.timeOfDay=24:00:00 --spec.parameters.service.majorVersion 13 --spec.parameters.size.plan enterprise-large",
"unset": "postgres-unset --kind ExoscalePostgreSQL --spec.parameters.maintenance.dayOfWeek- --spec.parameters.service- --spec.parameters.size.plan-",
"jsonInput": "postgres-jsonInput --kind ExoscalePostgreSQL --spec.parameters.maintenance={\"DayOfWeek\":\"Monday\",\"TimeOfDay\":\"00:00:00\"} --spec.parameters.service {\"Zone\":\"ch-fr-99\"} --spec.parameters.size.plan {\"Foo\":\"Bar\"}"
"jsonInput": "postgres-jsonInput --kind ExoscalePostgreSQL --spec.parameters.maintenance={\"DayOfWeek\":\"monday\",\"TimeOfDay\":\"00:00:00\"} --spec.parameters.service {\"Zone\":\"ch-fr-99\"} --spec.parameters.size.plan {\"Foo\":\"Bar\"}"
}

6 changes: 3 additions & 3 deletions tests/golden/exoPostgreSQL/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ spec:
backup:
timeOfDay: "12:00:00"
maintenance:
dayOfWeek: Sunday
timeOfDay: "24:00:00"
dayOfWeek: sunday
timeOfDay: "00:00:00"
network: {}
service:
majorVersion: "15"
pgSettings: null
zone: ch-dk-2
size:
plan: 'hobbyist-2 '
plan: hobbyist-2
writeConnectionSecretToRef: {}
status: {}
2 changes: 1 addition & 1 deletion tests/golden/exoPostgreSQL/jsonInput.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
backup:
timeOfDay: "12:00:00"
maintenance:
dayOfWeek: Monday
dayOfWeek: monday
timeOfDay: "00:00:00"
network: {}
service:
Expand Down
4 changes: 2 additions & 2 deletions tests/golden/exoPostgreSQL/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ spec:
backup:
timeOfDay: "24:00:00"
maintenance:
dayOfWeek: Sunday
timeOfDay: "24:00:00"
dayOfWeek: sunday
timeOfDay: "00:00:00"
network: {}
service:
majorVersion: "13"
Expand Down
2 changes: 1 addition & 1 deletion tests/golden/exoPostgreSQL/unset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
backup:
timeOfDay: "12:00:00"
maintenance:
timeOfDay: "24:00:00"
timeOfDay: "00:00:00"
network: {}
service:
pgSettings: null
Expand Down
2 changes: 1 addition & 1 deletion tests/golden/exoRedis.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"default": "redis-default --kind ExoscaleRedis",
"parameters": "redis-parameters --kind ExoscaleRedis --spec.parameters.size.plan=enterprise-large --spec.parameters.service.zone ch-fr-1 --spec.parameters.maintenance.timeOfDay 24:00:00",
"unset": "redis-unset --kind ExoscaleRedis --spec.parameters.maintenance.dayOfWeek- --spec.parameters.service- --spec.parameters.service.redisSettings-",
"jsonInput": "redis-jsonInput --kind ExoscaleRedis --spec.parameters.maintenance={\"DayOfWeek\":\"Monday\",\"TimeOfDay\":\"00:00:00\"} --spec.parameters.service {\"Zone\":\"ch-fr-99\"} --spec.parameters.size.plan {\"Foo\":\"Bar\"}"
"jsonInput": "redis-jsonInput --kind ExoscaleRedis --spec.parameters.maintenance={\"DayOfWeek\":\"monday\",\"TimeOfDay\":\"00:00:00\"} --spec.parameters.service {\"Zone\":\"ch-fr-99\"} --spec.parameters.size.plan {\"Foo\":\"Bar\"}"
}

4 changes: 2 additions & 2 deletions tests/golden/exoRedis/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
spec:
parameters:
maintenance:
dayOfWeek: Sunday
timeOfDay: "24:00:00"
dayOfWeek: sunday
timeOfDay: "00:00:00"
network: {}
service:
redisSettings: null
Expand Down
2 changes: 1 addition & 1 deletion tests/golden/exoRedis/jsonInput.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
spec:
parameters:
maintenance:
dayOfWeek: Monday
dayOfWeek: monday
timeOfDay: "00:00:00"
network: {}
service:
Expand Down
2 changes: 1 addition & 1 deletion tests/golden/exoRedis/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
spec:
parameters:
maintenance:
dayOfWeek: Sunday
dayOfWeek: sunday
timeOfDay: "24:00:00"
network: {}
service:
Expand Down
2 changes: 1 addition & 1 deletion tests/golden/exoRedis/unset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
spec:
parameters:
maintenance:
timeOfDay: "24:00:00"
timeOfDay: "00:00:00"
network: {}
service:
redisSettings: null
Expand Down

0 comments on commit f5f79ec

Please sign in to comment.