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