mirror of
https://github.com/rancher/k3k.git
synced 2026-03-05 19:22:12 +00:00
Add validation for system cluster name for both controller and cli (#81)
* Add validation for system cluster name for both controller and cli Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * Add validation for system cluster name for both controller and cli Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> * Add validation for system cluster name for both controller and cli Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com> --------- Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
This commit is contained in:
@@ -40,6 +40,7 @@ const (
|
||||
clusterController = "k3k-cluster-controller"
|
||||
clusterFinalizerName = "cluster.k3k.io/finalizer"
|
||||
etcdPodFinalizerName = "etcdpod.k3k.io/finalizer"
|
||||
ClusterInvalidName = "system"
|
||||
|
||||
maxConcurrentReconciles = 1
|
||||
|
||||
@@ -178,6 +179,10 @@ func (c *ClusterReconciler) Reconcile(ctx context.Context, req reconcile.Request
|
||||
}
|
||||
|
||||
func (c *ClusterReconciler) createCluster(ctx context.Context, cluster *v1alpha1.Cluster) error {
|
||||
if cluster.Name == ClusterInvalidName {
|
||||
klog.Errorf("Invalid cluster name %s, no action will be taken", cluster.Name)
|
||||
return nil
|
||||
}
|
||||
s := server.New(cluster, c.Client)
|
||||
|
||||
if cluster.Spec.Persistence != nil {
|
||||
|
||||
Reference in New Issue
Block a user