Skip to content

Commit

Permalink
Rename ProviderConfig to ProviderSpec (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlipovetsky authored and k8s-ci-robot committed Nov 21, 2018
1 parent 0734939 commit 0cf3e17
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
2 changes: 1 addition & 1 deletion config/crds/cluster_v1alpha1_cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
- pods
- serviceDomain
type: object
providerConfig:
providerSpec:
properties:
value:
type: object
Expand Down
4 changes: 2 additions & 2 deletions config/crds/cluster_v1alpha1_machine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
type: object
metadata:
type: object
providerConfig:
providerSpec:
properties:
value:
type: object
Expand All @@ -55,7 +55,7 @@ spec:
- kubelet
type: object
required:
- providerConfig
- providerSpec
type: object
status:
properties:
Expand Down
4 changes: 2 additions & 2 deletions config/crds/cluster_v1alpha1_machineclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ spec:
type: string
metadata:
type: object
providerConfig:
providerSpec:
type: object
required:
- providerConfig
- providerSpec
version: v1alpha1
status:
acceptedNames:
Expand Down
4 changes: 2 additions & 2 deletions config/crds/cluster_v1alpha1_machinedeployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:
type: object
metadata:
type: object
providerConfig:
providerSpec:
properties:
value:
type: object
Expand All @@ -91,7 +91,7 @@ spec:
- kubelet
type: object
required:
- providerConfig
- providerSpec
type: object
type: object
required:
Expand Down
4 changes: 2 additions & 2 deletions config/crds/cluster_v1alpha1_machineset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ spec:
type: object
metadata:
type: object
providerConfig:
providerSpec:
properties:
value:
type: object
Expand All @@ -73,7 +73,7 @@ spec:
- kubelet
type: object
required:
- providerConfig
- providerSpec
type: object
type: object
required:
Expand Down
6 changes: 3 additions & 3 deletions docs/proposals/machine-api-proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/cluster/common/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/cluster/v1alpha1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,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"`
}

/// [ClusterSpec]
Expand Down
10 changes: 5 additions & 5 deletions pkg/apis/cluster/v1alpha1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/cluster/v1alpha1/machine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,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
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/cluster/v1alpha1/machineclass_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,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
Expand Down
24 changes: 12 additions & 12 deletions pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go

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

10 changes: 5 additions & 5 deletions sample/machineclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: MachineClass
metadata:
name: small
namespace: foo
providerConfig:
providerSpec:
apiVersion: "gceproviderconfig/v1alpha1"
kind: "GCEProviderConfig"
project: "$GCLOUD_PROJECT"
Expand All @@ -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
2 changes: 1 addition & 1 deletion sample/machinedeployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
labels:
foo: bar
spec:
providerConfig:
providerSpec:
value:
apiVersion: "gceproviderconfig/v1alpha1"
kind: "GCEProviderConfig"
Expand Down
2 changes: 1 addition & 1 deletion sample/machineset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
labels:
foo: bar
spec:
providerConfig:
providerSpec:
value:
apiVersion: "gceproviderconfig/v1alpha1"
kind: "GCEMachineProviderConfig"
Expand Down

0 comments on commit 0cf3e17

Please sign in to comment.