mirror of https://github.com/k3s-io/k3s
Remove the default clustername, and make it optional in api
parent
24d6483558
commit
169792b3fb
|
@ -191,6 +191,7 @@ func SetDefaults_NodeConfiguration(obj *NodeConfiguration) {
|
|||
obj.DiscoveryTimeout = &metav1.Duration{
|
||||
Duration: DefaultDiscoveryTimeout,
|
||||
}
|
||||
}
|
||||
if obj.ClusterName == "" {
|
||||
obj.ClusterName = DefaultClusterName
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ type MasterConfiguration struct {
|
|||
FeatureGates map[string]bool `json:"featureGates,omitempty"`
|
||||
|
||||
// The cluster name
|
||||
ClusterName string `json:"clusterName"`
|
||||
ClusterName string `json:"clusterName,omitempty"`
|
||||
}
|
||||
|
||||
// API struct contains elements of API server address.
|
||||
|
@ -230,7 +230,7 @@ type NodeConfiguration struct {
|
|||
// CRISocket is used to retrieve container runtime info.
|
||||
CRISocket string `json:"criSocket,omitempty"`
|
||||
// ClusterName is the name for the cluster in kubeconfig.
|
||||
ClusterName string `json:"clusterName"`
|
||||
ClusterName string `json:"clusterName,omitempty"`
|
||||
|
||||
// DiscoveryTokenCACertHashes specifies a set of public key pins to verify
|
||||
// when token-based discovery is used. The root CA found during discovery
|
||||
|
|
|
@ -108,7 +108,7 @@ var (
|
|||
|
||||
// NewCmdInit returns "kubeadm init" command.
|
||||
func NewCmdInit(out io.Writer) *cobra.Command {
|
||||
cfg := &kubeadmapiext.MasterConfiguration{ClusterName: "kubernetes"}
|
||||
cfg := &kubeadmapiext.MasterConfiguration{}
|
||||
legacyscheme.Scheme.Default(cfg)
|
||||
|
||||
var cfgPath string
|
||||
|
|
|
@ -102,7 +102,7 @@ var (
|
|||
|
||||
// NewCmdJoin returns "kubeadm join" command.
|
||||
func NewCmdJoin(out io.Writer) *cobra.Command {
|
||||
cfg := &kubeadmapiext.NodeConfiguration{ClusterName: "kubernetes"}
|
||||
cfg := &kubeadmapiext.NodeConfiguration{}
|
||||
legacyscheme.Scheme.Default(cfg)
|
||||
|
||||
var skipPreFlight bool
|
||||
|
|
Loading…
Reference in New Issue