Skip to content

Commit 184b000

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 d342380 commit 184b000

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
@@ -275,6 +275,7 @@ func logCurrentConfig() {
275275
}
276276
}
277277
if Workspace != nil {
278+
// Don't include PodSecurityContext for now as it's less easy to compare
278279
if Workspace.ImagePullPolicy != defaultConfig.Workspace.ImagePullPolicy {
279280
config = append(config, fmt.Sprintf("workspace.imagePullPolicy=%s", Workspace.ImagePullPolicy))
280281
}
@@ -287,10 +288,16 @@ func logCurrentConfig() {
287288
if Workspace.IdleTimeout != defaultConfig.Workspace.IdleTimeout {
288289
config = append(config, fmt.Sprintf("workspace.idleTimeout=%s", Workspace.IdleTimeout))
289290
}
291+
if Workspace.ProgressTimeout != "" && Workspace.ProgressTimeout != defaultConfig.Workspace.ProgressTimeout {
292+
config = append(config, fmt.Sprintf("workspace.progressTimeout=%s", Workspace.ProgressTimeout))
293+
}
290294
if Workspace.IgnoredUnrecoverableEvents != nil {
291295
config = append(config, fmt.Sprintf("workspace.ignoredUnrecoverableEvents=%s",
292296
strings.Join(Workspace.IgnoredUnrecoverableEvents, ";")))
293297
}
298+
if Workspace.CleanupOnStop != nil && *Workspace.CleanupOnStop != *defaultConfig.Workspace.CleanupOnStop {
299+
config = append(config, fmt.Sprintf("workspace.cleanupOnStop=%t", *Workspace.CleanupOnStop))
300+
}
294301
if Workspace.DefaultStorageSize != nil {
295302
if Workspace.DefaultStorageSize.Common != nil {
296303
config = append(config, fmt.Sprintf("workspace.defaultStorageSize.common=%s", Workspace.DefaultStorageSize.Common.String()))

0 commit comments

Comments
 (0)