Skip to content

Prep commits for having the MCD process encapsulated MachineConfig#935

Closed
cgwalters wants to merge 3 commits intoopenshift:masterfrom
cgwalters:mcd-encap-mcd-prep
Closed

Prep commits for having the MCD process encapsulated MachineConfig#935
cgwalters wants to merge 3 commits intoopenshift:masterfrom
cgwalters:mcd-encap-mcd-prep

Conversation

@cgwalters
Copy link
Copy Markdown
Member

Prep commits for #904

cgwalters added 3 commits July 8, 2019 14:04
The `getStateAndConfigs()` function loads a bunch of data, might
as well have it load the pending config too rather than passing it
in.
Previously `getNodeAnnotation` read the initial annotations file,
and `getStateAndConfigs` also checked for its existence again.
Now we have a more clearly named `ensureNodeAnnotations` method
that's close to the other code handling the early state, and
it returns a `bool` denoting whether or not we found the initial
annotations file that's passed down into `getStateAndConfigs`.
So that function is now entirely about the config annotations,
and this extra random bit is outside of it.

And move down part of the comment to clarify the flow.
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 8, 2019
@cgwalters cgwalters changed the title Mcd encap mcd prep Prep commits for having the MCD process encapsulated MachineConfig Jul 8, 2019
Comment thread pkg/daemon/daemon.go
d, err := ioutil.ReadFile(constants.InitialNodeAnnotationsFilePath)
if err != nil && !os.IsNotExist(err) {
return false, fmt.Errorf("failed to read initial annotations from %q: %v", constants.InitialNodeAnnotationsFilePath, err)
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

super silly nit: shouldn't we return true from now on here? I'm just worried in the future we're gonna change the outer logic and might miss the bootstrap bool

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would that would apply for the json.Unmarshal and setNodeAnnotations(..., initial) error cases as well?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yes, from this point it should be safe to return true

@runcom
Copy link
Copy Markdown
Member

runcom commented Jul 8, 2019

/approve
/assign LorbusChris

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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

The pull request process is described here

Details 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

Comment thread pkg/daemon/update_test.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm still reluctant to remove a test however easy and straightforward it is...if someone messes up with the skipReboot if this was going to catch it

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

@runcom runcom Jul 8, 2019

Choose a reason for hiding this comment

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

yup, no blocking, was just pointing out my initial reaction when a test gets deleted

Comment thread pkg/daemon/update.go Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

note for next time (don't have to fix in this pr): can remove emptyMC declaration and just do oldConfig = &mcfgv1.MachineConfig{} directly

Comment thread pkg/daemon/daemon.go Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

why don't we update the cached copy dn.node = n like in the other case?

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 21, 2019
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@cgwalters: PR needs rebase.

Details

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.

Comment thread pkg/daemon/daemon.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just wondering, since this function is not utilizing Daemon struct anymore, is there a reason to keep it part of Daemon ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

not really, we can remove the object reference to Daemon as a cleanup

@sinnykumari
Copy link
Copy Markdown
Contributor

@cgwalters there are some conflict with latest master, can we get this PR rebased?

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@cgwalters: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws-disruptive 9023e28928bcc8e870b588de628f57f9a9749f9d link /test e2e-aws-disruptive
ci/prow/e2e-aws 72cb43d link /test e2e-aws
ci/prow/e2e-aws-scaleup-rhel7 72cb43d link /test e2e-aws-scaleup-rhel7
ci/prow/verify 72cb43d link /test verify
ci/prow/images 72cb43d link /test images
ci/prow/unit 72cb43d link /test unit
ci/prow/e2e-aws-op 72cb43d link /test e2e-aws-op
ci/prow/e2e-aws-upgrade 72cb43d link /test e2e-aws-upgrade

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

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.

@cgwalters
Copy link
Copy Markdown
Member Author

Eh, the reboot parts of this were merged, and there's been a lot of code churn since then that makes rebasing this tricky/painful. I'm just going to try putting everything in #904 instead.

@cgwalters cgwalters closed this Oct 7, 2019
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. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants