Skip to content

Commit dd27927

Browse files
use shorter name for kind clusters
1 parent 44b9a71 commit dd27927

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

internal/controller/cluster_controller.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ func (r *ClusterReconciler) handleCreateOrUpdate(ctx context.Context, cluster *c
151151
Status: metav1.ConditionTrue,
152152
Reason: "ClusterExists",
153153
})
154+
// TODO: Add kind cluster name to status
154155

155156
kubeconfig, err := r.Provider.KubeConfig(name, runsOnLocalHost())
156157
if err != nil {
@@ -226,14 +227,7 @@ func (r *ClusterReconciler) assignSubnet(ctx context.Context, cluster *clustersv
226227
}
227228

228229
func kindName(cluster *clustersv1alpha1.Cluster) string {
229-
return fmt.Sprintf("%s.%s", namespaceOrDefault(cluster.Namespace), cluster.Name)
230-
}
231-
232-
func namespaceOrDefault(namespace string) string {
233-
if namespace == "" {
234-
return metav1.NamespaceDefault
235-
}
236-
return namespace
230+
return fmt.Sprintf("%s.%s", cluster.Name, string(cluster.UID)[:8])
237231
}
238232

239233
func isClusterProviderResponsible(cluster *clustersv1alpha1.Cluster) bool {

0 commit comments

Comments
 (0)