Skip to content

Commit

Permalink
fix(controller): fix check for existing control plane endpoints in cl…
Browse files Browse the repository at this point in the history
…usters
  • Loading branch information
johannwagner authored Jul 12, 2024
1 parent 1ca4349 commit 05ce11c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion controllers/kamajicontrolplane_controller_cluster_patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ func (r *KamajiControlPlaneReconciler) checkGenericCluster(ctx context.Context,
return errors.Wrap(err, fmt.Sprintf("cannot retrieve the %s resource", gkc.GetKind()))
}

controlPlaneEndpoint := gkc.Object["spec"].(map[string]interface{})["controlPlaneEndpoint"].(map[string]interface{}) //nolint:forcetypeassert
controlPlaneEndpointUn := gkc.Object["spec"].(map[string]interface{})["controlPlaneEndpoint"] //nolint:forcetypeassert
if controlPlaneEndpointUn == nil {
return *NewUnmanagedControlPlaneAddressError(gkc.GetKind())
}

controlPlaneEndpoint := controlPlaneEndpointUn.(map[string]interface{}) //nolint:forcetypeassert

cpHost, cpPort := controlPlaneEndpoint["host"].(string), controlPlaneEndpoint["port"].(int64) //nolint:forcetypeassert

Expand Down

0 comments on commit 05ce11c

Please sign in to comment.