From 32b8b1eed09d01fe64455ea137e33b2c2c8bdf8b Mon Sep 17 00:00:00 2001 From: Martin Gencur Date: Thu, 11 Jun 2020 21:17:43 +0200 Subject: [PATCH] Restrict length of namespace --- test/lib/test_runner.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/lib/test_runner.go b/test/lib/test_runner.go index 3ce1dd4febe..69691e56362 100644 --- a/test/lib/test_runner.go +++ b/test/lib/test_runner.go @@ -42,6 +42,7 @@ import ( const ( podLogsDir = "pod-logs" testPullSecretName = "kn-eventing-test-pull-secret" + maxNameLength = 63 ) // ChannelTestRunner is used to run tests against channels. @@ -94,7 +95,7 @@ var SetupClientOptionNoop SetupClientOption = func(*Client) { // and does other setups, like creating namespaces, set the test case to run in parallel, etc. func Setup(t *testing.T, runInParallel bool, stableNS bool, options ...SetupClientOption) *Client { // Create a new namespace to run this test case. - namespace := helpers.MakeK8sNamePrefix(t.Name()) + namespace := helpers.MakeK8sNamePrefix(t.Name())[:maxNameLength] if !stableNS { namespace = names.SimpleNameGenerator.GenerateName(namespace + "-") }