Skip to content

Commit a2aaae2

Browse files
authored
Merge pull request kubernetes#88124 from rosti/kubeadm-cc-upgrade-plan
kubeadm upgrade plan: print a component config state table
2 parents d7e364a + 709e3c3 commit a2aaae2

File tree

10 files changed

+687
-12
lines changed

10 files changed

+687
-12
lines changed

cmd/kubeadm/app/apis/output/types.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,26 @@ type ComponentUpgradePlan struct {
4848
NewVersion string
4949
}
5050

51+
// ComponentConfigVersionState describes the current and desired version of a component config
52+
type ComponentConfigVersionState struct {
53+
// Group points to the Kubernetes API group that covers the config
54+
Group string
55+
56+
// CurrentVersion is the currently active component config version
57+
// NOTE: This can be empty in case the config was not found on the cluster or it was unsupported
58+
// kubeadm generated version
59+
CurrentVersion string
60+
61+
// PreferredVersion is the component config version that is currently preferred by kubeadm for use.
62+
// NOTE: As of today, this is the only version supported by kubeadm.
63+
PreferredVersion string
64+
65+
// ManualUpgradeRequired indicates if users need to manually upgrade their component config versions. This happens if
66+
// the CurrentVersion of the config is user supplied (or modified) and no longer supported. Users should upgrade
67+
// their component configs to PreferredVersion or any other supported component config version.
68+
ManualUpgradeRequired bool
69+
}
70+
5171
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
5272

5373
// UpgradePlan represents information about upgrade plan for the output
@@ -56,4 +76,6 @@ type UpgradePlan struct {
5676
metav1.TypeMeta
5777

5878
Components []ComponentUpgradePlan
79+
80+
ConfigVersions []ComponentConfigVersionState
5981
}

cmd/kubeadm/app/apis/output/v1alpha1/types.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,26 @@ type ComponentUpgradePlan struct {
4848
NewVersion string `json:"newVersion"`
4949
}
5050

51+
// ComponentConfigVersionState describes the current and desired version of a component config
52+
type ComponentConfigVersionState struct {
53+
// Group points to the Kubernetes API group that covers the config
54+
Group string `json:"group"`
55+
56+
// CurrentVersion is the currently active component config version
57+
// NOTE: This can be empty in case the config was not found on the cluster or it was unsupported
58+
// kubeadm generated version
59+
CurrentVersion string `json:"currentVersion"`
60+
61+
// PreferredVersion is the component config version that is currently preferred by kubeadm for use.
62+
// NOTE: As of today, this is the only version supported by kubeadm.
63+
PreferredVersion string `json:"preferredVersion"`
64+
65+
// ManualUpgradeRequired indicates if users need to manually upgrade their component config versions. This happens if
66+
// the CurrentVersion of the config is user supplied (or modified) and no longer supported. Users should upgrade
67+
// their component configs to PreferredVersion or any other supported component config version.
68+
ManualUpgradeRequired bool `json:"manualUpgradeRequired"`
69+
}
70+
5171
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
5272

5373
// UpgradePlan represents information about upgrade plan for the output
@@ -56,4 +76,6 @@ type UpgradePlan struct {
5676
metav1.TypeMeta
5777

5878
Components []ComponentUpgradePlan `json:"components"`
79+
80+
ConfigVersions []ComponentConfigVersionState `json:"configVersions"`
5981
}

cmd/kubeadm/app/apis/output/v1alpha1/zz_generated.conversion.go

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

cmd/kubeadm/app/apis/output/v1alpha1/zz_generated.deepcopy.go

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

cmd/kubeadm/app/apis/output/zz_generated.deepcopy.go

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

cmd/kubeadm/app/cmd/upgrade/BUILD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ go_library(
1515
deps = [
1616
"//cmd/kubeadm/app/apis/kubeadm:go_default_library",
1717
"//cmd/kubeadm/app/apis/kubeadm/validation:go_default_library",
18-
"//cmd/kubeadm/app/apis/output/v1alpha1:go_default_library",
18+
"//cmd/kubeadm/app/apis/output:go_default_library",
1919
"//cmd/kubeadm/app/cmd/options:go_default_library",
2020
"//cmd/kubeadm/app/cmd/phases/upgrade/node:go_default_library",
2121
"//cmd/kubeadm/app/cmd/phases/workflow:go_default_library",
@@ -38,6 +38,7 @@ go_library(
3838
"//staging/src/k8s.io/apimachinery/pkg/util/version:go_default_library",
3939
"//staging/src/k8s.io/client-go/discovery/fake:go_default_library",
4040
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
41+
"//vendor/github.com/lithammer/dedent:go_default_library",
4142
"//vendor/github.com/pkg/errors:go_default_library",
4243
"//vendor/github.com/pmezard/go-difflib/difflib:go_default_library",
4344
"//vendor/github.com/spf13/cobra:go_default_library",

0 commit comments

Comments
 (0)