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:
@@ -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.doAddonDeploy(ctx, c.Addons, UserAddonResourceName); err != nil {
|
||||||
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if c.Addons == "" && len(c.AddonsInclude) == 0 {
|
||||||
if err := c.doAddonDeploy(ctx, c.Addons, UserAddonResourceName); err != nil {
|
log.Infof(ctx, "[addons] no user addons defined")
|
||||||
return err
|
} else {
|
||||||
|
log.Infof(ctx, "[addons] User addons deployed successfully")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := c.deployAddonsInclude(ctx); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
log.Infof(ctx, "[addons] User addons deployed successfully..")
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user