Skip to content

Commit

Permalink
Log setting safe size if unsafe config is not allowed. (#524)
Browse files Browse the repository at this point in the history
  • Loading branch information
inelpandzic authored Jan 19, 2024
1 parent b305fb4 commit b292362
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/v1alpha1/perconaservermysql_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ func (cr *PerconaServerMySQL) CheckNSetDefaults(ctx context.Context, serverVersi

if cr.Spec.MySQL.ClusterType == ClusterTypeGR && !cr.Spec.AllowUnsafeConfig {
if cr.Spec.MySQL.Size < MinSafeGRSize {
log.Info("Setting safe defaults, updating MySQL cluster size", "oldSize", cr.Spec.MySQL.Size, "newSafeSize", MinSafeGRSize)
cr.Spec.MySQL.Size = MinSafeGRSize
}

Expand All @@ -646,6 +647,7 @@ func (cr *PerconaServerMySQL) CheckNSetDefaults(ctx context.Context, serverVersi

if cr.RouterEnabled() && !cr.Spec.AllowUnsafeConfig {
if cr.Spec.Proxy.Router.Size < MinSafeProxySize {
log.Info("Setting safe defaults, updating Router size", "oldSize", cr.Spec.Proxy.Router.Size, "newSafeSize", MinSafeProxySize)
cr.Spec.Proxy.Router.Size = MinSafeProxySize
}
}
Expand All @@ -656,6 +658,7 @@ func (cr *PerconaServerMySQL) CheckNSetDefaults(ctx context.Context, serverVersi

if cr.HAProxyEnabled() && !cr.Spec.AllowUnsafeConfig {
if cr.Spec.Proxy.HAProxy.Size < MinSafeProxySize {
log.Info("Setting safe defaults, updating HAProxy size", "oldSize", cr.Spec.Proxy.HAProxy.Size, "newSafeSize", MinSafeProxySize)
cr.Spec.Proxy.HAProxy.Size = MinSafeProxySize
}
}
Expand Down

0 comments on commit b292362

Please sign in to comment.