Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sbueringer committed Sep 18, 2023
1 parent b08a5e6 commit 7113943
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions controllers/vspherecluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,11 @@ func AddClusterControllerToManager(ctx context.Context, controllerManagerCtx *ca
var (
clusterControlledTypeName = reflect.TypeOf(clusterControlledType).Elem().Name()
clusterControlledTypeGVK = infrav1.GroupVersion.WithKind(clusterControlledTypeName)
controllerNameShort = strings.ToLower(clusterControlledTypeName)
controllerNameLong = fmt.Sprintf("%s/%s/%s", controllerManagerCtx.Namespace, controllerManagerCtx.Name, controllerNameShort)
controllerNameLong = fmt.Sprintf("%s/%s/%s", controllerManagerCtx.Namespace, controllerManagerCtx.Name, strings.ToLower(clusterControlledTypeName))
)
if supervisorBased {
clusterControlledTypeGVK = vmwarev1.GroupVersion.WithKind(clusterControlledTypeName)
controllerNameShort = fmt.Sprintf("%s-supervisor-controller", strings.ToLower(clusterControlledTypeName))
controllerNameLong = fmt.Sprintf("%s/%s/%s", controllerManagerCtx.Namespace, controllerManagerCtx.Name, controllerNameShort)
controllerNameLong = fmt.Sprintf("%s/%s/%s", controllerManagerCtx.Namespace, controllerManagerCtx.Name, strings.ToLower(clusterControlledTypeName))
}

if supervisorBased {
Expand All @@ -92,7 +90,6 @@ func AddClusterControllerToManager(ctx context.Context, controllerManagerCtx *ca
NetworkProvider: networkProvider,
}
return ctrl.NewControllerManagedBy(mgr).
Named(controllerNameShort).
For(clusterControlledType).
WithOptions(options).
Watches(
Expand All @@ -110,7 +107,6 @@ func AddClusterControllerToManager(ctx context.Context, controllerManagerCtx *ca
}
clusterToInfraFn := clusterToInfrastructureMapFunc(ctx, controllerManagerCtx)
c, err := ctrl.NewControllerManagedBy(mgr).
Named(controllerNameShort).
// Watch the controlled, infrastructure resource.
For(clusterControlledType).
WithOptions(options).
Expand Down

0 comments on commit 7113943

Please sign in to comment.