From 0c31d1fb84f49e809c5eea5296fdd05500e90ac0 Mon Sep 17 00:00:00 2001 From: Daniel Lipovetsky Date: Tue, 16 Oct 2018 22:19:56 -0700 Subject: [PATCH] Rename ProviderConfig to ProviderSpec --- CONTRIBUTING.md | 2 +- config/crds/cluster_v1alpha1_cluster.yaml | 2 +- config/crds/cluster_v1alpha1_machine.yaml | 4 ++-- .../crds/cluster_v1alpha1_machineclass.yaml | 4 ++-- .../cluster_v1alpha1_machinedeployment.yaml | 4 ++-- config/crds/cluster_v1alpha1_machineset.yaml | 4 ++-- docs/proposals/machine-api-proposal.md | 6 ++--- pkg/apis/cluster/common/consts.go | 4 ++-- pkg/apis/cluster/v1alpha1/cluster_types.go | 2 +- pkg/apis/cluster/v1alpha1/common_types.go | 10 ++++---- pkg/apis/cluster/v1alpha1/machine_types.go | 2 +- .../cluster/v1alpha1/machineclass_types.go | 2 +- .../cluster/v1alpha1/zz_generated.deepcopy.go | 24 +++++++++---------- sample/machineclass.yaml | 10 ++++---- sample/machinedeployment.yaml | 2 +- sample/machineset.yaml | 2 +- 16 files changed, 42 insertions(+), 42 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 628d62a121b2..a635b9d7ee1a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -101,7 +101,7 @@ for machine in machines: upgrade machine ``` -The specific upgrade logic will be implement as part of the machine controller, and is specific to the provider. The user provided provider config will be in `machine.Spec.ProviderConfig`. +The specific upgrade logic will be implement as part of the machine controller, and is specific to the provider. The user provided provider config will be in `machine.Spec.ProviderSpec`. Discussion around in-place vs replace upgrades [is here](https://github.com/kubernetes/community/blob/master/keps/sig-cluster-lifecycle/0003-cluster-api.md#in-place-vs-replace). diff --git a/config/crds/cluster_v1alpha1_cluster.yaml b/config/crds/cluster_v1alpha1_cluster.yaml index 5d510f025c0f..ac8250c70746 100644 --- a/config/crds/cluster_v1alpha1_cluster.yaml +++ b/config/crds/cluster_v1alpha1_cluster.yaml @@ -51,7 +51,7 @@ spec: - pods - serviceDomain type: object - providerConfig: + providerSpec: properties: value: type: object diff --git a/config/crds/cluster_v1alpha1_machine.yaml b/config/crds/cluster_v1alpha1_machine.yaml index ee1d3bed4347..fb494e99eeac 100644 --- a/config/crds/cluster_v1alpha1_machine.yaml +++ b/config/crds/cluster_v1alpha1_machine.yaml @@ -28,7 +28,7 @@ spec: type: object metadata: type: object - providerConfig: + providerSpec: properties: value: type: object @@ -55,7 +55,7 @@ spec: - kubelet type: object required: - - providerConfig + - providerSpec type: object status: properties: diff --git a/config/crds/cluster_v1alpha1_machineclass.yaml b/config/crds/cluster_v1alpha1_machineclass.yaml index c89ef40185b6..5de01dc5826f 100644 --- a/config/crds/cluster_v1alpha1_machineclass.yaml +++ b/config/crds/cluster_v1alpha1_machineclass.yaml @@ -20,10 +20,10 @@ spec: type: string metadata: type: object - providerConfig: + providerSpec: type: object required: - - providerConfig + - providerSpec version: v1alpha1 status: acceptedNames: diff --git a/config/crds/cluster_v1alpha1_machinedeployment.yaml b/config/crds/cluster_v1alpha1_machinedeployment.yaml index 3592e00414ac..d007c3a572a9 100644 --- a/config/crds/cluster_v1alpha1_machinedeployment.yaml +++ b/config/crds/cluster_v1alpha1_machinedeployment.yaml @@ -60,7 +60,7 @@ spec: type: object metadata: type: object - providerConfig: + providerSpec: properties: value: type: object @@ -87,7 +87,7 @@ spec: - kubelet type: object required: - - providerConfig + - providerSpec type: object type: object required: diff --git a/config/crds/cluster_v1alpha1_machineset.yaml b/config/crds/cluster_v1alpha1_machineset.yaml index 7522abc3cd65..9849542f3fa9 100644 --- a/config/crds/cluster_v1alpha1_machineset.yaml +++ b/config/crds/cluster_v1alpha1_machineset.yaml @@ -42,7 +42,7 @@ spec: type: object metadata: type: object - providerConfig: + providerSpec: properties: value: type: object @@ -69,7 +69,7 @@ spec: - kubelet type: object required: - - providerConfig + - providerSpec type: object type: object required: diff --git a/docs/proposals/machine-api-proposal.md b/docs/proposals/machine-api-proposal.md index a7141e9e3c0b..971973a871fb 100644 --- a/docs/proposals/machine-api-proposal.md +++ b/docs/proposals/machine-api-proposal.md @@ -41,15 +41,15 @@ provider-specific controller, and should be deleted as well. Fields like the kubelet version are modeled as fields on the Machine's spec. Any other information that is provider-specific, though, is part of an opaque -ProviderConfig string that is not portable between different providers. +ProviderSpec string that is not portable between different providers. -The ProviderConfig is recommended to be a serialized API object in a format +The ProviderSpec is recommended to be a serialized API object in a format owned by that provider, akin to the [Component Config](https://goo.gl/opSc2o) pattern. This will allow the configuration to be strongly typed, versioned, and have as much nested depth as appropriate. These provider-specific API definitions are meant to live outside of the Machines API, which will allow them to evolve independently of it. Attributes like instance type, which network to -use, and the OS image all belong in the ProviderConfig. +use, and the OS image all belong in the ProviderSpec. ## In-place vs. Replace diff --git a/pkg/apis/cluster/common/consts.go b/pkg/apis/cluster/common/consts.go index 6990f76ebba0..e861b0e72300 100644 --- a/pkg/apis/cluster/common/consts.go +++ b/pkg/apis/cluster/common/consts.go @@ -25,7 +25,7 @@ const ( // is not supported by this cluster. This is not a transient error, but // indicates a state that must be fixed before progress can be made. // - // Example: the ProviderConfig specifies an instance type that doesn't exist, + // Example: the ProviderSpec specifies an instance type that doesn't exist, InvalidConfigurationMachineError MachineStatusError = "InvalidConfiguration" // This indicates that the MachineSpec has been updated in a way that @@ -92,7 +92,7 @@ const ( // is not supported by this cluster. This is not a transient error, but // indicates a state that must be fixed before progress can be made. // - // Example: the ProviderConfig specifies an instance type that doesn't exist. + // Example: the ProviderSpec specifies an instance type that doesn't exist. InvalidConfigurationMachineSetError MachineSetStatusError = "InvalidConfiguration" ) diff --git a/pkg/apis/cluster/v1alpha1/cluster_types.go b/pkg/apis/cluster/v1alpha1/cluster_types.go index 0aabc0c98f0e..a135220a63fb 100644 --- a/pkg/apis/cluster/v1alpha1/cluster_types.go +++ b/pkg/apis/cluster/v1alpha1/cluster_types.go @@ -50,7 +50,7 @@ type ClusterSpec struct { // their own versioned API types that should be // serialized/deserialized from this field. // +optional - ProviderConfig ProviderConfig `json:"providerConfig,omitempty"` + ProviderSpec ProviderSpec `json:"providerSpec,omitempty"` } // ClusterNetworkingConfig specifies the different networking diff --git a/pkg/apis/cluster/v1alpha1/common_types.go b/pkg/apis/cluster/v1alpha1/common_types.go index 32bb55f8c19c..7a9c647fe296 100644 --- a/pkg/apis/cluster/v1alpha1/common_types.go +++ b/pkg/apis/cluster/v1alpha1/common_types.go @@ -21,8 +21,8 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) -// ProviderConfig defines the configuration to use during node creation. -type ProviderConfig struct { +// ProviderSpec defines the configuration to use during node creation. +type ProviderSpec struct { // No more than one of the following may be specified. @@ -36,12 +36,12 @@ type ProviderConfig struct { // Source for the provider configuration. Cannot be used if value is // not empty. // +optional - ValueFrom *ProviderConfigSource `json:"valueFrom,omitempty"` + ValueFrom *ProviderSpecSource `json:"valueFrom,omitempty"` } -// ProviderConfigSource represents a source for the provider-specific +// ProviderSpecSource represents a source for the provider-specific // resource configuration. -type ProviderConfigSource struct { +type ProviderSpecSource struct { // The machine class from which the provider config should be sourced. // +optional MachineClass *MachineClassRef `json:"machineClass,omitempty"` diff --git a/pkg/apis/cluster/v1alpha1/machine_types.go b/pkg/apis/cluster/v1alpha1/machine_types.go index 76b87b378f68..bb3435e3e938 100644 --- a/pkg/apis/cluster/v1alpha1/machine_types.go +++ b/pkg/apis/cluster/v1alpha1/machine_types.go @@ -57,7 +57,7 @@ type MachineSpec struct { // Provider-specific configuration to use during node creation. // +optional - ProviderConfig ProviderConfig `json:"providerConfig"` + ProviderSpec ProviderSpec `json:"providerSpec"` // Versions of key software to use. This field is optional at cluster // creation time, and omitting the field indicates that the cluster diff --git a/pkg/apis/cluster/v1alpha1/machineclass_types.go b/pkg/apis/cluster/v1alpha1/machineclass_types.go index 9e2b1abb2933..cd78c3fe8288 100644 --- a/pkg/apis/cluster/v1alpha1/machineclass_types.go +++ b/pkg/apis/cluster/v1alpha1/machineclass_types.go @@ -55,7 +55,7 @@ type MachineClass struct { // Allocatable corev1.ResourceList `json:"allocatable"` // Provider-specific configuration to use during node creation. - ProviderConfig runtime.RawExtension `json:"providerConfig"` + ProviderSpec runtime.RawExtension `json:"providerSpec"` // TODO: should this use an api.ObjectReference to a 'MachineTemplate' instead? // A link to the MachineTemplate that will be used to create provider diff --git a/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go index 73598a5475ec..4823cce081c4 100644 --- a/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go @@ -126,7 +126,7 @@ func (in *ClusterNetworkingConfig) DeepCopy() *ClusterNetworkingConfig { func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { *out = *in in.ClusterNetwork.DeepCopyInto(&out.ClusterNetwork) - in.ProviderConfig.DeepCopyInto(&out.ProviderConfig) + in.ProviderSpec.DeepCopyInto(&out.ProviderSpec) return } @@ -199,7 +199,7 @@ func (in *MachineClass) DeepCopyInto(out *MachineClass) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.ProviderConfig.DeepCopyInto(&out.ProviderConfig) + in.ProviderSpec.DeepCopyInto(&out.ProviderSpec) return } @@ -559,7 +559,7 @@ func (in *MachineSpec) DeepCopyInto(out *MachineSpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - in.ProviderConfig.DeepCopyInto(&out.ProviderConfig) + in.ProviderSpec.DeepCopyInto(&out.ProviderSpec) out.Versions = in.Versions if in.ConfigSource != nil { in, out := &in.ConfigSource, &out.ConfigSource @@ -692,7 +692,7 @@ func (in *NetworkRanges) DeepCopy() *NetworkRanges { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProviderConfig) DeepCopyInto(out *ProviderConfig) { +func (in *ProviderSpec) DeepCopyInto(out *ProviderSpec) { *out = *in if in.Value != nil { in, out := &in.Value, &out.Value @@ -701,24 +701,24 @@ func (in *ProviderConfig) DeepCopyInto(out *ProviderConfig) { } if in.ValueFrom != nil { in, out := &in.ValueFrom, &out.ValueFrom - *out = new(ProviderConfigSource) + *out = new(ProviderSpecSource) (*in).DeepCopyInto(*out) } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfig. -func (in *ProviderConfig) DeepCopy() *ProviderConfig { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderSpec. +func (in *ProviderSpec) DeepCopy() *ProviderSpec { if in == nil { return nil } - out := new(ProviderConfig) + out := new(ProviderSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProviderConfigSource) DeepCopyInto(out *ProviderConfigSource) { +func (in *ProviderSpecSource) DeepCopyInto(out *ProviderSpecSource) { *out = *in if in.MachineClass != nil { in, out := &in.MachineClass, &out.MachineClass @@ -728,12 +728,12 @@ func (in *ProviderConfigSource) DeepCopyInto(out *ProviderConfigSource) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfigSource. -func (in *ProviderConfigSource) DeepCopy() *ProviderConfigSource { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderSpecSource. +func (in *ProviderSpecSource) DeepCopy() *ProviderSpecSource { if in == nil { return nil } - out := new(ProviderConfigSource) + out := new(ProviderSpecSource) in.DeepCopyInto(out) return out } diff --git a/sample/machineclass.yaml b/sample/machineclass.yaml index 6cf45d4e2e6f..8ca63eff0379 100644 --- a/sample/machineclass.yaml +++ b/sample/machineclass.yaml @@ -4,7 +4,7 @@ kind: MachineClass metadata: name: small namespace: foo -providerConfig: +providerSpec: apiVersion: "gceproviderconfig/v1alpha1" kind: "GCEProviderConfig" project: "$GCLOUD_PROJECT" @@ -18,14 +18,14 @@ providerConfig: apiVersion: cluster.k8s.io/v1alpha1 kind: Machine metadata: - name: test-machine + name: test-machine namespace: foo labels: - test-label: test-label + test-label: test-label spec: - providerConfig: + providerSpec: valueFrom: - machineClass: + machineClass: provider: gcp name: small namespace: foo diff --git a/sample/machinedeployment.yaml b/sample/machinedeployment.yaml index f69dc90ace69..a00bd6ee323b 100644 --- a/sample/machinedeployment.yaml +++ b/sample/machinedeployment.yaml @@ -12,7 +12,7 @@ spec: labels: foo: bar spec: - providerConfig: + providerSpec: value: apiVersion: "gceproviderconfig/v1alpha1" kind: "GCEProviderConfig" diff --git a/sample/machineset.yaml b/sample/machineset.yaml index 88b39dbf5941..a08b92cf648b 100644 --- a/sample/machineset.yaml +++ b/sample/machineset.yaml @@ -12,7 +12,7 @@ spec: labels: foo: bar spec: - providerConfig: + providerSpec: value: apiVersion: "gceproviderconfig/v1alpha1" kind: "GCEMachineProviderConfig"