mirror of
https://github.com/rancher/k3k.git
synced 2026-03-02 17:50:36 +00:00
Compare commits
1 Commits
v0.1.1-rc1
...
v0.1.1-rc2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3cdcb04e1a |
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
"github.com/rancher/k3k/cli/cmds"
|
||||
"github.com/rancher/k3k/pkg/apis/k3k.io/v1alpha1"
|
||||
"github.com/rancher/k3k/pkg/controller/cluster"
|
||||
"github.com/rancher/k3k/pkg/controller/cluster/server"
|
||||
"github.com/rancher/k3k/pkg/controller/util"
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -210,6 +211,9 @@ func validateCreateFlags(clx *cli.Context) error {
|
||||
if name == "" {
|
||||
return errors.New("empty cluster name")
|
||||
}
|
||||
if name == cluster.ClusterInvalidName {
|
||||
return errors.New("invalid cluster name")
|
||||
}
|
||||
if servers <= 0 {
|
||||
return errors.New("invalid number of servers")
|
||||
}
|
||||
|
||||
@@ -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