File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -331,6 +331,18 @@ def expand(
331
331
332
332
333
333
def determine_namespace (testcase_name : str ) -> str :
334
+ """Generate a namespace name for the given test case.
335
+
336
+ The format of the namespace name is "kuttl-<hash>" where hash is the first 10 chars of the test
337
+ case's sha256 value.
338
+
339
+ There is an analogous function in "kubectl-kuttl" that generates the exact same namespace name.
340
+ These two have to be kept in sync!
341
+
342
+ The tests use the namespace name also for other kubernetes objects like "metadata.name" which have
343
+ different syntactic restrictions.
344
+ Therefore, to be on the safe side, the namespace name is kept as simple as possible.
345
+ """
334
346
hash = sha256 (testcase_name .encode ("utf-8" )).hexdigest ()
335
347
return f"kuttl-{ hash [:10 ]} "
336
348
You can’t perform that action at this time.
0 commit comments