-
Notifications
You must be signed in to change notification settings - Fork 91
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
Conversation
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
/test-v1a4-integration |
/cc @fmuyassarov |
/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) |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this 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.
[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 |
/lgtm |
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