Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge pull request kubernetes#65951 from luxas/kubeadm_joinconfig

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
Kubernetes Submit Queue committed Jul 14, 2018
2 parents d2387be + 21baef2 commit af8a1dba68f7d34c0cae45e1aaa1bc41c7299cc1
Showing with 358 additions and 356 deletions.
  1. +1 −1 cmd/kubeadm/app/apis/kubeadm/fuzzer/fuzzer.go
  2. +1 −1 cmd/kubeadm/app/apis/kubeadm/register.go
  3. +9 −9 cmd/kubeadm/app/apis/kubeadm/types.go
  4. +3 −3 cmd/kubeadm/app/apis/kubeadm/v1alpha2/defaults.go
  5. +1 −3 cmd/kubeadm/app/apis/kubeadm/v1alpha2/register.go
  6. +2 −2 cmd/kubeadm/app/apis/kubeadm/v1alpha2/types.go
  7. +48 −48 cmd/kubeadm/app/apis/kubeadm/v1alpha2/zz_generated.conversion.go
  8. +48 −48 cmd/kubeadm/app/apis/kubeadm/v1alpha2/zz_generated.deepcopy.go
  9. +3 −3 cmd/kubeadm/app/apis/kubeadm/v1alpha2/zz_generated.defaults.go
  10. +3 −3 cmd/kubeadm/app/apis/kubeadm/v1alpha3/defaults.go
  11. +1 −1 cmd/kubeadm/app/apis/kubeadm/v1alpha3/register.go
  12. +2 −2 cmd/kubeadm/app/apis/kubeadm/v1alpha3/types.go
  13. +48 −48 cmd/kubeadm/app/apis/kubeadm/v1alpha3/zz_generated.conversion.go
  14. +48 −48 cmd/kubeadm/app/apis/kubeadm/v1alpha3/zz_generated.deepcopy.go
  15. +3 −3 cmd/kubeadm/app/apis/kubeadm/v1alpha3/zz_generated.defaults.go
  16. +4 −4 cmd/kubeadm/app/apis/kubeadm/validation/validation.go
  17. +28 −28 cmd/kubeadm/app/apis/kubeadm/validation/validation_test.go
  18. +48 −48 cmd/kubeadm/app/apis/kubeadm/zz_generated.deepcopy.go
  19. +4 −4 cmd/kubeadm/app/cmd/config.go
  20. +5 −5 cmd/kubeadm/app/cmd/join.go
  21. +2 −2 cmd/kubeadm/app/cmd/join_test.go
  22. +4 −4 cmd/kubeadm/app/cmd/phases/kubelet.go
  23. +1 −1 cmd/kubeadm/app/cmd/phases/preflight.go
  24. +5 −1 cmd/kubeadm/app/constants/constants.go
  25. +2 −2 cmd/kubeadm/app/discovery/discovery.go
  26. +6 −6 cmd/kubeadm/app/discovery/discovery_test.go
  27. +1 −1 cmd/kubeadm/app/discovery/token/token.go
  28. +1 −1 cmd/kubeadm/app/preflight/checks.go
  29. +4 −4 cmd/kubeadm/app/preflight/checks_test.go
  30. +3 −3 cmd/kubeadm/app/util/config/common.go
  31. +2 −2 cmd/kubeadm/app/util/config/common_test.go
  32. +5 −5 cmd/kubeadm/app/util/config/nodeconfig.go
  33. +1 −1 cmd/kubeadm/app/util/config/nodeconfig_test.go
  34. +1 −1 cmd/kubeadm/app/util/config/testdata/conversion/node/v1alpha3.yaml
  35. +1 −1 cmd/kubeadm/app/util/config/testdata/defaulting/node/defaulted.yaml
  36. +3 −3 cmd/kubeadm/app/util/marshal.go
  37. +6 −6 cmd/kubeadm/app/util/marshal_test.go
@@ -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"
@@ -47,7 +47,7 @@ func Resource(resource string) schema.GroupResource {
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&InitConfiguration{},
&NodeConfiguration{},
&JoinConfiguration{},
)
return nil
}
@@ -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
@@ -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
@@ -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 ""
}
@@ -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
)

@@ -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
}
@@ -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
}
@@ -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

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -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
)

@@ -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
}
@@ -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
Oops, something went wrong.

0 comments on commit af8a1db

Please sign in to comment.
You can’t perform that action at this time.