Skip to content

Commit

Permalink
Remove the default clustername, and make it optional in api
Browse files Browse the repository at this point in the history
  • Loading branch information
karan committed Apr 11, 2018
1 parent 24d6483 commit 169792b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions cmd/kubeadm/app/apis/kubeadm/v1alpha1/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ func SetDefaults_NodeConfiguration(obj *NodeConfiguration) {
obj.DiscoveryTimeout = &metav1.Duration{
Duration: DefaultDiscoveryTimeout,
}
}
if obj.ClusterName == "" {
obj.ClusterName = DefaultClusterName
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/kubeadm/app/apis/kubeadm/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/kubeadm/app/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/kubeadm/app/cmd/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 169792b

Please sign in to comment.