Skip to content

Commit 16a0e2d

Browse files
hexchenprometherion
authored andcommittedApr 22, 2024·
fix: patchCluster not working on vsphere
Signed-off-by: Hex Sattler <hex.sattler@wobcom.de>
1 parent b2de6d8 commit 16a0e2d

2 files changed

+3
-3
lines changed
 

‎controllers/kamajicontrolplane_controller_cluster_patch.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (r *KamajiControlPlaneReconciler) patchCluster(ctx context.Context, cluster
6060

6161
func (r *KamajiControlPlaneReconciler) checkOrPatchVSphereCluster(ctx context.Context, cluster capiv1beta1.Cluster, endpoint string, port int64) error {
6262
if err := r.checkGenericCluster(ctx, cluster, endpoint, port); err != nil {
63-
if errors.Is(err, UnmanagedControlPlaneAddressError{}) {
63+
if errors.As(err, &UnmanagedControlPlaneAddressError{}) {
6464
return r.patchGenericCluster(ctx, cluster, endpoint, port, false)
6565
}
6666

@@ -134,7 +134,7 @@ func (r *KamajiControlPlaneReconciler) checkGenericCluster(ctx context.Context,
134134
cpHost, cpPort := controlPlaneEndpoint["host"].(string), controlPlaneEndpoint["port"].(int64) //nolint:forcetypeassert
135135

136136
if len(cpHost) == 0 && cpPort == 0 {
137-
return NewUnmanagedControlPlaneAddressError(gkc.GetKind())
137+
return *NewUnmanagedControlPlaneAddressError(gkc.GetKind())
138138
}
139139

140140
if cpHost != endpoint {

‎controllers/kamajicontrolplane_controller_cluster_patch_errors.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ func NewUnmanagedControlPlaneAddressError(kind string) *UnmanagedControlPlaneAdd
1616
}
1717

1818
func (u UnmanagedControlPlaneAddressError) Error() string {
19-
return fmt.Sprintf("the %s resource is not managaing directly the Control Plane address", u.Kind)
19+
return fmt.Sprintf("the %s resource is not directly managing the Control Plane address", u.Kind)
2020
}

0 commit comments

Comments
 (0)
Please sign in to comment.