mirror of
https://github.com/rancher/steve.git
synced 2025-09-01 15:37:31 +00:00
testing
This commit is contained in:
@@ -15,7 +15,6 @@ type Config struct {
|
||||
KubeConfig string
|
||||
HTTPSListenPort int
|
||||
HTTPListenPort int
|
||||
DashboardURL string
|
||||
Authentication bool
|
||||
|
||||
WebhookConfig authcli.WebhookConfig
|
||||
@@ -31,8 +30,7 @@ func (c *Config) MustServer(ctx context.Context) *server.Server {
|
||||
|
||||
func (c *Config) ToServer(ctx context.Context) (*server.Server, error) {
|
||||
var (
|
||||
auth steveauth.Middleware
|
||||
startHooks []server.StartHook
|
||||
auth steveauth.Middleware
|
||||
)
|
||||
|
||||
restConfig, err := kubeconfig.GetNonInteractiveClientConfig(c.KubeConfig).ClientConfig()
|
||||
@@ -48,14 +46,9 @@ func (c *Config) ToServer(ctx context.Context) (*server.Server, error) {
|
||||
}
|
||||
}
|
||||
|
||||
return &server.Server{
|
||||
RESTConfig: restConfig,
|
||||
return server.New(ctx, restConfig, &server.Options{
|
||||
AuthMiddleware: auth,
|
||||
DashboardURL: func() string {
|
||||
return c.DashboardURL
|
||||
},
|
||||
StartHooks: startHooks,
|
||||
}, nil
|
||||
})
|
||||
}
|
||||
|
||||
func Flags(config *Config) []cli.Flag {
|
||||
@@ -75,11 +68,6 @@ func Flags(config *Config) []cli.Flag {
|
||||
Value: 9080,
|
||||
Destination: &config.HTTPListenPort,
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "dashboard-url",
|
||||
Value: "https://releases.rancher.com/dashboard/latest/index.html",
|
||||
Destination: &config.DashboardURL,
|
||||
},
|
||||
cli.BoolTFlag{
|
||||
Name: "authentication",
|
||||
Destination: &config.Authentication,
|
||||
|
Reference in New Issue
Block a user