mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
Rename "minion" to "node" in few places.
This commit is contained in:
@@ -545,21 +545,21 @@ func TestPrintEventsResultSorted(t *testing.T) {
|
||||
VerifyDatesInOrder(out, "\n" /* rowDelimiter */, " " /* columnDelimiter */, t)
|
||||
}
|
||||
|
||||
func TestPrintMinionStatus(t *testing.T) {
|
||||
func TestPrintNodeStatus(t *testing.T) {
|
||||
printer := NewHumanReadablePrinter(false, false, false, false, []string{})
|
||||
table := []struct {
|
||||
minion api.Node
|
||||
node api.Node
|
||||
status string
|
||||
}{
|
||||
{
|
||||
minion: api.Node{
|
||||
node: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo1"},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{{Type: api.NodeReady, Status: api.ConditionTrue}}},
|
||||
},
|
||||
status: "Ready",
|
||||
},
|
||||
{
|
||||
minion: api.Node{
|
||||
node: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo2"},
|
||||
Spec: api.NodeSpec{Unschedulable: true},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{{Type: api.NodeReady, Status: api.ConditionTrue}}},
|
||||
@@ -567,7 +567,7 @@ func TestPrintMinionStatus(t *testing.T) {
|
||||
status: "Ready,SchedulingDisabled",
|
||||
},
|
||||
{
|
||||
minion: api.Node{
|
||||
node: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo3"},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{
|
||||
{Type: api.NodeReady, Status: api.ConditionTrue},
|
||||
@@ -576,14 +576,14 @@ func TestPrintMinionStatus(t *testing.T) {
|
||||
status: "Ready",
|
||||
},
|
||||
{
|
||||
minion: api.Node{
|
||||
node: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo4"},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{{Type: api.NodeReady, Status: api.ConditionFalse}}},
|
||||
},
|
||||
status: "NotReady",
|
||||
},
|
||||
{
|
||||
minion: api.Node{
|
||||
node: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo5"},
|
||||
Spec: api.NodeSpec{Unschedulable: true},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{{Type: api.NodeReady, Status: api.ConditionFalse}}},
|
||||
@@ -591,21 +591,21 @@ func TestPrintMinionStatus(t *testing.T) {
|
||||
status: "NotReady,SchedulingDisabled",
|
||||
},
|
||||
{
|
||||
minion: api.Node{
|
||||
node: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo6"},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{{Type: "InvalidValue", Status: api.ConditionTrue}}},
|
||||
},
|
||||
status: "Unknown",
|
||||
},
|
||||
{
|
||||
minion: api.Node{
|
||||
node: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo7"},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{{}}},
|
||||
},
|
||||
status: "Unknown",
|
||||
},
|
||||
{
|
||||
minion: api.Node{
|
||||
node: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo8"},
|
||||
Spec: api.NodeSpec{Unschedulable: true},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{{Type: "InvalidValue", Status: api.ConditionTrue}}},
|
||||
@@ -613,7 +613,7 @@ func TestPrintMinionStatus(t *testing.T) {
|
||||
status: "Unknown,SchedulingDisabled",
|
||||
},
|
||||
{
|
||||
minion: api.Node{
|
||||
node: api.Node{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo9"},
|
||||
Spec: api.NodeSpec{Unschedulable: true},
|
||||
Status: api.NodeStatus{Conditions: []api.NodeCondition{{}}},
|
||||
@@ -624,12 +624,12 @@ func TestPrintMinionStatus(t *testing.T) {
|
||||
|
||||
for _, test := range table {
|
||||
buffer := &bytes.Buffer{}
|
||||
err := printer.PrintObj(&test.minion, buffer)
|
||||
err := printer.PrintObj(&test.node, buffer)
|
||||
if err != nil {
|
||||
t.Fatalf("An error occurred printing Minion: %#v", err)
|
||||
t.Fatalf("An error occurred printing Node: %#v", err)
|
||||
}
|
||||
if !contains(strings.Fields(buffer.String()), test.status) {
|
||||
t.Fatalf("Expect printing minion %s with status %#v, got: %#v", test.minion.Name, test.status, buffer.String())
|
||||
t.Fatalf("Expect printing node %s with status %#v, got: %#v", test.node.Name, test.status, buffer.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user