Don't start node controller if coredns is not deployed

This commit is contained in:
Darren Shepherd 2020-01-22 10:57:21 -07:00
parent 3ff64baab8
commit bf57a7f419

View File

@ -27,6 +27,7 @@ import (
v1 "github.com/rancher/wrangler-api/pkg/generated/controllers/core/v1" v1 "github.com/rancher/wrangler-api/pkg/generated/controllers/core/v1"
"github.com/rancher/wrangler/pkg/leader" "github.com/rancher/wrangler/pkg/leader"
"github.com/rancher/wrangler/pkg/resolvehome" "github.com/rancher/wrangler/pkg/resolvehome"
"github.com/rancher/wrangler/pkg/slice"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/net"
@ -126,9 +127,11 @@ func startWrangler(ctx context.Context, config *Config) error {
} }
func masterControllers(ctx context.Context, sc *Context, config *Config) error { func masterControllers(ctx context.Context, sc *Context, config *Config) error {
if !slice.ContainsString(config.ControlConfig.Skips, "coredns") {
if err := node.Register(ctx, sc.Core.Core().V1().ConfigMap(), sc.Core.Core().V1().Node()); err != nil { if err := node.Register(ctx, sc.Core.Core().V1().ConfigMap(), sc.Core.Core().V1().Node()); err != nil {
return err return err
} }
}
helm.Register(ctx, sc.Apply, helm.Register(ctx, sc.Apply,
sc.Helm.Helm().V1().HelmChart(), sc.Helm.Helm().V1().HelmChart(),