2020-04-27 17:09:58 +00:00
|
|
|
package executor
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"k8s.io/apiserver/pkg/authentication/authenticator"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Executor interface {
|
|
|
|
Kubelet(args []string) error
|
|
|
|
KubeProxy(args []string) error
|
|
|
|
APIServer(ctx context.Context, args []string) (authenticator.Request, http.Handler, error)
|
2020-04-28 22:44:05 +00:00
|
|
|
Scheduler(apiReady <-chan struct{}, args []string) error
|
|
|
|
ControllerManager(apiReady <-chan struct{}, args []string) error
|
2020-04-27 17:09:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
|
|
|
executor Executor
|
|
|
|
)
|
|
|
|
|
|
|
|
func Set(driver Executor) {
|
|
|
|
executor = driver
|
|
|
|
}
|
|
|
|
|
|
|
|
func Kubelet(args []string) error {
|
|
|
|
return executor.Kubelet(args)
|
|
|
|
}
|
|
|
|
|
|
|
|
func KubeProxy(args []string) error {
|
|
|
|
return executor.KubeProxy(args)
|
|
|
|
}
|
|
|
|
|
|
|
|
func APIServer(ctx context.Context, args []string) (authenticator.Request, http.Handler, error) {
|
|
|
|
return executor.APIServer(ctx, args)
|
|
|
|
}
|
|
|
|
|
2020-04-28 22:44:05 +00:00
|
|
|
func Scheduler(apiReady <-chan struct{}, args []string) error {
|
|
|
|
return executor.Scheduler(apiReady, args)
|
2020-04-27 17:09:58 +00:00
|
|
|
}
|
|
|
|
|
2020-04-28 22:44:05 +00:00
|
|
|
func ControllerManager(apiReady <-chan struct{}, args []string) error {
|
|
|
|
return executor.ControllerManager(apiReady, args)
|
2020-04-27 17:09:58 +00:00
|
|
|
}
|