Skip to content

Commit

Permalink
Move addons and localhelm under workloads
Browse files Browse the repository at this point in the history
Signed-off-by: Artiom Diomin <[email protected]>
  • Loading branch information
kron4eg committed May 22, 2024
1 parent e240d4f commit 6c2aa61
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/kubeone/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (

"github.com/Masterminds/semver/v3"

"k8c.io/kubeone/pkg/addons"
kubeoneapi "k8c.io/kubeone/pkg/apis/kubeone"
"k8c.io/kubeone/pkg/semverutil"
"k8c.io/kubeone/pkg/workloads/addons"

"k8s.io/apimachinery/pkg/util/validation"
"k8s.io/apimachinery/pkg/util/validation/field"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/pflag"

"k8c.io/kubeone/pkg/addons"
"k8c.io/kubeone/pkg/workloads/addons"
)

func addonsCmd(rootFlags *pflag.FlagSet) *cobra.Command {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/pflag"

"k8c.io/kubeone/pkg/addons"
kubeoneapi "k8c.io/kubeone/pkg/apis/kubeone"
"k8c.io/kubeone/pkg/apis/kubeone/config"
kubeonev1beta2 "k8c.io/kubeone/pkg/apis/kubeone/v1beta2"
kubeonevalidation "k8c.io/kubeone/pkg/apis/kubeone/validation"
"k8c.io/kubeone/pkg/executor"
"k8c.io/kubeone/pkg/fail"
"k8c.io/kubeone/pkg/state"
"k8c.io/kubeone/pkg/workloads/addons"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
8 changes: 3 additions & 5 deletions pkg/cmd/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,18 @@ import (
"github.com/spf13/pflag"
"golang.org/x/term"

"k8c.io/kubeone/pkg/addons"
kubeoneapi "k8c.io/kubeone/pkg/apis/kubeone"
"k8c.io/kubeone/pkg/apis/kubeone/config"
"k8c.io/kubeone/pkg/credentials"
"k8c.io/kubeone/pkg/fail"
"k8c.io/kubeone/pkg/state"
"k8c.io/kubeone/pkg/workloads/addons"

"k8s.io/apimachinery/pkg/util/sets"
ctrlruntimelog "sigs.k8s.io/controller-runtime/pkg/log"
)

var (
defaultKubeVersion = ""
)
var defaultKubeVersion = ""

const yes = "yes"

Expand Down Expand Up @@ -248,7 +246,7 @@ func initBackup(backupPath string) error {
}

// try to write to the file before doing anything else
backup, err := os.OpenFile(backupPath, os.O_RDWR|os.O_CREATE, 0600)
backup, err := os.OpenFile(backupPath, os.O_RDWR|os.O_CREATE, 0o600)
if err != nil {
return fail.Runtime(err, "opening backup file for write")
}
Expand Down
8 changes: 6 additions & 2 deletions pkg/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ limitations under the License.
package tasks

import (
"k8c.io/kubeone/pkg/addons"
"k8c.io/kubeone/pkg/certificate"
"k8c.io/kubeone/pkg/clusterstatus"
"k8c.io/kubeone/pkg/credentials"
"k8c.io/kubeone/pkg/fail"
"k8c.io/kubeone/pkg/features"
"k8c.io/kubeone/pkg/kubeconfig"
"k8c.io/kubeone/pkg/localhelm"
"k8c.io/kubeone/pkg/state"
"k8c.io/kubeone/pkg/templates/externalccm"
"k8c.io/kubeone/pkg/templates/machinecontroller"
"k8c.io/kubeone/pkg/templates/operatingsystemmanager"
"k8c.io/kubeone/pkg/workloads/addons"
"k8c.io/kubeone/pkg/workloads/localhelm"
)

type Tasks []Task
Expand Down Expand Up @@ -264,6 +264,10 @@ func WithResources(t Tasks) Tasks {
Operation: "applying addons",
Description: "ensure embedded addons",
},
{
Fn: nil,
Operation: "reconcile addons and helm releases",
},
{
Fn: addons.EnsureUserAddons,
Operation: "applying addons",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 6c2aa61

Please sign in to comment.