Skip to content
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

Bug 2032565: makes config drift monitor aware of compressed files #2874

Conversation

cheesesashimi
Copy link
Member

The Config Drift Monitor (#2795) was previously unaware of compressed files. What would happen is the MCD would unzip a compressed file payload and write that to disk. However, the Config Drift Monitor was unaware that the file was compressed, so it was comparing the compressed contents of the MachineConfig against the uncompressed contents that were written to disk. Because of that, the Config Drift Monitor would erroneously degrade the node / MCP.

Fixes: #2032565

- What I did

I made the Config Drift Monitor aware of compressed files by replacing the calls to dataurl.DecodeBytes with a call to decodeContents which is aware of compressed files.

- How to verify it

  1. On a freshly provisioned test cluster, create a MachineConfig which defines a compressed file, e.g.:
cat << EOF | oc create -f -
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
  labels:
    machineconfiguration.openshift.io/role: worker
  name: gzip-compression-test-mc
spec:
  config:
    ignition:
      version: 3.2.0
    storage:
      files:
      - contents:
          compression: gzip
          source: data:;base64,H4sIAAAAAAACAzWQQW5DMQhE9/8Uc4Aop2h33fYA1CYpko0dA1GOX9zf7owwM/PmYyzukGnRUUcbCyYO6uwXlKHGxdljgapMsSJ6BzfJpXHNg4MlrI8K5z7zWLRIlRrqCEejr5QH+ynN6HRXAjV5BF2BTz9Ypac4uuzHM0fqFzxCDDrMV1Twi1cRJ5ehiNaol3FKix0qJtvqV1NmfgZTJu8ZapwE6eVp9rY1KZwhKzLLSSt6LJ6Lv1krr0QXxXO0mOnHmSdZwWaMIq39d5RIgVvchfzQnQiTVg6x0uf9VXg6x24yaxilEBdylJhSKWUTTDHXkMrql8N2Welaok3a5Bi3mxQhVDZee9tH2zloVyRZiP1VG/16/ACjjAk6wQEAAA==
        path: /etc/test-file
EOF
  1. Verify the config is successfully applied to all nodes in the Machine Config Pool and no nodes are degraded.

Also, the e2e and unit test suite both include additional test cases which reproduce the issue.

- Description for the changelog
Makes Config Drift Monitor aware of compressed files

@cheesesashimi cheesesashimi force-pushed the zzlotnik/config-drift-compressed-files branch 2 times, most recently from 865a188 to c227500 Compare December 14, 2021 22:22
Copy link
Contributor

@yuqi-zhang yuqi-zhang left a comment

Choose a reason for hiding this comment

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

First pass looks good, thanks for the added tests!

/assign mkenigs who implemented the compressed write

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 14, 2021
pkg/daemon/config_drift_monitor_test.go Outdated Show resolved Hide resolved
pkg/daemon/config_drift_monitor_test.go Show resolved Hide resolved
pkg/daemon/config_drift_monitor_test.go Outdated Show resolved Hide resolved
pkg/daemon/config_drift_monitor_test.go Show resolved Hide resolved
pkg/daemon/on_disk_validation.go Outdated Show resolved Hide resolved
pkg/daemon/on_disk_validation.go Outdated Show resolved Hide resolved
The Config Drift Monitor
(openshift#2795) was
previously unaware of compressed files. What would happen is the MCD
would unzip a compressed file payload and write that to disk. However,
the Config Drift Monitor was unaware that the file was compressed, so it
was comparing the compressed contents of the MachineConfig against the
uncompressed contents that were written to disk. Because of that, the
Config Drift Monitor would erroneously degrade the node / MCP.

Fixes: #2032565
@cheesesashimi cheesesashimi force-pushed the zzlotnik/config-drift-compressed-files branch from c227500 to ebf6c4e Compare December 15, 2021 14:48
@cheesesashimi
Copy link
Member Author

/retest-required

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 15, 2021

@cheesesashimi: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-single-node ebf6c4e link false /test e2e-aws-single-node
ci/prow/okd-e2e-aws ebf6c4e link false /test okd-e2e-aws
ci/prow/e2e-agnostic-upgrade ebf6c4e link true /test e2e-agnostic-upgrade
ci/prow/e2e-aws-upgrade-single-node ebf6c4e link false /test e2e-aws-upgrade-single-node
ci/prow/e2e-aws-serial ebf6c4e link false /test e2e-aws-serial
ci/prow/e2e-aws-disruptive ebf6c4e link false /test e2e-aws-disruptive
ci/prow/e2e-vsphere-upgrade ebf6c4e link false /test e2e-vsphere-upgrade
ci/prow/e2e-aws-workers-rhel7 ebf6c4e link false /test e2e-aws-workers-rhel7

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@mkenigs
Copy link
Contributor

mkenigs commented Dec 16, 2021

LGTM, should I actually merge it?

@sinnykumari
Copy link
Contributor

LGTM, should I actually merge it?

You can provide lgtm label by saying /lgtm .
We don't manually merge the PR, it will be done by bot when it meets all the criteria mentioned in tide.

@mkenigs
Copy link
Contributor

mkenigs commented Dec 16, 2021

Yeah I just meant should I label it lgtm - haven't actually done that before and can't say I fully trust myself for reviews yet

@sinnykumari
Copy link
Contributor

Yeah I just meant should I label it lgtm - haven't actually done that before and can't say I fully trust myself for reviews yet

There is always first time. We all miss sometimes something and try to learn from it and be better next time :)
It will be fine unless you are reviewing something without having any context of what PR is for.

@sinnykumari sinnykumari changed the title makes config drift monitor aware of compressed files Bug 2032565: makes config drift monitor aware of compressed files Dec 16, 2021
@openshift-ci openshift-ci bot added the bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. label Dec 16, 2021
@mkenigs
Copy link
Contributor

mkenigs commented Dec 16, 2021

Ok sounds good thanks!
/lgtm

@sinnykumari
Copy link
Contributor

/bugzilla refresh

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2021

@sinnykumari: This pull request references Bugzilla bug 2032565, which is invalid:

  • expected the bug to target the "4.10.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Dec 16, 2021
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheesesashimi, mkenigs, yuqi-zhang

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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2021

@cheesesashimi: This pull request references Bugzilla bug 2032565, which is invalid:

  • expected the bug to target the "4.10.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 2032565: makes config drift monitor aware of compressed files

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sinnykumari
Copy link
Contributor

/bugzilla refresh

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2021

@sinnykumari: An error was encountered querying GitHub for users with public email (sregidor@redhat.com) for bug 2032565 on the Bugzilla server at https://bugzilla.redhat.com. No known errors were detected, please see the full error message for details.

Full error message. non-200 OK status code: 403 Forbidden body: "{\n \"documentation_url\": \"https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits\",\n \"message\": \"You have exceeded a secondary rate limit. Please wait a few minutes before you try again.\"\n}\n"

Please contact an administrator to resolve this issue, then request a bug refresh with /bugzilla refresh.

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sinnykumari
Copy link
Contributor

ugh, retrying
/bugzilla refresh

@openshift-ci openshift-ci bot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Dec 16, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2021

@sinnykumari: This pull request references Bugzilla bug 2032565, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.10.0) matches configured target release for branch (4.10.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @sergiordlr

In response to this:

ugh, retrying
/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot removed the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Dec 16, 2021
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

11 similar comments
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 21c26e7 into openshift:master Dec 17, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 17, 2021

@cheesesashimi: All pull requests linked via external trackers have merged:

Bugzilla bug 2032565 has been moved to the MODIFIED state.

In response to this:

Bug 2032565: makes config drift monitor aware of compressed files

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@cheesesashimi cheesesashimi deleted the zzlotnik/config-drift-compressed-files branch March 21, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants