Skip to content

Commit 784c15e

Browse files
committed
Log all non-default fields when updating config
Log the setting for workspace.cleanupOnStop and workspace.progressTimeout when they are set to non-default values. For now, we don't log .workspace.podSecurityContext as it's not simple to detect non-default values there. Signed-off-by: Angel Misevski <[email protected]>
1 parent c24f04e commit 784c15e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/config/sync.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ func GetCurrentConfigString(currConfig *controller.OperatorConfiguration) string
314314
}
315315
workspace := currConfig.Workspace
316316
if workspace != nil {
317+
// Don't include PodSecurityContext for now as it's less easy to compare
317318
if workspace.ImagePullPolicy != defaultConfig.Workspace.ImagePullPolicy {
318319
config = append(config, fmt.Sprintf("workspace.imagePullPolicy=%s", workspace.ImagePullPolicy))
319320
}
@@ -326,10 +327,16 @@ func GetCurrentConfigString(currConfig *controller.OperatorConfiguration) string
326327
if workspace.IdleTimeout != defaultConfig.Workspace.IdleTimeout {
327328
config = append(config, fmt.Sprintf("workspace.idleTimeout=%s", workspace.IdleTimeout))
328329
}
330+
if workspace.ProgressTimeout != "" && workspace.ProgressTimeout != defaultConfig.Workspace.ProgressTimeout {
331+
config = append(config, fmt.Sprintf("workspace.progressTimeout=%s", workspace.ProgressTimeout))
332+
}
329333
if workspace.IgnoredUnrecoverableEvents != nil {
330334
config = append(config, fmt.Sprintf("workspace.ignoredUnrecoverableEvents=%s",
331335
strings.Join(workspace.IgnoredUnrecoverableEvents, ";")))
332336
}
337+
if workspace.CleanupOnStop != nil && *workspace.CleanupOnStop != *defaultConfig.Workspace.CleanupOnStop {
338+
config = append(config, fmt.Sprintf("workspace.cleanupOnStop=%t", *workspace.CleanupOnStop))
339+
}
333340
if workspace.DefaultStorageSize != nil {
334341
if workspace.DefaultStorageSize.Common != nil && workspace.DefaultStorageSize.Common.String() != defaultConfig.Workspace.DefaultStorageSize.Common.String() {
335342
config = append(config, fmt.Sprintf("workspace.defaultStorageSize.common=%s", workspace.DefaultStorageSize.Common.String()))

0 commit comments

Comments
 (0)