Skip to content

Commit 07c50b1

Browse files
committed
pkg/cvo: Respect empty desired log level
A desired log level in the ClusterVersionOperator object can have an empty string value. Respect it, and treat it as the Normal level.
1 parent c4d7cd3 commit 07c50b1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/cvo/configuration/configuration.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,12 @@ func (config *ClusterVersionOperatorConfiguration) sync(ctx context.Context, des
141141
return fmt.Errorf("failed to update the ClusterVersionOperator resource: %w", err)
142142
}
143143
}
144-
config.desiredLogLevel = desiredConfig.Spec.OperatorLogLevel
144+
145145
config.lastObservedGeneration = desiredConfig.Generation
146+
config.desiredLogLevel = desiredConfig.Spec.OperatorLogLevel
147+
if config.desiredLogLevel == "" {
148+
config.desiredLogLevel = operatorv1.Normal
149+
}
146150

147151
currentLogLevel, notFound := loglevel.GetLogLevel()
148152
if notFound {

0 commit comments

Comments
 (0)