-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New Addons API in KubeOneCluster Signed-off-by: Artiom Diomin <[email protected]> * Fix the code after types changes Signed-off-by: Artiom Diomin <[email protected]> * Automatically convert KubeOneCluster v1beta2 into v1beta3 Signed-off-by: Artiom Diomin <[email protected]> * Migrate e2e test manifests to v1beta3 Signed-off-by: Artiom Diomin <[email protected]> * Add E2E tests for helm addons Signed-off-by: Artiom Diomin <[email protected]> * Make linter happy Signed-off-by: Artiom Diomin <[email protected]> * Fixes NPE in Addons API Signed-off-by: Artiom Diomin <[email protected]> * Convert config template from string into embeddable file Signed-off-by: Artiom Diomin <[email protected]> * Review changes Signed-off-by: Artiom Diomin <[email protected]> * Modernize yamled * replaced interface{} with any * replaced long ifs with more readable switches Signed-off-by: Artiom Diomin <[email protected]> * new yamled Document.Walk() method Signed-off-by: Artiom Diomin <[email protected]> * Framework to free transform YAML * migrate v1beta2 to v1beta3 * fix cosmetic issues Signed-off-by: Artiom Diomin <[email protected]> * Fix config print -f Signed-off-by: Artiom Diomin <[email protected]> * unittests for MigrateV1beta2V1beta3 Signed-off-by: Artiom Diomin <[email protected]> --------- Signed-off-by: Artiom Diomin <[email protected]>
- Loading branch information
Showing
49 changed files
with
4,343 additions
and
1,554 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
Copyright 2020 The KubeOne Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package config | ||
|
||
import ( | ||
"flag" | ||
"testing" | ||
|
||
"k8c.io/kubeone/pkg/testhelper" | ||
) | ||
|
||
var updateFlag = flag.Bool("update", false, "update testdata files") | ||
|
||
func TestV1Beta2ToV1Beta3Migration(t *testing.T) { | ||
tests := []string{ | ||
"simple", | ||
"just addons", | ||
"helm", | ||
"addons and helm", | ||
} | ||
|
||
for _, test := range tests { | ||
t.Run(test, func(t *testing.T) { | ||
got, err := MigrateV1beta2V1beta3(testhelper.TestDataFSName(t, "_v1beta2.yaml")) | ||
if err != nil { | ||
t.Fatalf("%s", err) | ||
} | ||
|
||
testhelper.DiffOutput(t, testhelper.FSGoldenName(t), string(got), *updateFlag) | ||
}) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
pkg/apis/kubeone/config/testdata/TestV1Beta2ToV1Beta3Migration-addons_and_helm.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: kubeone.k8c.io/v1beta3 | ||
kind: KubeOneCluster | ||
versions: | ||
kubernetes: 1.30.1 | ||
addons: | ||
addons: | ||
- addon: | ||
name: name1 | ||
- helmRelease: | ||
chart: kube-state-metrics | ||
namespace: kube-state-metrics | ||
releaseName: ksm | ||
repoURL: https://prometheus-community.github.io/helm-charts | ||
timeout: 0s | ||
values: | ||
- valuesFile: ksm-values.yaml | ||
- inline: | ||
replicas: 3 | ||
version: 4.22.3 | ||
path: something |
22 changes: 22 additions & 0 deletions
22
pkg/apis/kubeone/config/testdata/TestV1Beta2ToV1Beta3Migration-addons_and_helm_v1beta2.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: kubeone.k8c.io/v1beta2 | ||
kind: KubeOneCluster | ||
|
||
versions: | ||
kubernetes: 1.30.1 | ||
|
||
addons: | ||
path: "something" | ||
|
||
addons: | ||
- name: "name1" | ||
|
||
helmReleases: | ||
- releaseName: ksm | ||
chart: kube-state-metrics | ||
repoURL: https://prometheus-community.github.io/helm-charts | ||
namespace: kube-state-metrics | ||
version: 4.22.3 | ||
values: | ||
- valuesFile: ksm-values.yaml | ||
- inline: | ||
replicas: 3 |
17 changes: 17 additions & 0 deletions
17
pkg/apis/kubeone/config/testdata/TestV1Beta2ToV1Beta3Migration-helm.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: kubeone.k8c.io/v1beta3 | ||
kind: KubeOneCluster | ||
versions: | ||
kubernetes: 1.30.1 | ||
addons: | ||
addons: | ||
- helmRelease: | ||
chart: kube-state-metrics | ||
namespace: kube-state-metrics | ||
releaseName: ksm | ||
repoURL: https://prometheus-community.github.io/helm-charts | ||
timeout: 0s | ||
values: | ||
- valuesFile: ksm-values.yaml | ||
- inline: | ||
replicas: 3 | ||
version: 4.22.3 |
16 changes: 16 additions & 0 deletions
16
pkg/apis/kubeone/config/testdata/TestV1Beta2ToV1Beta3Migration-helm_v1beta2.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: kubeone.k8c.io/v1beta2 | ||
kind: KubeOneCluster | ||
|
||
versions: | ||
kubernetes: 1.30.1 | ||
|
||
helmReleases: | ||
- releaseName: ksm | ||
chart: kube-state-metrics | ||
repoURL: https://prometheus-community.github.io/helm-charts | ||
namespace: kube-state-metrics | ||
version: 4.22.3 | ||
values: | ||
- valuesFile: ksm-values.yaml | ||
- inline: | ||
replicas: 3 |
Oops, something went wrong.