Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old node role label that is not used by kubeadm #48056

Merged
merged 1 commit into from
Jul 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion cmd/kubeadm/app/apis/kubeadm/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ go_library(
"env.go",
"register.go",
"types.go",
"well_known_labels.go",
],
tags = ["automanaged"],
deps = [
Expand Down
43 changes: 0 additions & 43 deletions cmd/kubeadm/app/apis/kubeadm/well_known_labels.go

This file was deleted.

1 change: 0 additions & 1 deletion pkg/printers/internalversion/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ go_library(
],
tags = ["automanaged"],
deps = [
"//cmd/kubeadm/app/apis/kubeadm:go_default_library",
"//federation/apis/federation:go_default_library",
"//federation/client/clientset_generated/federation_internalclientset:go_default_library",
"//pkg/api:go_default_library",
Expand Down
1 change: 0 additions & 1 deletion pkg/printers/internalversion/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -2360,7 +2360,6 @@ func describeNode(node *api.Node, nodeNonTerminatedPodsList *api.PodList, events
return tabbedString(func(out io.Writer) error {
w := NewPrefixWriter(out)
w.Write(LEVEL_0, "Name:\t%s\n", node.Name)
w.Write(LEVEL_0, "Role:\t%s\n", findNodeRole(node))
printLabelsMultiline(w, "Labels", node.Labels)
printAnnotationsMultiline(w, "Annotations", node.Annotations)
printNodeTaintsMultiline(w, "Taints", node.Spec.Taints)
Expand Down
18 changes: 0 additions & 18 deletions pkg/printers/internalversion/printers.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
"k8s.io/kubernetes/federation/apis/federation"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/events"
Expand Down Expand Up @@ -1112,10 +1111,6 @@ func printNode(node *api.Node, w io.Writer, options printers.PrintOptions) error
if node.Spec.Unschedulable {
status = append(status, "SchedulingDisabled")
}
role := findNodeRole(node)
if role != "" {
status = append(status, role)
}

if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s", name, strings.Join(status, ","), translateTimestamp(node.CreationTimestamp), node.Status.NodeInfo.KubeletVersion); err != nil {
return err
Expand Down Expand Up @@ -1155,19 +1150,6 @@ func getNodeExternalIP(node *api.Node) string {
return "<none>"
}

// findNodeRole returns the role of a given node, or "" if none found.
// The role is determined by looking in order for:
// * a kubernetes.io/role label
// * a kubeadm.alpha.kubernetes.io/role label
// If no role is found, ("", nil) is returned
func findNodeRole(node *api.Node) string {
if role := node.Labels[kubeadm.NodeLabelKubeadmAlphaRole]; role != "" {
return role
}
// No role found
return ""
}

func printNodeList(list *api.NodeList, w io.Writer, options printers.PrintOptions) error {
for _, node := range list.Items {
if err := printNode(&node, w, options); err != nil {
Expand Down
10 changes: 0 additions & 10 deletions pkg/printers/internalversion/printers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -704,16 +704,6 @@ func TestPrintNodeStatus(t *testing.T) {
},
status: "Unknown,SchedulingDisabled",
},
{
node: api.Node{
ObjectMeta: metav1.ObjectMeta{
Name: "foo12",
Labels: map[string]string{"kubeadm.alpha.kubernetes.io/role": "node"},
},
Status: api.NodeStatus{Conditions: []api.NodeCondition{{Type: api.NodeReady, Status: api.ConditionTrue}}},
},
status: "Ready,node",
},
}

for _, test := range table {
Expand Down