Skip to content

Commit

Permalink
Passing along ocinamespaces env var to tests (#7984)
Browse files Browse the repository at this point in the history
  • Loading branch information
pokearu authored Apr 15, 2024
1 parent 797d0c7 commit 463357e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/test/e2e/registryMirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ func (e *E2ESession) setupRegistryMirrorEnv(testRegex string) error {
}
}

re = regexp.MustCompile(`^.*OciNamespaces.*$`)
if re.MatchString(testRegex) {
ociNamespacesEnvVar := e2etests.RequiredOciNamespacesEnvVars()
for _, eVar := range ociNamespacesEnvVar {
if val, ok := os.LookupEnv(eVar); ok {
e.testEnvVars[eVar] = val
}
}
}

return nil
}

Expand Down
5 changes: 5 additions & 0 deletions test/framework/registry_mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ func RequiredRegistryMirrorEnvVars() []string {
return append(registryMirrorRequiredEnvVars, registryMirrorDockerAirgappedRequiredEnvVars...)
}

// RequiredOciNamespacesEnvVars returns the Env variables to set for OCI Namespaces tests.
func RequiredOciNamespacesEnvVars() []string {
return append(registryMirrorOciNamespacesRequiredEnvVars, RegistryMirrorOciNamespacesRegistry2Var, RegistryMirrorOciNamespacesNamespace2Var)
}

func setupRegistryMirrorEndpointAndCert(e *ClusterE2ETest, providerName string, insecureSkipVerify bool, ociNamespaces ...v1alpha1.OCINamespace) {
var endpoint, hostPort, username, password, registryCert string
port := "443"
Expand Down

0 comments on commit 463357e

Please sign in to comment.