diff --git a/cmd/plural/api.go b/cmd/plural/api.go index 68595945c..52273e8f5 100644 --- a/cmd/plural/api.go +++ b/cmd/plural/api.go @@ -4,15 +4,15 @@ import ( "github.com/pluralsh/plural/pkg/api" "github.com/pluralsh/plural/pkg/utils" "github.com/pluralsh/polly/algorithms" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) -func (p *Plural) apiCommands() []cli.Command { - return []cli.Command{ +func (p *Plural) apiCommands() []*cli.Command { + return []*cli.Command{ { Name: "list", Usage: "lists plural resources", - Subcommands: []cli.Command{ + Subcommands: []*cli.Command{ { Name: "installations", Usage: "lists your installations", @@ -62,7 +62,7 @@ func (p *Plural) apiCommands() []cli.Command { { Name: "create", Usage: "creates plural resources", - Subcommands: []cli.Command{ + Subcommands: []*cli.Command{ { Name: "domain", Usage: "creates a new domain for your account", diff --git a/cmd/plural/app.go b/cmd/plural/app.go index cbf68d08b..3252fb6ce 100644 --- a/cmd/plural/app.go +++ b/cmd/plural/app.go @@ -6,7 +6,7 @@ import ( "strings" tm "github.com/buger/goterm" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" "github.com/pluralsh/plural/pkg/application" "github.com/pluralsh/plural/pkg/config" diff --git a/cmd/plural/bundle.go b/cmd/plural/bundle.go index 532ed9264..ac1c5a34a 100644 --- a/cmd/plural/bundle.go +++ b/cmd/plural/bundle.go @@ -8,11 +8,11 @@ import ( "github.com/pluralsh/plural/pkg/bundle" "github.com/pluralsh/plural/pkg/manifest" "github.com/pluralsh/plural/pkg/utils" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) -func (p *Plural) bundleCommands() []cli.Command { - return []cli.Command{ +func (p *Plural) bundleCommands() []*cli.Command { + return []*cli.Command{ { Name: "list", Usage: "lists bundles for a repository", @@ -24,7 +24,7 @@ func (p *Plural) bundleCommands() []cli.Command { Usage: "installs a bundle and writes the configuration to this installation's context", ArgsUsage: "REPO NAME", Flags: []cli.Flag{ - cli.BoolFlag{ + &cli.BoolFlag{ Name: "refresh", Usage: "re-enter the configuration for this bundle", }, @@ -34,14 +34,14 @@ func (p *Plural) bundleCommands() []cli.Command { } } -func (p *Plural) stackCommands() []cli.Command { - return []cli.Command{ +func (p *Plural) stackCommands() []*cli.Command { + return []*cli.Command{ { Name: "install", Usage: "installs a plural stack for your current provider", ArgsUsage: "NAME", Flags: []cli.Flag{ - cli.BoolFlag{ + &cli.BoolFlag{ Name: "refresh", Usage: "re-enter the configuration for all bundles", }, @@ -52,7 +52,7 @@ func (p *Plural) stackCommands() []cli.Command { Name: "list", Usage: "lists stacks to potentially install", Flags: []cli.Flag{ - cli.BoolTFlag{ + &cli.BoolFlag{ Name: "account", Usage: "only list stacks within your account", }, diff --git a/cmd/plural/config.go b/cmd/plural/config.go index 09531ca9c..c96cb2572 100644 --- a/cmd/plural/config.go +++ b/cmd/plural/config.go @@ -6,11 +6,11 @@ import ( "github.com/pluralsh/plural/pkg/config" "github.com/pluralsh/plural/pkg/utils" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) -func configCommands() []cli.Command { - return []cli.Command{ +func configCommands() []*cli.Command { + return []*cli.Command{ { Name: "amend", Usage: "modify config", @@ -31,8 +31,8 @@ func configCommands() []cli.Command { } } -func profileCommands() []cli.Command { - return []cli.Command{ +func profileCommands() []*cli.Command { + return []*cli.Command{ { Name: "use", Usage: "moves the config in PROFILE to the current config", diff --git a/cmd/plural/config_test.go b/cmd/plural/config_test.go index e56ee7872..baab28ad4 100644 --- a/cmd/plural/config_test.go +++ b/cmd/plural/config_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" plural "github.com/pluralsh/plural/cmd/plural" "github.com/pluralsh/plural/pkg/config" diff --git a/cmd/plural/crypto.go b/cmd/plural/crypto.go index 07461f343..ea421077e 100644 --- a/cmd/plural/crypto.go +++ b/cmd/plural/crypto.go @@ -10,7 +10,7 @@ import ( "github.com/AlecAivazis/survey/v2" "github.com/mitchellh/go-homedir" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" "github.com/pluralsh/plural/pkg/crypto" "github.com/pluralsh/plural/pkg/scm" @@ -54,8 +54,8 @@ const Gitignore = `/**/.terraform // IMPORTANT // Repo cryptography relies on git smudge and clean filters, which pipe a file into stdin and respond with a new version // of the file from stdout. If we write anything besides the crypto text, it will no longer be decryptable naturally. -func (p *Plural) cryptoCommands() []cli.Command { - return []cli.Command{ +func (p *Plural) cryptoCommands() []*cli.Command { + return []*cli.Command{ { Name: "encrypt", Usage: "encrypts stdin and writes to stdout", @@ -91,7 +91,7 @@ func (p *Plural) cryptoCommands() []cli.Command { Usage: "generates a random string", Action: randString, Flags: []cli.Flag{ - cli.IntFlag{ + &cli.IntFlag{ Name: "len", Usage: "the length of the string to generate", Value: 32, @@ -113,7 +113,7 @@ func (p *Plural) cryptoCommands() []cli.Command { Usage: "allows a list of plural users to decrypt this repository", ArgsUsage: "", Flags: []cli.Flag{ - cli.StringSliceFlag{ + &cli.StringSliceFlag{ Name: "email", Usage: "a email to share with (multiple allowed)", Required: true, @@ -125,7 +125,7 @@ func (p *Plural) cryptoCommands() []cli.Command { Name: "setup-keys", Usage: "creates an age keypair, and uploads the public key to plural for use in plural crypto share", Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "name", Usage: "a name for the key", Required: true, diff --git a/cmd/plural/crypto_test.go b/cmd/plural/crypto_test.go index fc74f6fa4..a902b1033 100644 --- a/cmd/plural/crypto_test.go +++ b/cmd/plural/crypto_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/pluralsh/plural/pkg/utils" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" plural "github.com/pluralsh/plural/cmd/plural" "github.com/pluralsh/plural/pkg/api" diff --git a/cmd/plural/dependencies.go b/cmd/plural/dependencies.go index 6c0413999..0cbee70de 100644 --- a/cmd/plural/dependencies.go +++ b/cmd/plural/dependencies.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/pluralsh/plural/pkg/wkspace" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) func (p *Plural) topsort(c *cli.Context) error { diff --git a/cmd/plural/deploy.go b/cmd/plural/deploy.go index 16d1101ca..3c92f4497 100644 --- a/cmd/plural/deploy.go +++ b/cmd/plural/deploy.go @@ -21,7 +21,7 @@ import ( "github.com/pluralsh/plural/pkg/wkspace" "github.com/pluralsh/polly/algorithms" "github.com/pluralsh/polly/containers" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) func (p *Plural) getSortedInstallations(repo string) ([]*api.Installation, error) { diff --git a/cmd/plural/git.go b/cmd/plural/git.go index 7ab7aa399..ccd1e2f0d 100644 --- a/cmd/plural/git.go +++ b/cmd/plural/git.go @@ -6,7 +6,7 @@ import ( "os/exec" "github.com/pluralsh/plural/pkg/utils/git" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) func handleRepair(c *cli.Context) error { diff --git a/cmd/plural/init.go b/cmd/plural/init.go index 2d367aac2..4b4396e1d 100644 --- a/cmd/plural/init.go +++ b/cmd/plural/init.go @@ -7,7 +7,7 @@ import ( "time" "github.com/pkg/browser" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" "github.com/pluralsh/plural/pkg/api" "github.com/pluralsh/plural/pkg/config" diff --git a/cmd/plural/link.go b/cmd/plural/link.go index bebb68c6e..63922ba31 100644 --- a/cmd/plural/link.go +++ b/cmd/plural/link.go @@ -2,22 +2,22 @@ package main import ( "github.com/pluralsh/plural/pkg/manifest" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) -func linkCommands() []cli.Command { - return []cli.Command{ +func linkCommands() []*cli.Command { + return []*cli.Command{ { Name: "link", Usage: "links a local package into an installation repo", ArgsUsage: "TOOL REPO", Action: handleLink, Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "name, n", Usage: "the name of the artifact to link", }, - cli.StringFlag{ + &cli.StringFlag{ Name: "path, f", Usage: "local path to that artifact (can be relative)", }, diff --git a/cmd/plural/logs.go b/cmd/plural/logs.go index 0bd6b2874..5a38d5447 100644 --- a/cmd/plural/logs.go +++ b/cmd/plural/logs.go @@ -3,11 +3,11 @@ package main import ( "github.com/pluralsh/plural/pkg/config" "github.com/pluralsh/plural/pkg/logs" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) -func (p *Plural) logsCommands() []cli.Command { - return []cli.Command{ +func (p *Plural) logsCommands() []*cli.Command { + return []*cli.Command{ { Name: "list", Usage: "lists log tails for a repo", diff --git a/cmd/plural/ops.go b/cmd/plural/ops.go index 481fa0fff..b8ef8d2cc 100644 --- a/cmd/plural/ops.go +++ b/cmd/plural/ops.go @@ -5,12 +5,12 @@ import ( "github.com/pluralsh/plural/pkg/provider" "github.com/pluralsh/plural/pkg/utils" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" v1 "k8s.io/api/core/v1" ) -func (p *Plural) opsCommands() []cli.Command { - return []cli.Command{ +func (p *Plural) opsCommands() []*cli.Command { + return []*cli.Command{ { Name: "terminate", Usage: "terminates a worker node in your cluster", diff --git a/cmd/plural/output.go b/cmd/plural/output.go index 7b0f63f81..43d89e1a5 100644 --- a/cmd/plural/output.go +++ b/cmd/plural/output.go @@ -6,11 +6,11 @@ import ( "github.com/pluralsh/plural/pkg/output" "github.com/pluralsh/plural/pkg/utils" "github.com/pluralsh/plural/pkg/utils/pathing" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) -func outputCommands() []cli.Command { - return []cli.Command{ +func outputCommands() []*cli.Command { + return []*cli.Command{ { Name: "terraform", Usage: "generates terraform output", diff --git a/cmd/plural/packages.go b/cmd/plural/packages.go index 27fba71eb..f3cbb895a 100644 --- a/cmd/plural/packages.go +++ b/cmd/plural/packages.go @@ -8,11 +8,11 @@ import ( "github.com/olekukonko/tablewriter" "github.com/pluralsh/plural/pkg/utils" "github.com/pluralsh/plural/pkg/wkspace" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) -func (p *Plural) packagesCommands() []cli.Command { - return []cli.Command{ +func (p *Plural) packagesCommands() []*cli.Command { + return []*cli.Command{ { Name: "uninstall", Usage: "uninstall a helm or terraform package", diff --git a/cmd/plural/plural.go b/cmd/plural/plural.go index e0ef84274..0679c87e4 100644 --- a/cmd/plural/plural.go +++ b/cmd/plural/plural.go @@ -12,11 +12,11 @@ import ( "github.com/pluralsh/plural/pkg/kubernetes" "github.com/fatih/color" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) func init() { - cli.BashCompletionFlag = cli.BoolFlag{Name: "compgen", Hidden: true} + cli.BashCompletionFlag = &cli.BoolFlag{Name: "compgen", Hidden: true} } const ApplicationName = "plural" @@ -43,8 +43,8 @@ func (p *Plural) InitPluralClient() { } } -func (p *Plural) getCommands() []cli.Command { - return []cli.Command{ +func (p *Plural) getCommands() []*cli.Command { + return []*cli.Command{ { Name: "version", Aliases: []string{"v", "vsn"}, @@ -56,11 +56,11 @@ func (p *Plural) getCommands() []cli.Command { Aliases: []string{"b"}, Usage: "builds your workspace", Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "only", Usage: "repository to (re)build", }, - cli.BoolFlag{ + &cli.BoolFlag{ Name: "force", Usage: "force workspace to build even if remote is out of sync", }, @@ -73,31 +73,31 @@ func (p *Plural) getCommands() []cli.Command { Usage: "Deploys the current workspace. This command will first sniff out git diffs in workspaces, topsort them, then apply all changes.", ArgsUsage: "WKSPACE", Flags: []cli.Flag{ - cli.BoolFlag{ + &cli.BoolFlag{ Name: "silence", Usage: "don't display notes for deployed apps", }, - cli.BoolFlag{ + &cli.BoolFlag{ Name: "verbose", Usage: "show all command output during execution", }, - cli.BoolFlag{ + &cli.BoolFlag{ Name: "ignore-console", Usage: "don't deploy the plural console", }, - cli.BoolFlag{ + &cli.BoolFlag{ Name: "all", Usage: "deploy all repos irregardless of changes", }, - cli.StringFlag{ + &cli.StringFlag{ Name: "commit", Usage: "commits your changes with this message", }, - cli.StringFlag{ + &cli.StringFlag{ Name: "from", Usage: "deploys only this application and its dependencies", }, - cli.BoolFlag{ + &cli.BoolFlag{ Name: "force", Usage: "use force push when pushing to git", }, @@ -142,7 +142,7 @@ func (p *Plural) getCommands() []cli.Command { Name: "apply", Usage: "applys the current pluralfile", Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "file, f", Usage: "pluralfile to use", }, @@ -155,7 +155,7 @@ func (p *Plural) getCommands() []cli.Command { Aliases: []string{"v"}, Usage: "validates your workspace", Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "only", Usage: "repository to (re)build", }, @@ -190,15 +190,15 @@ func (p *Plural) getCommands() []cli.Command { Usage: "iterates through all installations in reverse topological order, deleting helm installations and terraform", ArgsUsage: "WKSPACE", Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "from", Usage: "where to start your deploy command (useful when restarting interrupted destroys)", }, - cli.StringFlag{ + &cli.StringFlag{ Name: "commit", Usage: "commits your changes with this message", }, - cli.BoolFlag{ + &cli.BoolFlag{ Name: "force", Usage: "use force push when pushing to git", }, @@ -209,11 +209,11 @@ func (p *Plural) getCommands() []cli.Command { Name: "init", Usage: "initializes plural within a git repo", Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "endpoint", Usage: "the endpoint for the plural installation you're working with", }, - cli.StringFlag{ + &cli.StringFlag{ Name: "service-account", Usage: "email for the service account you'd like to use for this workspace", }, @@ -230,11 +230,11 @@ func (p *Plural) getCommands() []cli.Command { Usage: "logs into plural and saves credentials to the current config profile", Action: latestVersion(handleLogin), Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "endpoint", Usage: "the endpoint for the plural installation you're working with", }, - cli.StringFlag{ + &cli.StringFlag{ Name: "service-account", Usage: "email for the service account you'd like to use for this workspace", }, @@ -371,7 +371,7 @@ func (p *Plural) getCommands() []cli.Command { Aliases: []string{"tpl"}, Usage: "templates a helm chart to be uploaded to plural", Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "values", Usage: "the values file", }, @@ -417,16 +417,16 @@ func main() { func globalFlags() []cli.Flag { return []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "profile-file", Usage: "configure your config.yml profile `FILE`", - EnvVar: "PLURAL_PROFILE_FILE", + EnvVars: []string{"PLURAL_PROFILE_FILE"}, Destination: &config.ProfileFile, }, - cli.StringFlag{ + &cli.StringFlag{ Name: "encryption-key-file", Usage: "configure your encryption key `FILE`", - EnvVar: "PLURAL_ENCRYPTION_KEY_FILE", + EnvVars: []string{"PLURAL_ENCRYPTION_KEY_FILE"}, Destination: &crypto.EncryptionKeyFile, }, } diff --git a/cmd/plural/plural_test.go b/cmd/plural/plural_test.go index aa898b2c5..07fb1fb38 100644 --- a/cmd/plural/plural_test.go +++ b/cmd/plural/plural_test.go @@ -29,11 +29,9 @@ COMMANDS: link links a local package into an installation repo unlink unlinks a linked package help, h Shows a list of commands or help for one command - API: repos view and manage plural repositories api inspect the plural api - Debugging: watch watches applications until they become ready wait waits on applications until they become ready @@ -41,31 +39,25 @@ COMMANDS: proxy proxies into running processes in your cluster logs Commands for tailing logs for specific apps ops Commands for simplifying cluster operations - Miscellaneous: utils useful plural utilities vpn interacting with the plural vpn - Publishing: apply applys the current pluralfile test validate a values templace push utilities for pushing tf or helm packages template, tpl templates a helm chart to be uploaded to plural from-grafana imports a grafana dashboard to a plural crd - User Profile: login logs into plural and saves credentials to the current config profile import imports plural config from another file crypto plural encryption utilities config, conf reads/modifies cli configuration profile Commands for managing config profiles for plural - WKSPACE: create scaffolds the resources needed to create a new plural repository - WORKSPACE: repair commits any new encrypted changes in your local workspace automatically - Workspace: validate, v validates your workspace topsort, d renders a dependency-inferred topological sort of the installations in a workspace @@ -80,7 +72,7 @@ COMMANDS: GLOBAL OPTIONS: --profile-file FILE configure your config.yml profile FILE [$PLURAL_PROFILE_FILE] --encryption-key-file FILE configure your encryption key FILE [$PLURAL_ENCRYPTION_KEY_FILE] - --help, -h show help + --help, -h show help (default: false) ` func TestPluralApplication(t *testing.T) { diff --git a/cmd/plural/proxy.go b/cmd/plural/proxy.go index 8b9a51ae5..4cb020ea6 100644 --- a/cmd/plural/proxy.go +++ b/cmd/plural/proxy.go @@ -3,11 +3,11 @@ package main import ( "github.com/pluralsh/plural/pkg/config" "github.com/pluralsh/plural/pkg/proxy" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) -func (p *Plural) proxyCommands() []cli.Command { - return []cli.Command{ +func (p *Plural) proxyCommands() []*cli.Command { + return []*cli.Command{ { Name: "list", Usage: "lists proxy plugins for a repo", diff --git a/cmd/plural/push.go b/cmd/plural/push.go index 1ca97fd69..c652a41c2 100644 --- a/cmd/plural/push.go +++ b/cmd/plural/push.go @@ -17,11 +17,11 @@ import ( "github.com/pluralsh/plural/pkg/utils" "github.com/pluralsh/plural/pkg/utils/pathing" "github.com/pluralsh/plural/pkg/wkspace" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) -func (p *Plural) pushCommands() []cli.Command { - return []cli.Command{ +func (p *Plural) pushCommands() []*cli.Command { + return []*cli.Command{ { Name: "terraform", Usage: "pushes a terraform module", @@ -46,12 +46,12 @@ func (p *Plural) pushCommands() []cli.Command { ArgsUsage: "path/to/def.yaml REPO", Action: latestVersion(p.handleArtifact), Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "platform", Value: "mac", Usage: "name of the OS this binary is built for", }, - cli.StringFlag{ + &cli.StringFlag{ Name: "arch", Value: "amd64", Usage: "machine architecture the binary is compatible with", diff --git a/cmd/plural/repos.go b/cmd/plural/repos.go index 278401913..1e7469e1d 100644 --- a/cmd/plural/repos.go +++ b/cmd/plural/repos.go @@ -4,15 +4,15 @@ import ( "fmt" "strings" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" "github.com/pluralsh/plural/pkg/api" "github.com/pluralsh/plural/pkg/format" "github.com/pluralsh/plural/pkg/utils" ) -func (p *Plural) reposCommands() []cli.Command { - return []cli.Command{ +func (p *Plural) reposCommands() []*cli.Command { + return []*cli.Command{ { Name: "unlock", Usage: "unlocks installations in a repo that have breaking changes", @@ -29,11 +29,11 @@ func (p *Plural) reposCommands() []cli.Command { Usage: "list available repositories to install", ArgsUsage: "", Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "query", Usage: "string to search by", }, - cli.StringFlag{ + &cli.StringFlag{ Name: "format", Usage: "format to print the repositories out, eg csv or default is table", }, diff --git a/cmd/plural/scaffold.go b/cmd/plural/scaffold.go index 60361fbe4..f26b97d25 100644 --- a/cmd/plural/scaffold.go +++ b/cmd/plural/scaffold.go @@ -3,7 +3,7 @@ package main import ( "github.com/pluralsh/plural/pkg/api" "github.com/pluralsh/plural/pkg/scaffold" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) func handleScaffold(c *cli.Context) error { diff --git a/cmd/plural/shell.go b/cmd/plural/shell.go index f2d2aad28..6dd12322d 100644 --- a/cmd/plural/shell.go +++ b/cmd/plural/shell.go @@ -8,21 +8,21 @@ import ( "github.com/pluralsh/plural/pkg/crypto" "github.com/pluralsh/plural/pkg/utils" "github.com/pluralsh/plural/pkg/utils/git" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) -func shellCommands() []cli.Command { - return []cli.Command{ +func shellCommands() []*cli.Command { + return []*cli.Command{ { Name: "sync", Usage: "syncs the setup in your cloud shell locally", Action: latestVersion(handleShellSync), Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "endpoint", Usage: "the endpoint for the plural installation you're working with", }, - cli.StringFlag{ + &cli.StringFlag{ Name: "service-account", Usage: "email for the service account you'd like to use for this workspace", }, diff --git a/cmd/plural/template.go b/cmd/plural/template.go index 9332218cc..4f3ed7084 100644 --- a/cmd/plural/template.go +++ b/cmd/plural/template.go @@ -10,7 +10,7 @@ import ( "github.com/pluralsh/plural/pkg/api" "github.com/pluralsh/plural/pkg/config" "github.com/pluralsh/plural/pkg/template" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" k8sjson "k8s.io/apimachinery/pkg/runtime/serializer/json" "k8s.io/client-go/kubernetes/scheme" ) diff --git a/cmd/plural/utils.go b/cmd/plural/utils.go index b16a88f77..c258f7e87 100644 --- a/cmd/plural/utils.go +++ b/cmd/plural/utils.go @@ -12,22 +12,22 @@ import ( "github.com/pluralsh/plural/pkg/utils" "github.com/pluralsh/plural/pkg/utils/pathing" "github.com/thoas/go-funk" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" "gopkg.in/yaml.v2" ) -func utilsCommands() []cli.Command { - return []cli.Command{ +func utilsCommands() []*cli.Command { + return []*cli.Command{ { Name: "image-bump", ArgsUsage: "CHART", Usage: "Bumps a chart's image tag", Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "path", Usage: "path to tag in helm values file", }, - cli.StringFlag{ + &cli.StringFlag{ Name: "tag", Usage: "the image tag to set to", }, diff --git a/cmd/plural/validation.go b/cmd/plural/validation.go index 7f6bc9b88..ff02ed583 100644 --- a/cmd/plural/validation.go +++ b/cmd/plural/validation.go @@ -13,7 +13,7 @@ import ( "github.com/pluralsh/plural/pkg/utils/git" "github.com/pluralsh/plural/pkg/utils/pathing" "github.com/pluralsh/polly/algorithms" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) func requireArgs(fn func(*cli.Context) error, args []string) func(*cli.Context) error { diff --git a/cmd/plural/version.go b/cmd/plural/version.go index 9c6b7c71f..f5d9f7b4d 100644 --- a/cmd/plural/version.go +++ b/cmd/plural/version.go @@ -6,7 +6,7 @@ import ( "strings" "github.com/pluralsh/plural/pkg/utils" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) const ( diff --git a/cmd/plural/vpn.go b/cmd/plural/vpn.go index f6542cfce..500abf645 100644 --- a/cmd/plural/vpn.go +++ b/cmd/plural/vpn.go @@ -12,7 +12,7 @@ import ( "github.com/pluralsh/plural/pkg/utils" "github.com/pluralsh/plural/pkg/utils/pathing" "github.com/pluralsh/plural/pkg/vpn" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -24,8 +24,8 @@ const ( wireguardNotInstalledError = "wireguard is not installed. run `plural bundle list wireguard` to find the bundle to install" ) -func (p *Plural) vpnCommands() []cli.Command { - return []cli.Command{ +func (p *Plural) vpnCommands() []*cli.Command { + return []*cli.Command{ { Name: "list-servers", Usage: "lists vpn servers", @@ -36,7 +36,7 @@ func (p *Plural) vpnCommands() []cli.Command { Usage: "lists vpn clients for a server", Action: latestVersion(p.handleWireguardPeerList), Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "server", Usage: "the vpn server to list clients for", }, @@ -48,7 +48,7 @@ func (p *Plural) vpnCommands() []cli.Command { Usage: "create a new vpn client for a server", Action: latestVersion(requireArgs(p.handleWireguardPeerCreate, []string{"NAME"})), Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "server", Usage: "the vpn server to create the client for", }, @@ -60,7 +60,7 @@ func (p *Plural) vpnCommands() []cli.Command { Usage: "create a new vpn client for a server", Action: latestVersion(requireArgs(p.handleWireguardPeerDelete, []string{"NAME"})), Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "server", Usage: "the vpn server to delete the clients from", }, @@ -72,11 +72,11 @@ func (p *Plural) vpnCommands() []cli.Command { Usage: "get the config for a vpn client for a server", Action: latestVersion(requireArgs(p.handleWireguardPeerConfig, []string{"NAME"})), Flags: []cli.Flag{ - cli.StringFlag{ + &cli.StringFlag{ Name: "server", Usage: "the vpn server to get the client config from", }, - cli.StringFlag{ + &cli.StringFlag{ Name: "path", Usage: "output path for the config wireguard client config. the filename will be NAME.conf", }, diff --git a/cmd/plural/workspace.go b/cmd/plural/workspace.go index 73a50fa4c..2d432f2d4 100644 --- a/cmd/plural/workspace.go +++ b/cmd/plural/workspace.go @@ -10,11 +10,11 @@ import ( "github.com/pluralsh/plural/pkg/provider" "github.com/pluralsh/plural/pkg/utils" "github.com/pluralsh/plural/pkg/wkspace" - "github.com/urfave/cli" + "github.com/urfave/cli/v2" ) -func workspaceCommands() []cli.Command { - return []cli.Command{ +func workspaceCommands() []*cli.Command { + return []*cli.Command{ { Name: "kube-init", Usage: "generates kubernetes credentials for this subworkspace", @@ -25,11 +25,11 @@ func workspaceCommands() []cli.Command { Usage: "upgrade/installs the helm chart for this subworkspace", ArgsUsage: "NAME", Flags: []cli.Flag{ - cli.StringSliceFlag{ + &cli.StringSliceFlag{ Name: "skip", Usage: "helm sub-chart to skip. can be passed multiple times", }, - cli.BoolFlag{ + &cli.BoolFlag{ Name: "wait", Usage: "have helm wait until all pods are in ready state", }, diff --git a/go.mod b/go.mod index 62d74f905..09eb4b354 100644 --- a/go.mod +++ b/go.mod @@ -44,7 +44,8 @@ require ( github.com/rodaine/hclencoder v0.0.1 github.com/samber/lo v1.33.0 github.com/thoas/go-funk v0.9.2 - github.com/urfave/cli v1.22.10 + github.com/urfave/cli v1.22.2 + github.com/urfave/cli/v2 v2.23.5 github.com/xanzy/go-gitlab v0.70.0 golang.org/x/crypto v0.1.0 golang.org/x/mod v0.6.0 @@ -92,6 +93,7 @@ require ( github.com/pluralsh/controller-reconcile-helper v0.0.4 // indirect github.com/stretchr/objx v0.5.0 // indirect github.com/vektah/gqlparser/v2 v2.5.0 // indirect + github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -108,7 +110,7 @@ require ( github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect github.com/Azure/go-autorest/logger v0.2.1 // indirect github.com/Azure/go-autorest/tracing v0.6.0 // indirect - github.com/BurntSushi/toml v1.1.0 // indirect + github.com/BurntSushi/toml v1.2.1 // indirect github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd // indirect github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.1.1 diff --git a/go.sum b/go.sum index 6be9150db..ae4c3ff30 100644 --- a/go.sum +++ b/go.sum @@ -121,8 +121,8 @@ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBp github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I= -github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= +github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd h1:sjQovDkwrZp8u+gxLtPgKGjk5hCxuy2hrRejBTA9xFU= @@ -1077,8 +1077,10 @@ github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljT github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.10 h1:p8Fspmz3iTctJstry1PYS3HVdllxnEzTEsgIgtxTrCk= -github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= +github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli/v2 v2.23.5 h1:xbrU7tAYviSpqeR3X4nEFWUdB/uDZ6DE+HxmRU7Xtyw= +github.com/urfave/cli/v2 v2.23.5/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= github.com/vektah/gqlparser/v2 v2.5.0 h1:GwEwy7AJsqPWrey0bHnn+3JLaHLZVT66wY/+O+Tf9SU= github.com/vektah/gqlparser/v2 v2.5.0/go.mod h1:mPgqFBu/woKTVYWyNk8cO3kh4S/f4aRFZrvOnp3hmCs= @@ -1097,6 +1099,8 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca h1:1CFlNzQhALwjS9mBAUkycX616GzgsuYUOCHA5+HSlXI= github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=