mirror of
https://github.com/rancher/steve.git
synced 2025-09-07 18:31:13 +00:00
webhook setup requires rest.Config now
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
@@ -38,7 +39,12 @@ func (w *WebhookConfig) WebhookMiddleware() (auth.Middleware, error) {
|
||||
config = tempFile
|
||||
}
|
||||
|
||||
return auth.NewWebhookMiddleware(time.Duration(w.CacheTTLSeconds)*time.Second, config)
|
||||
kubeConfig, err := clientcmd.BuildConfigFromFlags("", config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return auth.NewWebhookMiddleware(time.Duration(w.CacheTTLSeconds)*time.Second, kubeConfig)
|
||||
}
|
||||
|
||||
func Flags(config *WebhookConfig) []cli.Flag {
|
||||
|
Reference in New Issue
Block a user