<#7312 feat(flytestdlib): add namespaceutils packa...
# flyte-github
a
#7312 feat(flytestdlib): add namespaceutils package to v2 Pull request opened by SVilgelm Why are the changes needed? The
namespaceutils
package exists in v1
flytestdlib
but is missing from v2. Downstream services that depend on v1
flytestdlib/namespaceutils
cannot migrate to v2 without re-implementing or vendoring these utilities. This PR ports the package to v2 to enable a clean migration path. What changes were proposed in this pull request? Adds
flytestdlib/namespaceutils/
to v2 with the same two functions as the v1 implementation: •
GetNamespaceName(template, org, project, domain string) string
— builds a Kubernetes namespace name by substituting
{{ org }}
,
{{ project }}
,
{{ domain }}
placeholders in a template •
GetNameWithNamespacedPrefix(prefix, name string) string
— concatenates a prefix and a name The implementation is identical to the v1 package — just ported to the v2 module path. How was this patch tested? The unit tests from v1 were ported alongside the source. Both functions are covered by table-driven tests: •
TestGetNamespaceName
•
TestGetNameWithNamespacedPrefix
Copy code
$ go test ./flytestdlib/namespaceutils/  
ok github.com/flyteorg/flyte/v2/flytestdlib/namespaceutils 0.300s
Labels • added: new package in v2 flytestdlib Check all the applicable boxes • All new and existing tests passed. • All commits are signed-off. • #6583 • feat(flytestdlib): add namespaceutils package to v2 👈 flyteorg/flyte