Skip to content

Commit

Permalink
More comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziopandini committed Apr 19, 2024
1 parent 977c855 commit c7fbc49
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,17 @@ func main() {
govmomiGVR := infrav1.GroupVersion.WithResource(reflect.TypeOf(&infrav1.VSphereCluster{}).Elem().Name())
supervisorGVR := vmwarev1.GroupVersion.WithResource(reflect.TypeOf(&vmwarev1.VSphereCluster{}).Elem().Name())

var isSupervisorCRDLoaded, isGovimoniCRDLoaded bool
var isSupervisorCRDLoaded, isGovmoniCRDLoaded bool
if err := wait.PollUntilContextTimeout(ctx, 5*time.Second, 30*time.Second, true, func(_ context.Context) (bool, error) {
var errGovimomi, errSupervisor error

// Check for non-supervisor VSphereCluster and start controller if found
isGovimoniCRDLoaded, errGovimomi = isCRDDeployed(mgr, govmomiGVR)
isGovmoniCRDLoaded, errGovimomi = isCRDDeployed(mgr, govmomiGVR)

// Check for supervisor VSphereCluster and start controller if found
isSupervisorCRDLoaded, errSupervisor = isCRDDeployed(mgr, supervisorGVR)

if (isGovimoniCRDLoaded && errGovimomi == nil) || (isSupervisorCRDLoaded && errSupervisor == nil) {
if (isGovmoniCRDLoaded && errGovimomi == nil) || (isSupervisorCRDLoaded && errSupervisor == nil) {
return true, nil
}
return false, nil
Expand All @@ -291,11 +291,11 @@ func main() {
}

// Continuing startup does not make sense without having managers added.
if !isSupervisorCRDLoaded && !isGovimoniCRDLoaded {
return errors.New("neither supervisor nor govimomi CRDs detected")
if !isSupervisorCRDLoaded && !isGovmoniCRDLoaded {
return errors.New("neither supervisor nor govmomi CRDs detected")
}

if isGovimoniCRDLoaded {
if isGovmoniCRDLoaded {
if err := setupVAPIControllers(ctx, controllerCtx, mgr, tracker); err != nil {
return fmt.Errorf("setupVAPIControllers: %w", err)
}
Expand Down

0 comments on commit c7fbc49

Please sign in to comment.