Skip to content

Commit

Permalink
Restrict length of namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mgencur committed Jun 11, 2020
1 parent d858ddb commit 32b8b1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/lib/test_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 + "-")
}
Expand Down

0 comments on commit 32b8b1e

Please sign in to comment.