-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from spotahome/devops-823-improve-update-process
[DEVOPS-823] Improve update process
- Loading branch information
Showing
7 changed files
with
73 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
VERSION := 0.5.1 | ||
VERSION := 0.5.2 | ||
|
||
# Name of this service/application | ||
SERVICE_NAME := redis-operator | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package v1alpha2 | ||
|
||
const ( | ||
defaultRedisNumber = 3 | ||
defaultSentinelNumber = 3 | ||
defaultExporterImage = "oliver006/redis_exporter" | ||
defaultExporterImageVersion = "v0.11.3" | ||
defaultRedisImage = "redis" | ||
defaultRedisImageVersion = "3.2-alpine" | ||
) | ||
|
||
var ( | ||
defaultSentinelCustomConfig = []string{"down-after-milliseconds 5000", "failover-timeout 10000"} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package v1alpha2 | ||
|
||
import ( | ||
"errors" | ||
) | ||
|
||
// Validate set the values by default if not defined and checks if the values given are valid | ||
func (r *RedisFailover) Validate() error { | ||
if r.Spec.Redis.Replicas == 0 { | ||
r.Spec.Redis.Replicas = defaultRedisNumber | ||
} else if r.Spec.Redis.Replicas < defaultRedisNumber { | ||
return errors.New("number of redises in spec is less than the minimum") | ||
} | ||
|
||
if r.Spec.Sentinel.Replicas == 0 { | ||
r.Spec.Sentinel.Replicas = defaultSentinelNumber | ||
} else if r.Spec.Sentinel.Replicas < defaultSentinelNumber { | ||
return errors.New("number of sentinels in spec is less than the minimum") | ||
} | ||
|
||
if r.Spec.Redis.Image == "" { | ||
r.Spec.Redis.Image = defaultRedisImage | ||
} | ||
|
||
if r.Spec.Redis.Version == "" { | ||
r.Spec.Redis.Version = defaultRedisImageVersion | ||
} | ||
|
||
if r.Spec.Redis.ExporterImage == "" { | ||
r.Spec.Redis.ExporterImage = defaultExporterImage | ||
} | ||
|
||
if r.Spec.Redis.ExporterVersion == "" { | ||
r.Spec.Redis.ExporterVersion = defaultExporterImageVersion | ||
} | ||
|
||
if len(r.Spec.Sentinel.CustomConfig) == 0 { | ||
r.Spec.Sentinel.CustomConfig = defaultSentinelCustomConfig | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters