-
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
🌱 Add conditions to the DockerMachine object #3122
🌱 Add conditions to the DockerMachine object #3122
Conversation
test/infrastructure/docker/controllers/dockermachine_controller.go
Outdated
Show resolved
Hide resolved
test/infrastructure/docker/controllers/dockermachine_controller.go
Outdated
Show resolved
Hide resolved
a8c06b6
to
6f60bd3
Compare
test/infrastructure/docker/controllers/dockermachine_controller.go
Outdated
Show resolved
Hide resolved
@@ -209,34 +232,48 @@ func (r *DockerMachineReconciler) reconcileNormal(ctx context.Context, machine * | |||
dockerMachine.Status.LoadBalancerConfigured = true | |||
} | |||
|
|||
// At, this stage, we are ready for bootstrap. However, if the BootstrapExecSucceededCondition is missing we add it and we | |||
// requeue so the user can se the change of state before the bootstrap actually start. |
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.
Do we actually need to do this here? Most (if not all) other infrastructure providers do not have a differentiation between provisioning the infrastructure and bootstrapping since it is done through setting user data (or metadata) on the instance. We only have a distinction here because we are simulating cloud-init.
I think having the separate conditions for the individual steps for this bootstrap provider is beneficial for troubleshooting/debugging purposes, but I don't see any particular reason that we should force a requeue here just to enable external tooling to trigger on provisioning happening prior to bootstrapping occuring.
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.
You are right, the main reason for this is that it makes a nicer UX when working with CAPD, because this is where the docker-machine provisioning spends most of the time.
test/infrastructure/docker/controllers/dockermachine_controller.go
Outdated
Show resolved
Hide resolved
test/infrastructure/docker/controllers/dockermachine_controller.go
Outdated
Show resolved
Hide resolved
test/infrastructure/docker/controllers/dockermachine_controller.go
Outdated
Show resolved
Hide resolved
test/infrastructure/docker/controllers/dockermachine_controller.go
Outdated
Show resolved
Hide resolved
test/infrastructure/docker/controllers/dockermachine_controller.go
Outdated
Show resolved
Hide resolved
test/infrastructure/docker/controllers/dockermachine_controller.go
Outdated
Show resolved
Hide resolved
/retitle 🏃 Add conditions to the DockerMachine object |
/retitle 🌱 Add conditions to the DockerMachine object |
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.
/approve
/assign @detiber
/milestone v0.3.7
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini, vincepri 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 |
I'm going to remove ImageLoaded flag... |
@detiber flag removed (last commit) |
lgtm pending squash |
8559e7a
to
166e106
Compare
@detiber re-based |
LGTM |
} | ||
|
||
timeoutctx, cancel := context.WithTimeout(ctx, 3*time.Minute) | ||
defer cancel() | ||
// Run the bootstrap script. Simulates cloud-init. | ||
if err := externalMachine.ExecBootstrap(timeoutctx, bootstrapData); err != nil { | ||
return ctrl.Result{}, errors.Wrap(err, "failed to exec DockerMachine bootstrap") | ||
conditions.MarkFalse(dockerMachine, infrav1.BootstrapExecSucceededCondition, infrav1.BootstrapFailedReason, clusterv1.ConditionSeverityWarning, "Repeating bootstrap") | ||
return ctrl.Result{RequeueAfter: 5 * time.Second}, errors.Wrap(err, "failed to exec DockerMachine bootstrap") |
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.
Just noticed that this is setting both RequeueAfter and returning an error, the RequeueAfter will be ignored.
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
166e106
to
48f2010
Compare
@detiber PTAL |
/lgtm |
What this PR does / why we need it:
This PR adds conditions to the DockerMachine object
Which issue(s) this PR fixes:
Fixes #3111