Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Jont828 committed Apr 25, 2023
1 parent 6ee4d9d commit 553215f
Showing 1 changed file with 21 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -390,27 +390,29 @@ func (r *DockerMachinePoolReconciler) CreateDockerMachinesIfNotExists(ctx contex
}

for _, instance := range instances {
if _, exists := instanceNameToDockerMachine[instance.InstanceName]; !exists {
labels := dockerMachinePool.Status.InfrastructureMachineSelector.MatchLabels
labels[clusterv1.MachinePoolNameLabel] = machinePool.Name
dockerMachine := &infrav1.DockerMachine{
ObjectMeta: metav1.ObjectMeta{
Namespace: dockerMachinePool.Namespace,
GenerateName: fmt.Sprintf("%s-", dockerMachinePool.Name),
Labels: labels,
Annotations: make(map[string]string),
// Note: This DockerMachine will be owned by the DockerMachinePool until the MachinePool controller creates its parent Machine.
},
Spec: infrav1.DockerMachineSpec{
InstanceName: instance.InstanceName,
},
}
if _, exists := instanceNameToDockerMachine[instance.InstanceName]; exists {
continue
}

log.V(2).Info("Instance name for dockerMachine is", "instanceName", instance.InstanceName, "dockerMachine", dockerMachine.Name)
labels := dockerMachinePool.Status.InfrastructureMachineSelector.MatchLabels
labels[clusterv1.MachinePoolNameLabel] = machinePool.Name
dockerMachine := &infrav1.DockerMachine{
ObjectMeta: metav1.ObjectMeta{
Namespace: dockerMachinePool.Namespace,
GenerateName: fmt.Sprintf("%s-", dockerMachinePool.Name),
Labels: labels,
Annotations: make(map[string]string),
// Note: This DockerMachine will be owned by the DockerMachinePool until the MachinePool controller creates its parent Machine.
},
Spec: infrav1.DockerMachineSpec{
InstanceName: instance.InstanceName,
},
}

if err := r.Client.Create(ctx, dockerMachine); err != nil {
return errors.Wrap(err, "failed to create dockerMachine")
}
log.V(2).Info("Instance name for dockerMachine is", "instanceName", instance.InstanceName, "dockerMachine", dockerMachine.Name)

if err := r.Client.Create(ctx, dockerMachine); err != nil {
return errors.Wrap(err, "failed to create dockerMachine")
}
}

Expand Down

0 comments on commit 553215f

Please sign in to comment.