Skip to content

Commit

Permalink
Fixed issue for redis persistence
Browse files Browse the repository at this point in the history
Signed-off-by: iamabhishek-dubey <[email protected]>
  • Loading branch information
iamabhishek-dubey committed Oct 7, 2022
1 parent dcc4c8f commit 3c91672
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/v1beta1/rediscluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type RedisClusterSpec struct {
TLS *TLSConfig `json:"TLS,omitempty"`
Sidecars *[]Sidecar `json:"sidecars,omitempty"`
ServiceAccountName *string `json:"serviceAccountName,omitempty"`
PersistenceEnabled *bool `json:"persistenceEnabled,omitempty"`
}

func (cr *RedisClusterSpec) GetReplicaCounts(t string) int32 {
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ spec:
additionalProperties:
type: string
type: object
persistenceEnabled:
type: boolean
priorityClassName:
type: string
redisExporter:
Expand Down
4 changes: 3 additions & 1 deletion k8sutils/redis-cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ func generateRedisClusterContainerParams(cr *redisv1beta1.RedisCluster, readines
if livenessProbeDef != nil {
containerProp.LivenessProbe = livenessProbeDef
}
if cr.Spec.Storage != nil {
if cr.Spec.Storage != nil && *cr.Spec.PersistenceEnabled {
containerProp.PersistenceEnabled = &trueProperty
} else {
containerProp.PersistenceEnabled = &falseProperty
}
if cr.Spec.TLS != nil {
containerProp.TLSConfig = cr.Spec.TLS
Expand Down

0 comments on commit 3c91672

Please sign in to comment.