mirror of
https://github.com/rancher/steve.git
synced 2025-05-10 00:47:07 +00:00
Update urfave/cli to v2 (#523)
This commit is contained in:
parent
5ae8585e5d
commit
da9bc2a114
1
go.mod
1
go.mod
@ -29,7 +29,6 @@ require (
|
||||
github.com/rancher/wrangler/v3 v3.2.0-rc.3
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
github.com/stretchr/testify v1.10.0
|
||||
github.com/urfave/cli v1.22.16
|
||||
github.com/urfave/cli/v2 v2.27.5
|
||||
go.uber.org/mock v0.5.0
|
||||
golang.org/x/sync v0.11.0
|
||||
|
6
go.sum
6
go.sum
@ -11,7 +11,6 @@ github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxB
|
||||
github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
|
||||
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||
github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0=
|
||||
github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
|
||||
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
|
||||
@ -256,21 +255,16 @@ github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8w
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk=
|
||||
github.com/urfave/cli v1.22.16 h1:MH0k6uJxdwdeWQTwhSO42Pwr4YLrNLwBtg1MRgTqPdQ=
|
||||
github.com/urfave/cli v1.22.16/go.mod h1:EeJR6BKodywf4zciqrdw6hpCPk68JO9z5LazXZMn5Po=
|
||||
github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w=
|
||||
github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
|
||||
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
|
||||
|
2
main.go
2
main.go
@ -9,7 +9,7 @@ import (
|
||||
"github.com/rancher/steve/pkg/version"
|
||||
"github.com/rancher/wrangler/v3/pkg/signals"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -5,7 +5,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/rancher/steve/pkg/auth"
|
||||
"github.com/urfave/cli"
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
)
|
||||
|
||||
@ -49,24 +50,24 @@ func (w *WebhookConfig) WebhookMiddleware() (auth.Middleware, error) {
|
||||
|
||||
func Flags(config *WebhookConfig) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
cli.BoolFlag{
|
||||
&cli.BoolFlag{
|
||||
Name: "webhook-auth",
|
||||
EnvVar: "WEBHOOK_AUTH",
|
||||
EnvVars: []string{"WEBHOOK_AUTH"},
|
||||
Destination: &config.WebhookAuthentication,
|
||||
},
|
||||
cli.StringFlag{
|
||||
&cli.StringFlag{
|
||||
Name: "webhook-kubeconfig",
|
||||
EnvVar: "WEBHOOK_KUBECONFIG",
|
||||
EnvVars: []string{"WEBHOOK_KUBECONFIG"},
|
||||
Destination: &config.WebhookKubeconfig,
|
||||
},
|
||||
cli.StringFlag{
|
||||
&cli.StringFlag{
|
||||
Name: "webhook-url",
|
||||
EnvVar: "WEBHOOK_URL",
|
||||
EnvVars: []string{"WEBHOOK_URL"},
|
||||
Destination: &config.WebhookURL,
|
||||
},
|
||||
cli.IntFlag{
|
||||
&cli.IntFlag{
|
||||
Name: "webhook-cache-ttl",
|
||||
EnvVar: "WEBHOOK_CACHE_TTL",
|
||||
EnvVars: []string{"WEBHOOK_CACHE_TTL"},
|
||||
Destination: &config.CacheTTLSeconds,
|
||||
},
|
||||
}
|
||||
|
@ -5,8 +5,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli"
|
||||
cliv2 "github.com/urfave/cli/v2"
|
||||
"github.com/urfave/cli/v2"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
@ -46,34 +45,16 @@ func (c *Config) SetupDebug() error {
|
||||
|
||||
func Flags(config *Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
cli.BoolFlag{
|
||||
&cli.BoolFlag{
|
||||
Name: "debug",
|
||||
Destination: &config.Debug,
|
||||
},
|
||||
cli.IntFlag{
|
||||
&cli.IntFlag{
|
||||
Name: "debug-level",
|
||||
Value: 7,
|
||||
Destination: &config.DebugLevel,
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "sql-cache",
|
||||
Destination: &config.SQLCache,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func FlagsV2(config *Config) []cliv2.Flag {
|
||||
return []cliv2.Flag{
|
||||
&cliv2.BoolFlag{
|
||||
Name: "debug",
|
||||
Destination: &config.Debug,
|
||||
},
|
||||
&cliv2.IntFlag{
|
||||
Name: "debug-level",
|
||||
Value: 7,
|
||||
Destination: &config.DebugLevel,
|
||||
},
|
||||
&cliv2.BoolFlag{
|
||||
&cli.BoolFlag{
|
||||
Name: "sql-cache",
|
||||
Destination: &config.SQLCache,
|
||||
},
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
"github.com/rancher/steve/pkg/ui"
|
||||
"github.com/rancher/wrangler/v3/pkg/kubeconfig"
|
||||
"github.com/rancher/wrangler/v3/pkg/ratelimit"
|
||||
"github.com/urfave/cli"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
@ -57,26 +57,26 @@ func (c *Config) ToServer(ctx context.Context, sqlCache bool) (*server.Server, e
|
||||
|
||||
func Flags(config *Config) []cli.Flag {
|
||||
flags := []cli.Flag{
|
||||
cli.StringFlag{
|
||||
&cli.StringFlag{
|
||||
Name: "kubeconfig",
|
||||
EnvVar: "KUBECONFIG",
|
||||
EnvVars: []string{"KUBECONFIG"},
|
||||
Destination: &config.KubeConfig,
|
||||
},
|
||||
cli.StringFlag{
|
||||
&cli.StringFlag{
|
||||
Name: "context",
|
||||
EnvVar: "CONTEXT",
|
||||
EnvVars: []string{"CONTEXT"},
|
||||
Destination: &config.Context,
|
||||
},
|
||||
cli.StringFlag{
|
||||
&cli.StringFlag{
|
||||
Name: "ui-path",
|
||||
Destination: &config.UIPath,
|
||||
},
|
||||
cli.IntFlag{
|
||||
&cli.IntFlag{
|
||||
Name: "https-listen-port",
|
||||
Value: 9443,
|
||||
Destination: &config.HTTPSListenPort,
|
||||
},
|
||||
cli.IntFlag{
|
||||
&cli.IntFlag{
|
||||
Name: "http-listen-port",
|
||||
Value: 9080,
|
||||
Destination: &config.HTTPListenPort,
|
||||
|
Loading…
Reference in New Issue
Block a user