Skip to content
This repository has been archived by the owner on Apr 8, 2019. It is now read-only.

Commit

Permalink
Merge pull request kubernetes#65951 from luxas/kubeadm_joinconfig
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 66138, 65951). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Rename `NodeConfiguration` to `JoinConfiguration` in the kubeadm v1alpha3 Config API

**What this PR does / why we need it**:
In v1alpha3, we have made the design decision that `NodeConfiguration` will be renamed `JoinConfiguration`. This PR implements that change. 

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
ref: kubernetes/kubeadm#911
Depends on:
 - [x] kubernetes#65776
 - [x] kubernetes#65628
 - [x] kubernetes#65629
 - [x] kubernetes#65631
 - [x] kubernetes#65940
 - [x] kubernetes#65787
 - [ ] kubernetes#65945

**Special notes for your reviewer**:

Please only review the last three commits here.

**Release note**:

```release-note
[action required] The `NodeConfiguration` kind in the kubeadm v1alpha2 API has been renamed `JoinConfiguration` in v1alpha3
```
@kubernetes/sig-cluster-lifecycle-pr-reviews
  • Loading branch information
Kubernetes Submit Queue authored Jul 14, 2018
2 parents d2387be + 21baef2 commit af8a1db
Show file tree
Hide file tree
Showing 37 changed files with 358 additions and 356 deletions.
2 changes: 1 addition & 1 deletion cmd/kubeadm/app/apis/kubeadm/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func Funcs(codecs runtimeserializer.CodecFactory) []interface{} {
componentconfigs.Scheme.Convert(extkubeproxyconfig, obj.ComponentConfigs.KubeProxy, nil)
componentconfigs.DefaultKubeProxyConfiguration(obj)
},
func(obj *kubeadm.NodeConfiguration, c fuzz.Continue) {
func(obj *kubeadm.JoinConfiguration, c fuzz.Continue) {
c.FuzzNoCustom(obj)
obj.CACertPath = "foo"
obj.DiscoveryFile = "foo"
Expand Down
2 changes: 1 addition & 1 deletion cmd/kubeadm/app/apis/kubeadm/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func Resource(resource string) schema.GroupResource {
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&InitConfiguration{},
&NodeConfiguration{},
&JoinConfiguration{},
)
return nil
}
18 changes: 9 additions & 9 deletions cmd/kubeadm/app/apis/kubeadm/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ type ExternalEtcd struct {

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// NodeConfiguration contains elements describing a particular node.
// JoinConfiguration contains elements describing a particular node.
// TODO: This struct should be replaced by dynamic kubelet configuration.
type NodeConfiguration struct {
type JoinConfiguration struct {
metav1.TypeMeta

// NodeRegistration holds fields that relate to registering the new master node to the cluster
Expand Down Expand Up @@ -344,7 +344,7 @@ type AuditPolicyConfiguration struct {
}

// CommonConfiguration defines the list of common configuration elements and the getter
// methods that must exist for both the InitConfiguration and NodeConfiguration objects.
// methods that must exist for both the InitConfiguration and JoinConfiguration objects.
// This is used internally to deduplicate the kubeadm preflight checks.
type CommonConfiguration interface {
GetCRISocket() string
Expand All @@ -370,22 +370,22 @@ func (cfg *InitConfiguration) GetKubernetesVersion() string {
return cfg.KubernetesVersion
}

// GetCRISocket will return the CRISocket that is defined for the NodeConfiguration.
// GetCRISocket will return the CRISocket that is defined for the JoinConfiguration.
// This is used internally to deduplicate the kubeadm preflight checks.
func (cfg *NodeConfiguration) GetCRISocket() string {
func (cfg *JoinConfiguration) GetCRISocket() string {
return cfg.NodeRegistration.CRISocket
}

// GetNodeName will return the NodeName that is defined for the NodeConfiguration.
// GetNodeName will return the NodeName that is defined for the JoinConfiguration.
// This is used internally to deduplicate the kubeadm preflight checks.
func (cfg *NodeConfiguration) GetNodeName() string {
func (cfg *JoinConfiguration) GetNodeName() string {
return cfg.NodeRegistration.Name
}

// GetKubernetesVersion will return an empty string since KubernetesVersion is not a
// defined property for NodeConfiguration. This will just cause the regex validation
// defined property for JoinConfiguration. This will just cause the regex validation
// of the defined version to be skipped during the preflight checks.
// This is used internally to deduplicate the kubeadm preflight checks.
func (cfg *NodeConfiguration) GetKubernetesVersion() string {
func (cfg *JoinConfiguration) GetKubernetesVersion() string {
return ""
}
6 changes: 3 additions & 3 deletions cmd/kubeadm/app/apis/kubeadm/v1alpha2/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const (
// KubeproxyKubeConfigFileName defines the file name for the kube-proxy's KubeConfig file
KubeproxyKubeConfigFileName = "/var/lib/kube-proxy/kubeconfig.conf"

// DefaultDiscoveryTimeout specifies the default discovery timeout for kubeadm (used unless one is specified in the NodeConfiguration)
// DefaultDiscoveryTimeout specifies the default discovery timeout for kubeadm (used unless one is specified in the JoinConfiguration)
DefaultDiscoveryTimeout = 5 * time.Minute
)

Expand Down Expand Up @@ -143,8 +143,8 @@ func SetDefaults_ProxyConfiguration(obj *InitConfiguration) {
kubeproxyscheme.Scheme.Default(obj.KubeProxy.Config)
}

// SetDefaults_NodeConfiguration assigns default values to a regular node
func SetDefaults_NodeConfiguration(obj *NodeConfiguration) {
// SetDefaults_JoinConfiguration assigns default values to a regular node
func SetDefaults_JoinConfiguration(obj *JoinConfiguration) {
if obj.CACertPath == "" {
obj.CACertPath = DefaultCACertPath
}
Expand Down
4 changes: 1 addition & 3 deletions cmd/kubeadm/app/apis/kubeadm/v1alpha2/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ func Resource(resource string) schema.GroupResource {
}

func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&NodeConfiguration{},
)
scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("MasterConfiguration"), &InitConfiguration{})
scheme.AddKnownTypeWithName(SchemeGroupVersion.WithKind("NodeConfiguration"), &JoinConfiguration{})
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
4 changes: 2 additions & 2 deletions cmd/kubeadm/app/apis/kubeadm/v1alpha2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ type ExternalEtcd struct {

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// NodeConfiguration contains elements describing a particular node.
// JoinConfiguration contains elements describing a particular node.
// TODO: This struct should be replaced by dynamic kubelet configuration.
type NodeConfiguration struct {
type JoinConfiguration struct {
metav1.TypeMeta `json:",inline"`

// NodeRegistration holds fields that relate to registering the new master node to the cluster
Expand Down
96 changes: 48 additions & 48 deletions cmd/kubeadm/app/apis/kubeadm/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

96 changes: 48 additions & 48 deletions cmd/kubeadm/app/apis/kubeadm/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions cmd/kubeadm/app/apis/kubeadm/v1alpha3/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const (
DefaultProxyBindAddressv4 = "0.0.0.0"
// DefaultProxyBindAddressv6 is the default bind address when the advertise address is v6
DefaultProxyBindAddressv6 = "::"
// DefaultDiscoveryTimeout specifies the default discovery timeout for kubeadm (used unless one is specified in the NodeConfiguration)
// DefaultDiscoveryTimeout specifies the default discovery timeout for kubeadm (used unless one is specified in the JoinConfiguration)
DefaultDiscoveryTimeout = 5 * time.Minute
)

Expand Down Expand Up @@ -115,8 +115,8 @@ func SetDefaults_Etcd(obj *InitConfiguration) {
}
}

// SetDefaults_NodeConfiguration assigns default values to a regular node
func SetDefaults_NodeConfiguration(obj *NodeConfiguration) {
// SetDefaults_JoinConfiguration assigns default values to a regular node
func SetDefaults_JoinConfiguration(obj *JoinConfiguration) {
if obj.CACertPath == "" {
obj.CACertPath = DefaultCACertPath
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/kubeadm/app/apis/kubeadm/v1alpha3/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func Resource(resource string) schema.GroupResource {
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&InitConfiguration{},
&NodeConfiguration{},
&JoinConfiguration{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
Expand Down
Loading

0 comments on commit af8a1db

Please sign in to comment.