From 6c4914f6783157487318438a38ce99723015c366 Mon Sep 17 00:00:00 2001 From: Jacie Date: Wed, 23 Aug 2023 14:37:37 +0800 Subject: [PATCH] fix(add-on): change deploy add-on manifests to autok3s folder --- pkg/cluster/base.go | 4 ++++ pkg/common/common.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/cluster/base.go b/pkg/cluster/base.go index 57187e13..34e8448d 100644 --- a/pkg/cluster/base.go +++ b/pkg/cluster/base.go @@ -428,6 +428,10 @@ func (p *ProviderBase) InitCluster(options interface{}, deployPlugins func() []s } } + if _, err := p.execute(&c.MasterNodes[0], []string{fmt.Sprintf("mkdir -p %s", common.K3sManifestsDir)}...); err != nil { + return err + } + if deployPlugins != nil { // install additional manifests to the current cluster. extraManifests := deployPlugins() diff --git a/pkg/common/common.go b/pkg/common/common.go index 1aba6588..dc54a9d4 100644 --- a/pkg/common/common.go +++ b/pkg/common/common.go @@ -16,7 +16,7 @@ const ( // KubeCfgTempName default temp kube config file name prefix. KubeCfgTempName = "autok3s-temp-*" // K3sManifestsDir k3s manifests dir. - K3sManifestsDir = "/var/lib/rancher/k3s/server/manifests" + K3sManifestsDir = "/var/lib/rancher/k3s/server/manifests/autok3s" // MasterInstanceName master instance name. MasterInstanceName = "autok3s.%s.master" // WorkerInstanceName worker instance name.