diff --git a/hack/.staticcheck_failures b/hack/.staticcheck_failures index c4cf3952eea..5b90195de87 100644 --- a/hack/.staticcheck_failures +++ b/hack/.staticcheck_failures @@ -28,7 +28,6 @@ pkg/kubelet/pluginmanager/pluginwatcher pkg/kubelet/remote pkg/master pkg/printers -pkg/printers/internalversion pkg/probe/http pkg/proxy/healthcheck pkg/proxy/iptables diff --git a/pkg/printers/internalversion/BUILD b/pkg/printers/internalversion/BUILD index bd200acae23..8f23319ae43 100644 --- a/pkg/printers/internalversion/BUILD +++ b/pkg/printers/internalversion/BUILD @@ -20,12 +20,14 @@ go_test( "//pkg/apis/apps:go_default_library", "//pkg/apis/autoscaling:go_default_library", "//pkg/apis/batch:go_default_library", + "//pkg/apis/certificates:go_default_library", "//pkg/apis/coordination:go_default_library", "//pkg/apis/core:go_default_library", "//pkg/apis/discovery:go_default_library", "//pkg/apis/networking:go_default_library", "//pkg/apis/node:go_default_library", "//pkg/apis/policy:go_default_library", + "//pkg/apis/rbac:go_default_library", "//pkg/apis/scheduling:go_default_library", "//pkg/apis/storage:go_default_library", "//pkg/printers:go_default_library", diff --git a/pkg/printers/internalversion/printers_test.go b/pkg/printers/internalversion/printers_test.go index 9b35d8423b0..3b08ce5b8ab 100644 --- a/pkg/printers/internalversion/printers_test.go +++ b/pkg/printers/internalversion/printers_test.go @@ -17,9 +17,7 @@ limitations under the License. package internalversion import ( - "bytes" "reflect" - "strings" "testing" "time" @@ -4757,41 +4755,3 @@ func TestPrintEndpointSlice(t *testing.T) { } } } - -func verifyTable(t *testing.T, table *metav1beta1.Table) { - var panicErr interface{} - func() { - defer func() { - panicErr = recover() - }() - table.DeepCopyObject() // cells are untyped, better check that types are JSON types and can be deep copied - }() - - if panicErr != nil { - t.Errorf("unexpected panic during deepcopy of table %#v: %v", table, panicErr) - } -} - -// VerifyDatesInOrder checks the start of each line for a RFC1123Z date -// and posts error if all subsequent dates are not equal or increasing -func VerifyDatesInOrder( - resultToTest, rowDelimiter, columnDelimiter string, t *testing.T) { - lines := strings.Split(resultToTest, rowDelimiter) - var previousTime time.Time - for _, str := range lines { - columns := strings.Split(str, columnDelimiter) - if len(columns) > 0 { - currentTime, err := time.Parse(time.RFC1123Z, columns[0]) - if err == nil { - if previousTime.After(currentTime) { - t.Errorf( - "Output is not sorted by time. %s should be listed after %s. Complete output: %s", - previousTime.Format(time.RFC1123Z), - currentTime.Format(time.RFC1123Z), - resultToTest) - } - previousTime = currentTime - } - } - } -}