1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-05 08:50:13 +00:00

Fix include addons

This commit is contained in:
galal-hussein
2018-03-24 02:11:40 +02:00
parent 0751f86e85
commit fea23ca9f0

View File

@@ -8,14 +8,15 @@ import (
"os/exec" "os/exec"
"time" "time"
"io/ioutil"
"net/http"
"strings"
"github.com/rancher/rke/addons" "github.com/rancher/rke/addons"
"github.com/rancher/rke/k8s" "github.com/rancher/rke/k8s"
"github.com/rancher/rke/log" "github.com/rancher/rke/log"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"gopkg.in/yaml.v2" "gopkg.in/yaml.v2"
"io/ioutil"
"net/http"
"strings"
) )
const ( const (
@@ -42,21 +43,22 @@ func (c *Cluster) deployK8sAddOns(ctx context.Context) error {
} }
func (c *Cluster) deployUserAddOns(ctx context.Context) error { func (c *Cluster) deployUserAddOns(ctx context.Context) error {
log.Infof(ctx, "[addons] Setting up user addons..") log.Infof(ctx, "[addons] Setting up user addons")
if c.Addons == "" { if c.Addons != "" {
if err := c.deployAddonsInclude(ctx); err != nil {
return err
}
}
if err := c.doAddonDeploy(ctx, c.Addons, UserAddonResourceName); err != nil { if err := c.doAddonDeploy(ctx, c.Addons, UserAddonResourceName); err != nil {
return err return err
} }
}
if len(c.AddonsInclude) > 0 {
if err := c.deployAddonsInclude(ctx); err != nil { if err := c.deployAddonsInclude(ctx); err != nil {
return err return err
} }
log.Infof(ctx, "[addons] User addons deployed successfully..") }
if c.Addons == "" && len(c.AddonsInclude) == 0 {
log.Infof(ctx, "[addons] no user addons defined")
} else {
log.Infof(ctx, "[addons] User addons deployed successfully")
}
return nil return nil
} }