mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
fixup kubectl test
This commit is contained in:
parent
a1595da534
commit
deb75da17b
@ -51,6 +51,10 @@ var recognizedTableVersions = map[schema.GroupVersionKind]bool{
|
|||||||
metav1.SchemeGroupVersion.WithKind("Table"): true,
|
metav1.SchemeGroupVersion.WithKind("Table"): true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// assert the types are identical, since we're decoding both types into a metav1.Table
|
||||||
|
var _ metav1.Table = metav1beta1.Table{}
|
||||||
|
var _ metav1beta1.Table = metav1.Table{}
|
||||||
|
|
||||||
func decodeIntoTable(obj runtime.Object) (runtime.Object, error) {
|
func decodeIntoTable(obj runtime.Object) (runtime.Object, error) {
|
||||||
event, isEvent := obj.(*metav1.WatchEvent)
|
event, isEvent := obj.(*metav1.WatchEvent)
|
||||||
if isEvent {
|
if isEvent {
|
||||||
|
@ -427,6 +427,7 @@ var _ = SIGDescribe("Kubectl client", func() {
|
|||||||
// This assumption is based on a lack of TableColumnDefinition
|
// This assumption is based on a lack of TableColumnDefinition
|
||||||
// in pkg/printers/internalversion/printers.go
|
// in pkg/printers/internalversion/printers.go
|
||||||
"ClusterRole": true,
|
"ClusterRole": true,
|
||||||
|
"Role": true,
|
||||||
"LimitRange": true,
|
"LimitRange": true,
|
||||||
"PodPreset": true,
|
"PodPreset": true,
|
||||||
|
|
||||||
@ -434,14 +435,13 @@ var _ = SIGDescribe("Kubectl client", func() {
|
|||||||
"Node": true,
|
"Node": true,
|
||||||
|
|
||||||
// ignored temporarily while waiting for bug fix.
|
// ignored temporarily while waiting for bug fix.
|
||||||
"ComponentStatus": true,
|
"CustomResourceDefinition": true,
|
||||||
"ClusterRoleBinding": true,
|
|
||||||
"ResourceQuota": true,
|
|
||||||
|
|
||||||
// ignored because no test data exists.
|
// ignored because no test data exists.
|
||||||
// Do not add anything to this list, instead add fixtures in
|
// Do not add anything to this list, instead add fixtures in
|
||||||
// the test/integration/etcd package.
|
// the test/integration/etcd package.
|
||||||
"BackendConfig": true,
|
"BackendConfig": true,
|
||||||
|
"ComponentStatus": true,
|
||||||
"NodeMetrics": true,
|
"NodeMetrics": true,
|
||||||
"PodMetrics": true,
|
"PodMetrics": true,
|
||||||
"VolumeSnapshotClass": true,
|
"VolumeSnapshotClass": true,
|
||||||
@ -2606,10 +2606,19 @@ func createObjValidateOutputAndCleanup(client dynamic.ResourceInterface, obj *un
|
|||||||
|
|
||||||
splitOutput := strings.SplitN(output, "\n", 2)
|
splitOutput := strings.SplitN(output, "\n", 2)
|
||||||
fields := strings.Fields(splitOutput[0])
|
fields := strings.Fields(splitOutput[0])
|
||||||
if resource.Namespaced {
|
|
||||||
framework.ExpectNotEqual(fields, []string{"NAMESPACE", "NAME", "CREATED", "AT"}, fmt.Sprintf("expected non-default fields for namespaced resource: %s", resource.Name))
|
defaultColumns := [][]string{
|
||||||
} else {
|
// namespaced, server-side
|
||||||
framework.ExpectNotEqual(fields, []string{"NAME", "AGE"}, fmt.Sprintf("expected non-default fields for resource: %s", resource.Name))
|
{"NAMESPACE", "NAME", "CREATED", "AT"},
|
||||||
|
// namespaced, client-side
|
||||||
|
{"NAMESPACE", "NAME", "AGE"},
|
||||||
|
// cluster-scoped, server-side
|
||||||
|
{"NAME", "CREATED", "AT"},
|
||||||
|
// cluster-scoped, client-side
|
||||||
|
{"NAME", "AGE"},
|
||||||
|
}
|
||||||
|
for _, defaults := range defaultColumns {
|
||||||
|
framework.ExpectNotEqual(fields, defaults, fmt.Sprintf("expected non-default fields for resource: %s", resource.Name))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user