Skip to content

Log all non-default fields when updating config #924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2022

Conversation

amisevsk
Copy link
Collaborator

What does this PR do?

Log all non-default fields in config when updating config to avoid missing info. Previously, settings like cleanupOnStop and progressTimeout were ignored in the config log, which is confusing.

For now, we still don't log differences in workspace.podSecurityContext as it's not as simple to diff the structs.

This PR should probably not be merged before #918 to avoid an annoying merge conflict.

What issues does this PR fix or reference?

N/A, minor fixup

Is it tested? How?

Start DWO and set custom values for .config.workspace.cleanupOnStop and .config.workspace.progressTimeout

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

Copy link
Collaborator

@AObuchow AObuchow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
I resolved the conflicts locally (let me know if you want me to push the changes, for convenience).
I set the config's progressTimeout to 15m and set cleanupOnStop to true, and the following was (correctly) logged:

{
   "level":"info",
   "ts":1663032819.8720434,
   "logger":"operator-configuration",
   "msg":"Updated config to [routing.clusterHostSuffix=192.168.49.2.nip.io,workspace.progressTimeout=15m,workspace.cleanupOnStop=true]"
}

@openshift-ci
Copy link

openshift-ci bot commented Sep 13, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amisevsk, AObuchow, ibuziuk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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]>
@openshift-ci
Copy link

openshift-ci bot commented Sep 13, 2022

New changes are detected. LGTM label has been removed.

@amisevsk amisevsk merged commit 74683c4 into devfile:main Sep 13, 2022
@amisevsk amisevsk deleted the log-full-config branch September 13, 2022 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants