Remove the 'beta' version of the node label (os and arch types)

This commit is contained in:
wawa0210
2020-05-13 08:22:43 +08:00
parent 6acceaeb2d
commit 54c0f8b677
6 changed files with 57 additions and 83 deletions

View File

@@ -145,21 +145,17 @@ var labelReconcileInfo = []struct {
ensureSecondaryExists bool
}{
{
// Reconcile the beta and the stable OS label using the beta label as
// the source of truth.
// TODO(#73084): switch to using the stable label as the source of
// truth in v1.18.
primaryKey: kubeletapis.LabelOS,
secondaryKey: v1.LabelOSStable,
// Reconcile the beta and the stable OS label using the stable label as the source of truth.
// TODO(#89477): no earlier than 1.22: drop the beta labels if they differ from the GA labels
primaryKey: v1.LabelOSStable,
secondaryKey: kubeletapis.LabelOS,
ensureSecondaryExists: true,
},
{
// Reconcile the beta and the stable arch label using the beta label as
// the source of truth.
// TODO(#73084): switch to using the stable label as the source of
// truth in v1.18.
primaryKey: kubeletapis.LabelArch,
secondaryKey: v1.LabelArchStable,
// Reconcile the beta and the stable arch label using the stable label as the source of truth.
// TODO(#89477): no earlier than 1.22: drop the beta labels if they differ from the GA labels
primaryKey: v1.LabelArchStable,
secondaryKey: kubeletapis.LabelArch,
ensureSecondaryExists: true,
},
}

View File

@@ -3288,14 +3288,14 @@ func TestReconcileNodeLabels(t *testing.T) {
},
},
{
Name: "Create OS/arch stable labels when they don't exist",
Name: "Create OS/arch beta labels when they don't exist",
Node: &v1.Node{
ObjectMeta: metav1.ObjectMeta{
Name: "node0",
CreationTimestamp: metav1.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC),
Labels: map[string]string{
kubeletapis.LabelOS: "linux",
kubeletapis.LabelArch: "amd64",
v1.LabelOSStable: "linux",
v1.LabelArchStable: "amd64",
},
},
},
@@ -3307,16 +3307,16 @@ func TestReconcileNodeLabels(t *testing.T) {
},
},
{
Name: "Reconcile OS/arch stable labels to match beta labels",
Name: "Reconcile OS/arch beta labels to match stable labels",
Node: &v1.Node{
ObjectMeta: metav1.ObjectMeta{
Name: "node0",
CreationTimestamp: metav1.Date(2012, 1, 1, 0, 0, 0, 0, time.UTC),
Labels: map[string]string{
kubeletapis.LabelOS: "linux",
kubeletapis.LabelArch: "amd64",
v1.LabelOSStable: "windows",
v1.LabelArchStable: "arm",
kubeletapis.LabelOS: "windows",
kubeletapis.LabelArch: "arm",
v1.LabelOSStable: "linux",
v1.LabelArchStable: "amd64",
},
},
},