Files
k3k/k3k-kubelet/config.go
Enrico CandinoandGitHub 18889ba6b7 Removed Pod mutating Webhook (shared mode) (#699)
* removed all webhook references

* fix tests

* removal of webhook

* updated doc

* add downward API test

* small refactor of virtual-kubelet

* split tests
2026-03-31 10:29:22 +02:00

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
}