-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🌱 CAPD Machines now reports status.addresses
#3250
🌱 CAPD Machines now reports status.addresses
#3250
Conversation
121e31e
to
f9dd724
Compare
Some initial testing:
|
f9dd724
to
5cbe5d3
Compare
/retest |
/assign @ncdc |
@@ -277,6 +277,28 @@ func (r *DockerMachineReconciler) reconcileNormal(ctx context.Context, machine * | |||
dockerMachine.Status.Ready = true | |||
conditions.MarkTrue(dockerMachine, infrav1.ContainerProvisionedCondition) | |||
|
|||
// set address in machine status |
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.
the code for reconciling network addresses (L280-301) should go before the block of code that reconcile ProviderID (L267-268), otherwise, in case of errors the network won't be set due to the test at L172
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.
fixed
// set address in machine status | ||
machineAddress, err := externalMachine.Address() | ||
if err != nil { | ||
r.Log.Error(err, "failed to patch the Kubernetes node with the machine address") |
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.
r.Log.Error(err, "failed to patch the Kubernetes node with the machine address") | |
r.Log.Error(err, "failed to get the machine address") |
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.
fixed
@@ -104,6 +104,15 @@ func (m *Machine) ProviderID() string { | |||
return fmt.Sprintf("docker:////%s", m.ContainerName()) | |||
} | |||
|
|||
func (m *Machine) Address() (string, error) { | |||
ipv4, _, err := m.container.IP(context.TODO()) |
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.
We do have a context in the calling function that you could pass through - want to do that instead of using TODO 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.
yeah good catch
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.
updated
5cbe5d3
to
4250835
Compare
Signed-off-by: Andrew Sy Kim <[email protected]>
4250835
to
bebff1b
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ncdc 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 |
/retest |
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.
/milestone v0.3.7
/retitle 🌱 CAPD Machines now report status.addresses
status.addresses
status.addresses
status.addresses
Signed-off-by: Andrew Sy Kim [email protected]
What this PR does / why we need it:
Adds machine addresses to DockerMachine
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #