Skip to content

Commit 0963b63

Browse files
alvaroalemankubermatic-bot
authored andcommitted
Use providerSpec instead of providerConfig (#443)
* Update cluster-api dependency to 45f1c93260140936c610e56575d7505ba3d52444 * Add basic conversion for providerconfig -> providerspec * Add migration * Plumb migration into cmd * Update remaining providerSpec references * Fixup resources name for machineS * Update tests and samples * Fix linting * Update fixture * Use yaml for fixtures * Make linter happy * Fix fixture * Update remaining references to providerConfig * Work around the no machine.spec modification admission rule * Improve metric error message * Use upstream defaulting for machineDeployments * Pr feedback
1 parent 337fcea commit 0963b63

File tree

88 files changed

+3273
-758
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+3273
-758
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ issues:
3030
- should have comment or be unexported
3131
- should have comment \\(or a comment on this block\\) or be unexported
3232
- func Convert_MachinesV1alpha1Machine_To_ClusterV1alpha1Machine should be ConvertMachinesV1alpha1MachineToClusterV1alpha1Machine
33+
- func Convert_ProviderConfig_To_ProviderSpec should be ConvertProviderConfigToProviderSpec
3334
- 'counter\.Set is deprecated: Use NewConstMetric'
3435
- 'eviction\.go:221:4: the surrounding loop is unconditionally terminated'

Gopkg.lock

Lines changed: 19 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ required = [
110110

111111
[[constraint]]
112112
name = "sigs.k8s.io/cluster-api"
113-
revision = "05cb1e663eb4085fbb92321dd1235377c84567f8"
113+
revision = "45f1c93260140936c610e56575d7505ba3d52444"
114114

115115
[[constraint]]
116116
name = "gopkg.in/gcfg.v1"

cmd/controller/main.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,14 @@ func startControllerViaLeaderElection(runOptions controllerRunOptions) error {
369369
clusterv1Alpha1Client,
370370
runOptions.cfg,
371371
); err != nil {
372-
glog.Errorf("Migration failed: %v", err)
372+
glog.Errorf("Migration to clusterv1alpha1 failed: %v", err)
373+
runOptions.parentCtxDone()
374+
return
375+
}
376+
377+
//Migrate providerConfig field to providerSpec field
378+
if err := migrations.MigrateProviderConfigToProviderSpecIfNecesary(runOptions.cfg); err != nil {
379+
glog.Errorf("Migration of providerConfig field to providerSpec field failed: %v", err)
373380
runOptions.parentCtxDone()
374381
return
375382
}

examples/aws-machinedeployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ spec:
3232
labels:
3333
foo: bar
3434
spec:
35-
providerConfig:
35+
providerSpec:
3636
value:
3737
sshPublicKeys:
3838
- "<< YOUR_PUBLIC_KEY >>"

examples/azure-machinedeployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ spec:
3232
labels:
3333
foo: bar
3434
spec:
35-
providerConfig:
35+
providerSpec:
3636
value:
3737
sshPublicKeys:
3838
- "<< YOUR_PUBLIC_KEY >>"

examples/digitalocean-machinedeployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
labels:
3232
foo: bar
3333
spec:
34-
providerConfig:
34+
providerSpec:
3535
value:
3636
sshPublicKeys:
3737
- "<< YOUR_PUBLIC_KEY >>"

examples/hetzner-machinedeployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
labels:
3232
foo: bar
3333
spec:
34-
providerConfig:
34+
providerSpec:
3535
value:
3636
sshPublicKeys:
3737
- "<< YOUR_PUBLIC_KEY >>"
@@ -50,4 +50,4 @@ spec:
5050
operatingSystemSpec:
5151
distUpgradeOnBoot: false
5252
versions:
53-
kubelet: 1.9.6
53+
kubelet: 1.13.1

examples/kubevirt-machinedeployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
labels:
2121
name: foo
2222
spec:
23-
providerConfig:
23+
providerSpec:
2424
value:
2525
sshPublicKeys:
2626
- "<< YOUR_PUBLIC_KEY >>"

examples/machine-controller.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ spec:
1414
additionalPrinterColumns:
1515
- name: Provider
1616
type: string
17-
JSONPath: .spec.providerConfig.value.cloudProvider
17+
JSONPath: .spec.providerSpec.value.cloudProvider
1818
- name: OS
1919
type: string
20-
JSONPath: .spec.providerConfig.value.operatingSystem
20+
JSONPath: .spec.providerSpec.value.operatingSystem
2121
- name: Address
2222
type: string
2323
JSONPath: .status.addresses[0].address
@@ -48,10 +48,10 @@ spec:
4848
JSONPath: .spec.replicas
4949
- name: Provider
5050
type: string
51-
JSONPath: .spec.template.spec.providerConfig.value.cloudProvider
51+
JSONPath: .spec.template.spec.providerSpec.value.cloudProvider
5252
- name: OS
5353
type: string
54-
JSONPath: .spec.template.spec.providerConfig.value.operatingSystem
54+
JSONPath: .spec.template.spec.providerSpec.value.operatingSystem
5555
- name: Age
5656
type: date
5757
JSONPath: .metadata.creationTimestamp
@@ -78,10 +78,10 @@ spec:
7878
JSONPath: .spec.replicas
7979
- name: Provider
8080
type: string
81-
JSONPath: .spec.template.spec.providerConfig.value.cloudProvider
81+
JSONPath: .spec.template.spec.providerSpec.value.cloudProvider
8282
- name: OS
8383
type: string
84-
JSONPath: .spec.template.spec.providerConfig.value.operatingSystem
84+
JSONPath: .spec.template.spec.providerSpec.value.operatingSystem
8585
- name: Age
8686
type: date
8787
JSONPath: .metadata.creationTimestamp

0 commit comments

Comments
 (0)