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 1809007: [ctrcfg controller] Use a struct array instead of map when creating new ignitions #1637

Merged
merged 1 commit into from Apr 11, 2020

Conversation

umohnani8
Copy link
Contributor

@umohnani8 umohnani8 commented Apr 9, 2020

Fixes #1809007 (https://bugzilla.redhat.com/show_bug.cgi?id=1809007)

Signed-off-by: Urvashi Mohnani umohnani@redhat.com

- What I did
A map doesn't guarantee order when we are creating new ignitions.
When we update the image CR with blocked registries, the ctrcfg
controller needs to update two files registries.conf and policy.json.
Since we get an update from the image CR about every 20 mins, we compare
the semantics to see if anything has changed. But since the order is not
guaranteed, the controller might think that the semantics is not equal
even if nothing in the data changed. Hence another MC is created, and
everytime we get an update the MC applied to the nodes keeps flipping
back and forth for the 2 possible orders causing the nodes to reboot a
bunch of times. So move to using a struct array to ensure the order is
always the same and we don't have two similar MCs being created.

- How to verify it
Update the image.config.openshift.io CR with blocked registries and watch to ensure
that 2 MCs are not created after a few mins or hours.

- Description for the changelog
Use a struct array instead of map when creating new ignitions for the container
runtime config controller.

@umohnani8
Copy link
Contributor Author

Will need to cherry-pick to 4.4. and 4.3 - I have cloned the bug for these.

A map doesn't guarantee order when we are creating new ignitions.
When we update the image CR with blocked registries, the ctrcfg
controller needs to update two files registries.conf and policy.json.
Since we get an update from the image CR about every 20 mins, we compare
the semantics to see if anything has changed. But since the order is not
guaranteed, the controller might think that the semantics is not equal
even if nothing in the data changed. Hence another MC is created, and
everytime we get an update the MC applied to the nodes keeps flipping
back and forth for the 2 possible orders causing the nodes to reboot a
bunch of times. So move to using a struct array to ensure the order is
always the same and we don't have two similar MCs being created.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
@umohnani8
Copy link
Contributor Author

Copy link
Contributor

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

LGTM.

@runcom runcom changed the title [ctrcfg controller] Use a struct array instead of map when creating new ignitions Bug 1809007: [ctrcfg controller] Use a struct array instead of map when creating new ignitions Apr 11, 2020
@openshift-ci-robot openshift-ci-robot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Apr 11, 2020
@openshift-ci-robot
Copy link
Contributor

@umohnani8: This pull request references Bugzilla bug 1809007, which is invalid:

  • expected the bug to target the "4.5.0" release, but it targets "4.4.0" 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 1809007: [ctrcfg controller] Use a struct array instead of map when creating new ignitions

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.

@runcom
Copy link
Member

runcom commented Apr 11, 2020

/lgtm
/approve

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: runcom, umohnani8

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-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 11, 2020
@runcom
Copy link
Member

runcom commented Apr 11, 2020

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Apr 11, 2020
@openshift-ci-robot
Copy link
Contributor

@runcom: This pull request references Bugzilla bug 1809007, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

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

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-robot openshift-ci-robot removed the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Apr 11, 2020
@openshift-bot
Copy link
Contributor

/retest

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

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-merge-robot openshift-merge-robot merged commit 37a6929 into openshift:master Apr 11, 2020
@openshift-ci-robot
Copy link
Contributor

@umohnani8: All pull requests linked via external trackers have merged: openshift/machine-config-operator#1637. Bugzilla bug 1809007 has been moved to the MODIFIED state.

In response to this:

Bug 1809007: [ctrcfg controller] Use a struct array instead of map when creating new ignitions

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.

@umohnani8
Copy link
Contributor Author

/cherry-pick release-4.4

@openshift-cherrypick-robot

@umohnani8: #1637 failed to apply on top of branch "release-4.4":

error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M	pkg/controller/container-runtime-config/container_runtime_config_controller.go
M	pkg/controller/container-runtime-config/helpers.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/controller/container-runtime-config/helpers.go
Auto-merging pkg/controller/container-runtime-config/container_runtime_config_controller.go
CONFLICT (content): Merge conflict in pkg/controller/container-runtime-config/container_runtime_config_controller.go
Patch failed at 0001 Use a struct array instead of map when creating new ignitions

In response to this:

/cherry-pick release-4.4

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.

@umohnani8
Copy link
Contributor Author

/cherry-pick release-4.3

@openshift-cherrypick-robot

@umohnani8: #1637 failed to apply on top of branch "release-4.3":

error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M	pkg/controller/container-runtime-config/container_runtime_config_controller.go
M	pkg/controller/container-runtime-config/helpers.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/controller/container-runtime-config/helpers.go
Auto-merging pkg/controller/container-runtime-config/container_runtime_config_controller.go
CONFLICT (content): Merge conflict in pkg/controller/container-runtime-config/container_runtime_config_controller.go
Patch failed at 0001 Use a struct array instead of map when creating new ignitions

In response to this:

/cherry-pick release-4.3

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.

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/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

7 participants