mirror of
https://github.com/hauler-dev/hauler.git
synced 2026-05-17 06:37:18 +00:00
29 lines
613 B
Go
29 lines
613 B
Go
package bootstrap
|
|
|
|
import (
|
|
"k8s.io/cli-runtime/pkg/genericclioptions"
|
|
)
|
|
|
|
type BootSettings struct {
|
|
config *genericclioptions.ConfigFlags
|
|
Namespace string
|
|
KubeConfig string
|
|
}
|
|
|
|
func NewBootConfig(ns, kubepath string) *BootSettings {
|
|
env := &BootSettings{
|
|
Namespace: ns,
|
|
KubeConfig: kubepath,
|
|
}
|
|
|
|
env.config = &genericclioptions.ConfigFlags{
|
|
Namespace: &env.Namespace,
|
|
KubeConfig: &env.KubeConfig,
|
|
}
|
|
return env
|
|
}
|
|
|
|
// RESTClientGetter gets the kubeconfig from BootSettings
|
|
func (s *BootSettings) RESTClientGetter() genericclioptions.RESTClientGetter {
|
|
return s.config
|
|
} |