Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/pro/cluster/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

managementv1 "github.com/devsy-org/api/pkg/apis/management/v1"
storagev1 "github.com/devsy-org/api/pkg/apis/storage/v1"
proflags "github.com/devsy-org/devsy/cmd/pro/flags"
platformflags "github.com/devsy-org/devsy/cmd/pro/flags"
"github.com/devsy-org/devsy/pkg/config"
"github.com/devsy-org/devsy/pkg/log"
"github.com/devsy-org/devsy/pkg/platform"
Expand All @@ -29,7 +29,7 @@ import (
)

type ClusterCmd struct {
*proflags.GlobalFlags
*platformflags.GlobalFlags

Namespace string
ServiceAccount string
Expand All @@ -45,7 +45,7 @@ type ClusterCmd struct {
}

// NewAddCmd creates a new command.
func NewAddCmd(globalFlags *proflags.GlobalFlags) *cobra.Command {
func NewAddCmd(globalFlags *platformflags.GlobalFlags) *cobra.Command {
cmd := &ClusterCmd{
GlobalFlags: globalFlags,
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/pro/cluster/add_flags.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cluster

import (
proflags "github.com/devsy-org/devsy/cmd/pro/flags"
platformflags "github.com/devsy-org/devsy/cmd/pro/flags"
cliflags "github.com/devsy-org/devsy/pkg/flags"
"github.com/devsy-org/devsy/pkg/flags/names"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -92,5 +92,5 @@ func (cmd *ClusterCmd) registerClusterFlags(c *cobra.Command) {
),
cliflags.String(&cmd.Host, names.Host, "", "The platform instance to use"),
)
proflags.BindEnv(c.Flags(), names.Host)
platformflags.BindEnv(c.Flags(), names.Host)
}
4 changes: 2 additions & 2 deletions cmd/pro/cluster/cluster.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package cluster

import (
proflags "github.com/devsy-org/devsy/cmd/pro/flags"
platformflags "github.com/devsy-org/devsy/cmd/pro/flags"
"github.com/spf13/cobra"
)

// NewClusterCmd builds the 'devsy platform cluster' parent command for managing
// Platform clusters.
func NewClusterCmd(globalFlags *proflags.GlobalFlags) *cobra.Command {
func NewClusterCmd(globalFlags *platformflags.GlobalFlags) *cobra.Command {
cmd := &cobra.Command{
Use: "cluster",
Short: "Manage Devsy Platform clusters",
Expand Down
8 changes: 4 additions & 4 deletions cmd/pro/cmdutil/cmdutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"

"github.com/devsy-org/devsy/cmd/pro/completion"
proflags "github.com/devsy-org/devsy/cmd/pro/flags"
platformflags "github.com/devsy-org/devsy/cmd/pro/flags"
"github.com/devsy-org/devsy/pkg/config"
cliflags "github.com/devsy-org/devsy/pkg/flags"
"github.com/devsy-org/devsy/pkg/flags/names"
Expand Down Expand Up @@ -57,7 +57,7 @@ var findPlatformProviderFn = FindPlatformProvider
// HostRunE returns a RunE that resolves the provider for *host and passes it to
// run. *host is read when the command runs, after flag parsing.
func HostRunE(
globalFlags *proflags.GlobalFlags,
globalFlags *platformflags.GlobalFlags,
host *string,
run HostRunFunc,
) func(*cobra.Command, []string) error {
Expand All @@ -77,14 +77,14 @@ func HostRunE(
}

type hostFlagOptions struct {
completionFlags *proflags.GlobalFlags
completionFlags *platformflags.GlobalFlags
}

// HostFlagOption configures AddHostFlag.
type HostFlagOption func(*hostFlagOptions)

// WithHostCompletion registers shell completion for --host listing platform instances.
func WithHostCompletion(globalFlags *proflags.GlobalFlags) HostFlagOption {
func WithHostCompletion(globalFlags *platformflags.GlobalFlags) HostFlagOption {
return func(o *hostFlagOptions) { o.completionFlags = globalFlags }
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/pro/cmdutil/cmdutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"

rootflags "github.com/devsy-org/devsy/cmd/flags"
proflags "github.com/devsy-org/devsy/cmd/pro/flags"
platformflags "github.com/devsy-org/devsy/cmd/pro/flags"
"github.com/devsy-org/devsy/pkg/config"
cliflags "github.com/devsy-org/devsy/pkg/flags"
"github.com/devsy-org/devsy/pkg/flags/names"
Expand Down Expand Up @@ -84,7 +84,7 @@ func (s *hostFlagSuite) TestHostRunEResolvesHostAtRunTime() {
return devsyConfig, pCfg, nil
}

gf := &proflags.GlobalFlags{
gf := &platformflags.GlobalFlags{
GlobalFlags: &rootflags.GlobalFlags{Context: "ctx-a", Provider: "prov-b"},
}
var host string
Expand Down Expand Up @@ -128,7 +128,7 @@ func (s *hostFlagSuite) TestHostRunEPropagatesResolveErrorWithoutRunning() {
}

var host string
gf := &proflags.GlobalFlags{GlobalFlags: &rootflags.GlobalFlags{}}
gf := &platformflags.GlobalFlags{GlobalFlags: &rootflags.GlobalFlags{}}
c := &cobra.Command{Use: testCmdName, RunE: HostRunE(gf, &host, run)}
c.SetOut(io.Discard)
c.SetErr(io.Discard)
Expand Down
6 changes: 3 additions & 3 deletions cmd/pro/daemon/netcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"

"github.com/devsy-org/devsy/cmd/pro/cmdutil"
proflags "github.com/devsy-org/devsy/cmd/pro/flags"
platformflags "github.com/devsy-org/devsy/cmd/pro/flags"
"github.com/devsy-org/devsy/pkg/config"
daemon "github.com/devsy-org/devsy/pkg/daemon/platform"
providerpkg "github.com/devsy-org/devsy/pkg/provider"
Expand All @@ -18,13 +18,13 @@ import (

// NetcheckCmd holds the Devsy daemon flags.
type NetcheckCmd struct {
*proflags.GlobalFlags
*platformflags.GlobalFlags

Host string
}

// NewNetcheckCmd creates a new command.
func NewNetcheckCmd(flags *proflags.GlobalFlags) *cobra.Command {
func NewNetcheckCmd(flags *platformflags.GlobalFlags) *cobra.Command {
cmd := &NetcheckCmd{
GlobalFlags: flags,
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/pro/daemon/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

managementv1 "github.com/devsy-org/api/pkg/apis/management/v1"
"github.com/devsy-org/devsy/cmd/pro/cmdutil"
proflags "github.com/devsy-org/devsy/cmd/pro/flags"
platformflags "github.com/devsy-org/devsy/cmd/pro/flags"
"github.com/devsy-org/devsy/pkg/config"
daemon "github.com/devsy-org/devsy/pkg/daemon/platform"
"github.com/devsy-org/devsy/pkg/log"
Expand All @@ -22,13 +22,13 @@ import (

// StartCmd holds the devsy daemon flags.
type StartCmd struct {
*proflags.GlobalFlags
*platformflags.GlobalFlags

Host string
}

// NewStartCmd creates a new command.
func NewStartCmd(flags *proflags.GlobalFlags) *cobra.Command {
func NewStartCmd(flags *platformflags.GlobalFlags) *cobra.Command {
cmd := &StartCmd{
GlobalFlags: flags,
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/pro/daemon/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"

"github.com/devsy-org/devsy/cmd/pro/cmdutil"
proflags "github.com/devsy-org/devsy/cmd/pro/flags"
platformflags "github.com/devsy-org/devsy/cmd/pro/flags"
"github.com/devsy-org/devsy/pkg/config"
platformdaemon "github.com/devsy-org/devsy/pkg/daemon/platform"
providerpkg "github.com/devsy-org/devsy/pkg/provider"
Expand All @@ -15,13 +15,13 @@ import (

// StatusCmd holds the Devsy daemon flags.
type StatusCmd struct {
*proflags.GlobalFlags
*platformflags.GlobalFlags

Host string
}

// NewStatusCmd creates a new command.
func NewStatusCmd(flags *proflags.GlobalFlags) *cobra.Command {
func NewStatusCmd(flags *platformflags.GlobalFlags) *cobra.Command {
cmd := &StatusCmd{
GlobalFlags: flags,
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/pro/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sort"
"time"

proflags "github.com/devsy-org/devsy/cmd/pro/flags"
platformflags "github.com/devsy-org/devsy/cmd/pro/flags"
"github.com/devsy-org/devsy/pkg/config"
cliflags "github.com/devsy-org/devsy/pkg/flags"
"github.com/devsy-org/devsy/pkg/flags/names"
Expand All @@ -21,13 +21,13 @@ import (

// ListCmd holds the list cmd flags.
type ListCmd struct {
proflags.GlobalFlags
platformflags.GlobalFlags

Login bool
}

// NewListCmd creates a new command.
func NewListCmd(flags *proflags.GlobalFlags) *cobra.Command {
func NewListCmd(flags *platformflags.GlobalFlags) *cobra.Command {
cmd := &ListCmd{
GlobalFlags: *flags,
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/pro/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"

"github.com/blang/semver/v4"
proflags "github.com/devsy-org/devsy/cmd/pro/flags"
platformflags "github.com/devsy-org/devsy/cmd/pro/flags"
providercmd "github.com/devsy-org/devsy/cmd/provider"
"github.com/devsy-org/devsy/pkg/config"
cliflags "github.com/devsy-org/devsy/pkg/flags"
Expand All @@ -26,7 +26,7 @@ const PROVIDER_BINARY = "PRO_PROVIDER"

// LoginCmd holds the login cmd flags.
type LoginCmd struct {
proflags.GlobalFlags
platformflags.GlobalFlags

AccessKey string
Provider string
Expand All @@ -41,7 +41,7 @@ type LoginCmd struct {
}

// NewLoginCmd creates a new command.
func NewLoginCmd(flags *proflags.GlobalFlags) *cobra.Command {
func NewLoginCmd(flags *platformflags.GlobalFlags) *cobra.Command {
cmd := &LoginCmd{
GlobalFlags: *flags,
}
Expand Down
10 changes: 5 additions & 5 deletions cmd/pro/login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

rootflags "github.com/devsy-org/devsy/cmd/flags"
proflags "github.com/devsy-org/devsy/cmd/pro/flags"
platformflags "github.com/devsy-org/devsy/cmd/pro/flags"
"github.com/devsy-org/devsy/pkg/config"
"github.com/devsy-org/devsy/pkg/provider"
"github.com/stretchr/testify/suite"
Expand Down Expand Up @@ -45,7 +45,7 @@ func (s *loginSuite) TestConcurrentLoginFindsCreatedInstance() {
s.Require().NoError(lock.Lock())
s.T().Cleanup(func() { _ = lock.Unlock() })

cmd := &LoginCmd{GlobalFlags: proflags.GlobalFlags{GlobalFlags: &rootflags.GlobalFlags{}}}
cmd := &LoginCmd{GlobalFlags: platformflags.GlobalFlags{GlobalFlags: &rootflags.GlobalFlags{}}}
result := make(chan error, 1)
go func() {
_, err := cmd.prepareProvider(context.Background(), "https://pro.example")
Expand Down Expand Up @@ -76,7 +76,7 @@ func (s *loginSuite) TestDifferentHostDoesNotWaitForLoginLock() {
Host: "second.example",
}))

cmd := &LoginCmd{GlobalFlags: proflags.GlobalFlags{GlobalFlags: &rootflags.GlobalFlags{}}}
cmd := &LoginCmd{GlobalFlags: platformflags.GlobalFlags{GlobalFlags: &rootflags.GlobalFlags{}}}
result := make(chan error, 1)
go func() {
_, err := cmd.prepareProvider(context.Background(), "https://second.example")
Expand Down Expand Up @@ -117,7 +117,7 @@ func (s *loginSuite) TestEquivalentHostFindsExistingInstance() {
Provider: testPlatformProviderName,
Host: "Foo.Example.com",
}))
cmd := &LoginCmd{GlobalFlags: proflags.GlobalFlags{GlobalFlags: &rootflags.GlobalFlags{}}}
cmd := &LoginCmd{GlobalFlags: platformflags.GlobalFlags{GlobalFlags: &rootflags.GlobalFlags{}}}
_, err := cmd.prepareProvider(context.Background(), "https://foo.example.com")
s.Require().NoError(err)
s.Equal(testPlatformProviderName, cmd.Provider)
Expand All @@ -128,7 +128,7 @@ func (s *loginSuite) TestDistinctHostsWithSameInstanceIDAreRejected() {
Provider: testPlatformProviderName,
Host: "foo.example.com",
}))
cmd := &LoginCmd{GlobalFlags: proflags.GlobalFlags{GlobalFlags: &rootflags.GlobalFlags{}}}
cmd := &LoginCmd{GlobalFlags: platformflags.GlobalFlags{GlobalFlags: &rootflags.GlobalFlags{}}}
_, err := cmd.prepareProvider(context.Background(), "https://foo-example.com")
s.Require().ErrorContains(err, "conflicts with existing host")
stored, err := provider.LoadPlatformInstanceConfig("default", "foo.example.com")
Expand Down
6 changes: 3 additions & 3 deletions cmd/pro/logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"
"time"

proflags "github.com/devsy-org/devsy/cmd/pro/flags"
platformflags "github.com/devsy-org/devsy/cmd/pro/flags"
providercmd "github.com/devsy-org/devsy/cmd/provider"
"github.com/devsy-org/devsy/pkg/client/clientimplementation"
"github.com/devsy-org/devsy/pkg/config"
Expand All @@ -24,13 +24,13 @@ import (

// LogoutCmd holds the logout cmd flags.
type LogoutCmd struct {
*proflags.GlobalFlags
*platformflags.GlobalFlags

IgnoreNotFound bool
}

// NewLogoutCmd creates a new command.
func NewLogoutCmd(flags *proflags.GlobalFlags) *cobra.Command {
func NewLogoutCmd(flags *platformflags.GlobalFlags) *cobra.Command {
cmd := &LogoutCmd{
GlobalFlags: flags,
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/pro/pro.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/devsy-org/devsy/cmd/flags"
procluster "github.com/devsy-org/devsy/cmd/pro/cluster"
"github.com/devsy-org/devsy/cmd/pro/daemon"
proflags "github.com/devsy-org/devsy/cmd/pro/flags"
platformflags "github.com/devsy-org/devsy/cmd/pro/flags"
proproject "github.com/devsy-org/devsy/cmd/pro/project"
"github.com/devsy-org/devsy/cmd/pro/provider"
protemplate "github.com/devsy-org/devsy/cmd/pro/template"
Expand All @@ -15,7 +15,7 @@ import (

// NewPlatformCmd returns a new command.
func NewPlatformCmd(flags *flags.GlobalFlags) *cobra.Command {
globalFlags := &proflags.GlobalFlags{GlobalFlags: flags}
globalFlags := &platformflags.GlobalFlags{GlobalFlags: flags}
platformCmd := &cobra.Command{
Use: "platform",
Aliases: []string{"pro"},
Expand All @@ -24,7 +24,7 @@ func NewPlatformCmd(flags *flags.GlobalFlags) *cobra.Command {
SilenceErrors: true,
Args: cobra.NoArgs,
PersistentPreRunE: func(c *cobra.Command, _ []string) error {
globalFlags = proflags.SetGlobalFlags(c.PersistentFlags())
globalFlags = platformflags.SetGlobalFlags(c.PersistentFlags())
return nil
},
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/pro/project/project.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package project

import (
proflags "github.com/devsy-org/devsy/cmd/pro/flags"
platformflags "github.com/devsy-org/devsy/cmd/pro/flags"
"github.com/spf13/cobra"
)

// NewProjectCmd builds the 'devsy platform project' parent command for managing
// Platform projects.
func NewProjectCmd(globalFlags *proflags.GlobalFlags) *cobra.Command {
func NewProjectCmd(globalFlags *platformflags.GlobalFlags) *cobra.Command {
cmd := &cobra.Command{
Use: "project",
Short: "Manage Devsy Platform projects",
Expand Down
6 changes: 3 additions & 3 deletions cmd/pro/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
storagev1 "github.com/devsy-org/api/pkg/apis/storage/v1"
"github.com/devsy-org/api/pkg/auth"
devsyclientset "github.com/devsy-org/api/pkg/clientset/versioned"
proflags "github.com/devsy-org/devsy/cmd/pro/flags"
platformflags "github.com/devsy-org/devsy/cmd/pro/flags"
"github.com/devsy-org/devsy/pkg/config"
"github.com/devsy-org/devsy/pkg/log"
devsyopen "github.com/devsy-org/devsy/pkg/open"
Expand Down Expand Up @@ -57,7 +57,7 @@ var defaultDeploymentName = "loft" // Need to update helm chart if we change thi

// StartCmd holds the login cmd flags.
type StartCmd struct {
proflags.GlobalFlags
platformflags.GlobalFlags

KubeClient kubernetes.Interface
RestConfig *rest.Config
Expand Down Expand Up @@ -86,7 +86,7 @@ type StartCmd struct {
}

// NewStartCmd creates a new command.
func NewStartCmd(flags *proflags.GlobalFlags) *cobra.Command {
func NewStartCmd(flags *platformflags.GlobalFlags) *cobra.Command {
cmd := &StartCmd{
GlobalFlags: *flags,
Product: config.PlatformReleaseName,
Expand Down
Loading
Loading