Skip to content

Commit

Permalink
Merge pull request #16 from ksctl/15-enhancementmodules-need-to-updat…
Browse files Browse the repository at this point in the history
…e-the-gomod-files-and-also-any-references

feat(updates)!: refactoring the go.mod with ksctl/ksctl
  • Loading branch information
dipankardas011 authored Feb 18, 2024
2 parents 27d90e5 + d8af0d0 commit 1081db2
Show file tree
Hide file tree
Showing 22 changed files with 339 additions and 256 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ Add here

# Additional context
Add any other context about the problem here.
Check [Contribution's guidelines](https://kubesimplify.github.io/ksctl/docs/contributions)
Check [Contribution's guidelines](https://docs.ksctl.com/docs/contribution-guidelines/)
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/enhancement-proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ assignees: ''

## Additional context

Check [Contribution's guidelines](https://kubesimplify.github.io/ksctl/docs/contributions)
Check [Contribution's guidelines](https://docs.ksctl.com/docs/contribution-guidelines/)
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ assignees: ''
- Kubeadm

## Additional context
Check [Contribution's guidelines](https://kubesimplify.github.io/ksctl/docs/contributions)
Check [Contribution's guidelines](https://docs.ksctl.com/docs/contribution-guidelines/)
2 changes: 1 addition & 1 deletion .github/pull_request-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
<!--Add here-->

- [ ] Ran Tests locally
- [ ] Checked [Contribution's guidelines](https://kubesimplify.github.io/ksctl-docs/docs/contribution-guidelines/)
- [ ] Checked [Contribution's guidelines](https://docs.ksctl.com/docs/contribution-guidelines/)
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
The contents are moved to [docs](https://kubesimplify.github.io/ksctl/docs/contributions)
The contents are moved to [docs](https://docs.ksctl.com/docs/contribution-guidelines/)
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# ksctl-cli
ksctl cli repo
# Ksctl (CLI): Cloud Agnostic Kubernetes Management tool

[![Go Reference](https://pkg.go.dev/badge/github.com/kubesimplify/ksctl-cli.svg)](https://pkg.go.dev/github.com/kubesimplify/ksctl-cli)
![CoverPage Social Media](https://raw.githubusercontent.com/ksctl/ksctl/main/img/ksctl-cover.png)

source of ksctl core https://github.com/kubesimplify/ksctl
<h4 align="center">
<a href="https://discord.com/invite/kubesimplify">Discord</a> |
<a href="https://docs.ksctl.com/">Website</a><br/><br/>
<a href="https://docs.ksctl.com/docs/intro">Intro</a> |
<a href="https://docs.ksctl.com/docs/contributions">Contribute</a> |
<a href="https://docs.ksctl.com/docs/roadmap">Roadmap</a><br/><br/>
</h4>

[![Go Reference](https://pkg.go.dev/badge/github.com/ksctl/cli.svg)](https://pkg.go.dev/github.com/ksctl/cli)

source of ksctl core https://github.com/ksctl/ksctl
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

## Reporting a Vulnerability

Check [contribution guide](./CONTRIBUTING.md) and also [website contribution page](https://kubesimplify.github.io/ksctl/docs/contributions)
Check [contribution guide](./CONTRIBUTING.md) and also [website contribution page](https://docs.ksctl.com/docs/contribution-guidelines/)
13 changes: 8 additions & 5 deletions cli/cmd/addNodesHAAzure.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ package cmd
// authors Dipankar <dipankar@dipankar-das.com>

import (
"context"
"github.com/ksctl/ksctl/pkg/helpers"
"os"

control_pkg "github.com/kubesimplify/ksctl/pkg/controllers"
control_pkg "github.com/ksctl/ksctl/pkg/controllers"
"github.com/spf13/cobra"

"github.com/kubesimplify/ksctl/pkg/utils/consts"
"github.com/ksctl/ksctl/pkg/helpers/consts"
)

var addMoreWorkerNodesHAAzure = &cobra.Command{
Expand All @@ -20,7 +22,10 @@ ksctl create-cluster ha-azure add-nodes <arguments to civo cloud provider>
`,
Run: func(cmd *cobra.Command, args []string) {
verbosity, _ := cmd.Flags().GetInt("verbose")
if err := control_pkg.InitializeStorageFactory(&cli.Client); err != nil {
cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.LogWritter = os.Stdout

if err := control_pkg.InitializeStorageFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName()), &cli.Client); err != nil {
log.Error("Inialize Storage Driver", "Reason", err)
}
SetRequiredFeatureFlags(cmd)
Expand All @@ -33,8 +38,6 @@ ksctl create-cluster ha-azure add-nodes <arguments to civo cloud provider>
cli.Client.Metadata.IsHA = true
cli.Client.Metadata.K8sDistro = consts.KsctlKubernetes(distro)
cli.Client.Metadata.K8sVersion = k8sVer
cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.LogWritter = os.Stdout

if err := createApproval(cmd.Flags().Lookup("approve").Changed); err != nil {
log.Error(err.Error())
Expand Down
14 changes: 8 additions & 6 deletions cli/cmd/addNodesHACivo.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ package cmd
// authors Dipankar <dipankar@dipankar-das.com>

import (
"context"
"github.com/ksctl/ksctl/pkg/helpers"
"os"

control_pkg "github.com/kubesimplify/ksctl/pkg/controllers"
control_pkg "github.com/ksctl/ksctl/pkg/controllers"

"github.com/kubesimplify/ksctl/pkg/utils/consts"
"github.com/ksctl/ksctl/pkg/helpers/consts"
"github.com/spf13/cobra"
)

Expand All @@ -20,7 +22,10 @@ ksctl create-cluster ha-civo add-nodes <arguments to civo cloud provider>
`,
Run: func(cmd *cobra.Command, args []string) {
verbosity, _ := cmd.Flags().GetInt("verbose")
if err := control_pkg.InitializeStorageFactory(&cli.Client); err != nil {
cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.LogWritter = os.Stdout

if err := control_pkg.InitializeStorageFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName()), &cli.Client); err != nil {
log.Error("Inialize Storage Driver", "Reason", err)
}
SetRequiredFeatureFlags(cmd)
Expand All @@ -35,9 +40,6 @@ ksctl create-cluster ha-civo add-nodes <arguments to civo cloud provider>

cli.Client.Metadata.IsHA = true

cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.LogWritter = os.Stdout

if err := createApproval(cmd.Flags().Lookup("approve").Changed); err != nil {
log.Error(err.Error())
os.Exit(1)
Expand Down
38 changes: 26 additions & 12 deletions cli/cmd/createCluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ package cmd
// authors Dipankar Das <dipankardas0115@gmail.com>

import (
control_pkg "github.com/kubesimplify/ksctl/pkg/controllers"
"context"
control_pkg "github.com/ksctl/ksctl/pkg/controllers"
"github.com/ksctl/ksctl/pkg/helpers"
"os"

"github.com/kubesimplify/ksctl/pkg/utils/consts"
"github.com/ksctl/ksctl/pkg/helpers/consts"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -39,10 +42,13 @@ var createClusterAzure = &cobra.Command{
`,
Run: func(cmd *cobra.Command, args []string) {
verbosity, _ := cmd.Flags().GetInt("verbose")
if err := control_pkg.InitializeStorageFactory(&cli.Client); err != nil {
cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.LogWritter = os.Stdout

if err := control_pkg.InitializeStorageFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName()), &cli.Client); err != nil {
log.Error("Inialize Storage Driver", "Reason", err)
}
cli.Client.Metadata.LogVerbosity = verbosity

SetRequiredFeatureFlags(cmd)
cli.Client.Metadata.Provider = consts.CloudAzure
SetDefaults(consts.CloudAzure, consts.ClusterTypeMang)
Expand All @@ -59,11 +65,13 @@ ksctl create-cluster civo <arguments to civo cloud provider>
`,
Run: func(cmd *cobra.Command, args []string) {
verbosity, _ := cmd.Flags().GetInt("verbose")
if err := control_pkg.InitializeStorageFactory(&cli.Client); err != nil {
cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.LogWritter = os.Stdout

if err := control_pkg.InitializeStorageFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName()), &cli.Client); err != nil {
log.Error("Inialize Storage Driver", "Reason", err)
}

cli.Client.Metadata.LogVerbosity = verbosity
SetRequiredFeatureFlags(cmd)
cli.Client.Metadata.Provider = consts.CloudCivo
SetDefaults(consts.CloudCivo, consts.ClusterTypeMang)
Expand All @@ -80,11 +88,13 @@ ksctl create-cluster local <arguments to civo cloud provider>
`,
Run: func(cmd *cobra.Command, args []string) {
verbosity, _ := cmd.Flags().GetInt("verbose")
if err := control_pkg.InitializeStorageFactory(&cli.Client); err != nil {
cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.LogWritter = os.Stdout

if err := control_pkg.InitializeStorageFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName()), &cli.Client); err != nil {
log.Error("Inialize Storage Driver", "Reason", err)
}

cli.Client.Metadata.LogVerbosity = verbosity
SetRequiredFeatureFlags(cmd)
cli.Client.Metadata.Provider = consts.CloudLocal
SetDefaults(consts.CloudLocal, consts.ClusterTypeMang)
Expand All @@ -101,12 +111,14 @@ ksctl create-cluster ha-civo <arguments to civo cloud provider>
`,
Run: func(cmd *cobra.Command, args []string) {
verbosity, _ := cmd.Flags().GetInt("verbose")
if err := control_pkg.InitializeStorageFactory(&cli.Client); err != nil {
cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.LogWritter = os.Stdout

if err := control_pkg.InitializeStorageFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName()), &cli.Client); err != nil {
log.Error("Inialize Storage Driver", "Reason", err)
}
SetRequiredFeatureFlags(cmd)

cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.Provider = consts.CloudCivo
SetDefaults(consts.CloudCivo, consts.ClusterTypeHa)
createHA(cmd.Flags().Lookup("approve").Changed)
Expand All @@ -122,11 +134,13 @@ var createClusterHAAzure = &cobra.Command{
`,
Run: func(cmd *cobra.Command, args []string) {
verbosity, _ := cmd.Flags().GetInt("verbose")
if err := control_pkg.InitializeStorageFactory(&cli.Client); err != nil {
cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.LogWritter = os.Stdout

if err := control_pkg.InitializeStorageFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName()), &cli.Client); err != nil {
log.Error("Inialize Storage Driver", "Reason", err)
}
SetRequiredFeatureFlags(cmd)
cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.Provider = consts.CloudAzure
SetDefaults(consts.CloudAzure, consts.ClusterTypeHa)
createHA(cmd.Flags().Lookup("approve").Changed)
Expand Down
13 changes: 8 additions & 5 deletions cli/cmd/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
package cmd

import (
"context"
"fmt"
"github.com/ksctl/ksctl/pkg/helpers"
"os"

control_pkg "github.com/kubesimplify/ksctl/pkg/controllers"
"github.com/kubesimplify/ksctl/pkg/utils/consts"
control_pkg "github.com/ksctl/ksctl/pkg/controllers"
"github.com/ksctl/ksctl/pkg/helpers/consts"
"github.com/spf13/cobra"
)

Expand All @@ -18,7 +20,10 @@ var credCmd = &cobra.Command{
`,
Run: func(cmd *cobra.Command, args []string) {
verbosity, _ := cmd.Flags().GetInt("verbose")
if err := control_pkg.InitializeStorageFactory(&cli.Client); err != nil {
cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.LogWritter = os.Stdout

if err := control_pkg.InitializeStorageFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName()), &cli.Client); err != nil {
log.Error("Inialize Storage Driver", "Reason", err)
}
SetRequiredFeatureFlags(cmd)
Expand All @@ -40,8 +45,6 @@ var credCmd = &cobra.Command{
} else {
log.Error("invalid provider")
}
cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.LogWritter = os.Stdout

if err := controller.Credentials(&cli.Client); err != nil {
log.Error("Failed to added the credential", "Reason", err)
Expand Down
37 changes: 25 additions & 12 deletions cli/cmd/deleteCluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ package cmd
// authors Dipankar Das <dipankardas0115@gmail.com>

import (
control_pkg "github.com/kubesimplify/ksctl/pkg/controllers"
"github.com/kubesimplify/ksctl/pkg/utils/consts"
"context"
control_pkg "github.com/ksctl/ksctl/pkg/controllers"
"github.com/ksctl/ksctl/pkg/helpers"
"github.com/ksctl/ksctl/pkg/helpers/consts"
"github.com/spf13/cobra"
"os"
)

// deleteClusterCmd represents the deleteCluster command
Expand All @@ -28,13 +31,15 @@ ksctl create-cluster azure <arguments to civo cloud provider>
`,
Run: func(cmd *cobra.Command, args []string) {
verbosity, _ := cmd.Flags().GetInt("verbose")
if err := control_pkg.InitializeStorageFactory(&cli.Client); err != nil {
cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.LogWritter = os.Stdout

if err := control_pkg.InitializeStorageFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName()), &cli.Client); err != nil {
log.Error("Inialize Storage Driver", "Reason", err)
}

SetRequiredFeatureFlags(cmd)
cli.Client.Metadata.Provider = consts.CloudAzure
cli.Client.Metadata.LogVerbosity = verbosity
SetDefaults(consts.CloudAzure, consts.ClusterTypeMang)

deleteManaged(cmd.Flags().Lookup("approve").Changed)
Expand All @@ -50,13 +55,15 @@ ksctl delete-cluster civo
`,
Run: func(cmd *cobra.Command, args []string) {
verbosity, _ := cmd.Flags().GetInt("verbose")
if err := control_pkg.InitializeStorageFactory(&cli.Client); err != nil {
cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.LogWritter = os.Stdout

if err := control_pkg.InitializeStorageFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName()), &cli.Client); err != nil {
log.Error("Inialize Storage Driver", "Reason", err)
}

SetRequiredFeatureFlags(cmd)
cli.Client.Metadata.Provider = consts.CloudCivo
cli.Client.Metadata.LogVerbosity = verbosity
SetDefaults(consts.CloudCivo, consts.ClusterTypeMang)

deleteManaged(cmd.Flags().Lookup("approve").Changed)
Expand All @@ -73,13 +80,15 @@ var deleteClusterHAAzure = &cobra.Command{
`,
Run: func(cmd *cobra.Command, args []string) {
verbosity, _ := cmd.Flags().GetInt("verbose")
if err := control_pkg.InitializeStorageFactory(&cli.Client); err != nil {
cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.LogWritter = os.Stdout

if err := control_pkg.InitializeStorageFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName()), &cli.Client); err != nil {
log.Error("Inialize Storage Driver", "Reason", err)
}

SetRequiredFeatureFlags(cmd)
cli.Client.Metadata.Provider = consts.CloudAzure
cli.Client.Metadata.LogVerbosity = verbosity
SetDefaults(consts.CloudAzure, consts.ClusterTypeHa)

deleteHA(cmd.Flags().Lookup("approve").Changed)
Expand All @@ -95,13 +104,15 @@ ksctl delete-cluster ha-civo <arguments to civo cloud provider>
`,
Run: func(cmd *cobra.Command, args []string) {
verbosity, _ := cmd.Flags().GetInt("verbose")
if err := control_pkg.InitializeStorageFactory(&cli.Client); err != nil {
cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.LogWritter = os.Stdout

if err := control_pkg.InitializeStorageFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName()), &cli.Client); err != nil {
log.Error("Inialize Storage Driver", "Reason", err)
}

SetRequiredFeatureFlags(cmd)
cli.Client.Metadata.Provider = consts.CloudCivo
cli.Client.Metadata.LogVerbosity = verbosity
SetDefaults(consts.CloudCivo, consts.ClusterTypeHa)

deleteHA(cmd.Flags().Lookup("approve").Changed)
Expand All @@ -117,13 +128,15 @@ ksctl delete-cluster local <arguments to local/Docker provider>
`,
Run: func(cmd *cobra.Command, args []string) {
verbosity, _ := cmd.Flags().GetInt("verbose")
if err := control_pkg.InitializeStorageFactory(&cli.Client); err != nil {
cli.Client.Metadata.LogVerbosity = verbosity
cli.Client.Metadata.LogWritter = os.Stdout

if err := control_pkg.InitializeStorageFactory(context.WithValue(context.Background(), "USERID", helpers.GetUserName()), &cli.Client); err != nil {
log.Error("Inialize Storage Driver", "Reason", err)
}

SetRequiredFeatureFlags(cmd)
cli.Client.Metadata.Provider = consts.CloudLocal
cli.Client.Metadata.LogVerbosity = verbosity
SetDefaults(consts.CloudLocal, consts.ClusterTypeMang)

deleteManaged(cmd.Flags().Lookup("approve").Changed)
Expand Down
Loading

0 comments on commit 1081db2

Please sign in to comment.