-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Artiom Diomin <[email protected]>
- Loading branch information
Showing
11 changed files
with
167 additions
and
3 deletions.
There are no files selected for viewing
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 |
9 changes: 9 additions & 0 deletions
9
pkg/apis/kubeone/config/testdata/TestV1Beta2ToV1Beta3Migration-just_addons.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,9 @@ | ||
apiVersion: kubeone.k8c.io/v1beta3 | ||
kind: KubeOneCluster | ||
versions: | ||
kubernetes: 1.30.1 | ||
addons: | ||
addons: | ||
- addon: | ||
name: name1 | ||
path: something |
11 changes: 11 additions & 0 deletions
11
pkg/apis/kubeone/config/testdata/TestV1Beta2ToV1Beta3Migration-just_addons_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,11 @@ | ||
apiVersion: kubeone.k8c.io/v1beta2 | ||
kind: KubeOneCluster | ||
|
||
versions: | ||
kubernetes: 1.30.1 | ||
|
||
addons: | ||
path: "something" | ||
|
||
addons: | ||
- name: "name1" |
4 changes: 4 additions & 0 deletions
4
pkg/apis/kubeone/config/testdata/TestV1Beta2ToV1Beta3Migration-simple.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,4 @@ | ||
apiVersion: kubeone.k8c.io/v1beta3 | ||
kind: KubeOneCluster | ||
versions: | ||
kubernetes: 1.30.1 |
5 changes: 5 additions & 0 deletions
5
pkg/apis/kubeone/config/testdata/TestV1Beta2ToV1Beta3Migration-simple_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,5 @@ | ||
apiVersion: kubeone.k8c.io/v1beta2 | ||
kind: KubeOneCluster | ||
|
||
versions: | ||
kubernetes: 1.30.1 |
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