mirror of
https://github.com/rancher/k3k.git
synced 2026-08-18 03:46:31 +00:00
* removed all webhook references * fix tests * removal of webhook * updated doc * add downward API test * small refactor of virtual-kubelet * split tests
37 lines
1018 B
Go
37 lines
1018 B
Go
package main
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
// config has all virtual-kubelet startup options
|
|
type config struct {
|
|
ClusterName string `mapstructure:"clusterName"`
|
|
ClusterNamespace string `mapstructure:"clusterNamespace"`
|
|
ServiceName string `mapstructure:"serviceName"`
|
|
Token string `mapstructure:"token"`
|
|
AgentHostname string `mapstructure:"agentHostname"`
|
|
HostKubeconfig string `mapstructure:"hostKubeconfig"`
|
|
VirtKubeconfig string `mapstructure:"virtKubeconfig"`
|
|
KubeletPort int `mapstructure:"kubeletPort"`
|
|
ServerIP string `mapstructure:"serverIP"`
|
|
Version string `mapstructure:"version"`
|
|
MirrorHostNodes bool `mapstructure:"mirrorHostNodes"`
|
|
}
|
|
|
|
func (c *config) validate() error {
|
|
if c.ClusterName == "" {
|
|
return errors.New("cluster name is not provided")
|
|
}
|
|
|
|
if c.ClusterNamespace == "" {
|
|
return errors.New("cluster namespace is not provided")
|
|
}
|
|
|
|
if c.AgentHostname == "" {
|
|
return errors.New("agent Hostname is not provided")
|
|
}
|
|
|
|
return nil
|
|
}
|