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

🐛 Use patch helper to update BMH #80

Merged
merged 1 commit into from
May 28, 2020

Conversation

maelk
Copy link
Member

@maelk maelk commented May 26, 2020

What this PR does / why we need it:
Using the updateObject function was triggering an infinite loop,
as the metal3machine were reconciled when BMH were updated and
the reconciliation was always updating the BMH

Which issue(s) this PR fixes:
Fixes #79

@metal3-io-bot metal3-io-bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 26, 2020
Using the updateObject function was triggering an infinite loop,
as the metal3machine were reconciled when BMH were updated and
the reconciliation was always updating the BMH
@metal3-io-bot metal3-io-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 26, 2020
@maelk
Copy link
Member Author

maelk commented May 26, 2020

/test-v1a4-integration

@maelk
Copy link
Member Author

maelk commented May 26, 2020

/cc @fmuyassarov
/cc @kashifest
/cc @Jaakko-Os

@metal3-io-bot metal3-io-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 26, 2020
@maelk
Copy link
Member Author

maelk commented May 26, 2020

/test-v1a4-integration

}

// GetBaremetalHostID return the provider identifier for this machine
func (m *MachineManager) GetBaremetalHostID(ctx context.Context) (*string, error) {
// look for associated BMH
host, err := m.getHost(ctx)
host, _, err := m.getHost(ctx)
Copy link
Member

Choose a reason for hiding this comment

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

is blank identifier replacing helper ?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, because helper is unused here

func (m *MachineManager) getHost(ctx context.Context) (*bmh.BareMetalHost, error) {
return getHost(ctx, m.Metal3Machine, m.client, m.Log)
func (m *MachineManager) getHost(ctx context.Context) (*bmh.BareMetalHost, *patch.Helper, error) {
host, err := getHost(ctx, m.Metal3Machine, m.client, m.Log)
Copy link
Member

Choose a reason for hiding this comment

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

why m.Log is needed here?

Copy link
Member Author

Choose a reason for hiding this comment

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

because getHost function uses it to log some messages

Copy link
Contributor

@jan-est jan-est left a comment

Choose a reason for hiding this comment

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

Nothing to add on this one.

@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jan-est, maelk

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

@jan-est
Copy link
Contributor

jan-est commented May 28, 2020

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label May 28, 2020
@metal3-io-bot metal3-io-bot merged commit 64f232c into metal3-io:master May 28, 2020
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. lgtm Indicates that a PR is ready to be merged. 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.

Infinite reconciliation loop when waiting for provisioning
4 participants