Skip to content

Commit c3fbbc5

Browse files
authored
Fixes registry mirror packages e2e tests (#10343)
* fix hardcoded curl pod image to use with registry mirror * fix copy packages destination to match import images * increased timeout to accommodate known network call retries in airgapped env
1 parent 9b10318 commit c3fbbc5

File tree

7 files changed

+151
-85
lines changed

7 files changed

+151
-85
lines changed

pkg/executables/kubectl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,8 +992,8 @@ func (k *Kubectl) ValidatePods(ctx context.Context, kubeconfig string) error {
992992
}
993993

994994
// RunCurlPod will run Kubectl with an image (with curl installed) and the command you pass in.
995-
func (k *Kubectl) RunCurlPod(ctx context.Context, namespace, name, kubeconfig string, command []string) (string, error) {
996-
params := []string{"run", name, "--image=public.ecr.aws/eks-anywhere/diagnostic-collector:v0.16.2-eks-a-41", "-o", "json", "--kubeconfig", kubeconfig, "--namespace", namespace, "--restart=Never", "--"}
995+
func (k *Kubectl) RunCurlPod(ctx context.Context, namespace, name, kubeconfig, image string, command []string) (string, error) {
996+
params := []string{"run", name, "--image=" + image, "-o", "json", "--kubeconfig", kubeconfig, "--namespace", namespace, "--restart=Never", "--"}
997997
params = append(params, command...)
998998
_, err := k.Execute(ctx, params...)
999999
if err != nil {

pkg/executables/kubectl_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3763,9 +3763,10 @@ func TestRunCurlPod(t *testing.T) {
37633763
t.Parallel()
37643764
tt := newKubectlTest(t)
37653765
var b bytes.Buffer
3766-
expectedParam := []string{"run", "testpod-123", "--image=public.ecr.aws/eks-anywhere/diagnostic-collector:v0.16.2-eks-a-41", "-o", "json", "--kubeconfig", "c.kubeconfig", "--namespace", "eksa-packages", "--restart=Never", "--", "pwd"}
3766+
testImage := "public.ecr.aws/eks-anywhere/diagnostic-collector:v0.16.2-eks-a-41"
3767+
expectedParam := []string{"run", "testpod-123", "--image=" + testImage, "-o", "json", "--kubeconfig", "c.kubeconfig", "--namespace", "eksa-packages", "--restart=Never", "--", "pwd"}
37673768
tt.e.EXPECT().Execute(gomock.Any(), gomock.Eq(expectedParam)).Return(b, nil).AnyTimes()
3768-
if _, err := tt.k.RunCurlPod(tt.ctx, "eksa-packages", "testpod-123", tt.cluster.KubeconfigFile, []string{"pwd"}); err != nil {
3769+
if _, err := tt.k.RunCurlPod(tt.ctx, "eksa-packages", "testpod-123", tt.cluster.KubeconfigFile, testImage, []string{"pwd"}); err != nil {
37693770
t.Errorf("Kubectl.RunCurlPod() error = %v, want nil", err)
37703771
}
37713772
}

test/e2e/constants.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import (
77
)
88

99
const (
10-
EksaPackagesRegistryMirrorAlias = "curated-packages"
11-
EksaPackagesSourceRegistry = "public.ecr.aws/x3k6m8v0"
12-
EksaPackageBundleURI = "oci://" + EksaPackagesSourceRegistry + "/eks-anywhere-packages-bundles"
13-
EksaPackagesNamespace = "eksa-packages"
14-
EksaPackagesRegistry = "067575901363.dkr.ecr.us-west-2.amazonaws.com"
10+
EksaPackagesDevPublicRegistryAlias = "x3k6m8v0"
11+
EksaPackagesStagingPublicRegistryAlias = "w9m0f3l5"
12+
EksaPackagesDevPrivateRegistry = "067575901363.dkr.ecr.us-west-2.amazonaws.com"
13+
EksaPackagesStagingPrivateRegistry = "724423470321.dkr.ecr.us-west-2.amazonaws.com"
14+
EksaPackagesNamespace = "eksa-packages"
1515

1616
clusterNamespace = "test-namespace"
1717

test/e2e/curatedpackages.go

Lines changed: 61 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ import (
2121

2222
func runCuratedPackageInstall(test *framework.ClusterE2ETest) {
2323
test.SetPackageBundleActive()
24-
err := WaitForPackageToBeInstalled(test, context.Background(), "eks-anywhere-packages", 3*time.Minute)
24+
err := WaitForPackageToBeInstalled(test, context.Background(), "eks-anywhere-packages", 15*time.Minute)
2525
if err != nil {
2626
test.T.Fatalf("packages controller not in installed state: %s", err)
2727
}
28-
err = WaitForPackageToBeInstalled(test, context.Background(), "eks-anywhere-packages-crds", 3*time.Minute)
28+
err = WaitForPackageToBeInstalled(test, context.Background(), "eks-anywhere-packages-crds", 15*time.Minute)
2929
if err != nil {
3030
test.T.Fatalf("packages controller crds not in installed state: %s", err)
3131
}
@@ -51,8 +51,66 @@ func runDisabledCuratedPackageInstallSimpleFlow(test *framework.ClusterE2ETest)
5151
test.WithCluster(runDisabledCuratedPackage)
5252
}
5353

54+
// addDefaultOCINamespacesFromEnv adds default OCI namespaces from environment variables if they're not already set.
55+
func addDefaultOCINamespacesFromEnv(test *framework.ClusterE2ETest) {
56+
if test.ClusterConfig.Cluster.Spec.RegistryMirrorConfiguration == nil {
57+
return
58+
}
59+
60+
if len(test.ClusterConfig.Cluster.Spec.RegistryMirrorConfiguration.OCINamespaces) > 0 {
61+
return
62+
}
63+
64+
test.T.Log("Adding default OCI namespaces from environment variables")
65+
test.ClusterConfig.Cluster.Spec.RegistryMirrorConfiguration.OCINamespaces = framework.DefaultOciNamespaces(test)
66+
}
67+
5468
func runCuratedPackageInstallSimpleFlowRegistryMirror(test *framework.ClusterE2ETest) {
55-
test.WithClusterRegistryMirror(EksaPackagesRegistryMirrorAlias, EksaPackagesSourceRegistry, EksaPackagesRegistry, runCuratedPackageInstall)
69+
test.GenerateClusterConfig()
70+
test.DownloadArtifacts()
71+
test.ExtractDownloadedArtifacts()
72+
73+
// Determine the correct alias from the bundle after download
74+
packageControllerChartRepo, err := test.GetPackageControlleChartRepo()
75+
if err != nil {
76+
test.T.Fatalf("Failed to determine package controller repo: %v", err)
77+
}
78+
79+
var pkgRegistry, alias string
80+
if strings.Contains(packageControllerChartRepo, EksaPackagesDevPublicRegistryAlias) {
81+
pkgRegistry = EksaPackagesDevPrivateRegistry
82+
alias = EksaPackagesDevPublicRegistryAlias
83+
}
84+
if strings.Contains(packageControllerChartRepo, EksaPackagesStagingPublicRegistryAlias) {
85+
pkgRegistry = EksaPackagesStagingPrivateRegistry
86+
alias = EksaPackagesStagingPublicRegistryAlias
87+
}
88+
89+
// Add default OCI namespaces from env vars, then append the curated packages one
90+
if test.ClusterConfig.Cluster.Spec.RegistryMirrorConfiguration != nil {
91+
addDefaultOCINamespacesFromEnv(test)
92+
93+
test.ClusterConfig.Cluster.Spec.RegistryMirrorConfiguration.OCINamespaces = append(
94+
test.ClusterConfig.Cluster.Spec.RegistryMirrorConfiguration.OCINamespaces,
95+
v1alpha1.OCINamespace{
96+
Registry: pkgRegistry,
97+
Namespace: alias,
98+
},
99+
)
100+
}
101+
test.UpdateClusterConfig()
102+
103+
test.DownloadImages()
104+
test.ImportImages()
105+
test.CopyPackages(alias, pkgRegistry)
106+
107+
bundlePath := "./eks-anywhere-downloads/bundle-release.yaml"
108+
test.CreateCluster(framework.WithBundlesOverride(bundlePath))
109+
defer func() {
110+
test.GenerateSupportBundleIfTestFailed()
111+
test.DeleteCluster(framework.WithBundlesOverride(bundlePath))
112+
}()
113+
runCuratedPackageInstall(test)
56114
}
57115

58116
func runCuratedPackageRemoteClusterInstallSimpleFlow(test *framework.MulticlusterE2ETest) {
@@ -215,13 +273,6 @@ func GetLatestBundleFromCluster(test *framework.ClusterE2ETest) (string, error)
215273
return strings.Trim(bundle, "'"), nil
216274
}
217275

218-
// packageBundleURI uses a KubernetesVersion argument to complete a package
219-
// bundle URI by adding the approprate tag.
220-
func packageBundleURI(version v1alpha1.KubernetesVersion) string {
221-
tag := "v" + strings.Replace(string(version), ".", "-", 1) + "-latest"
222-
return fmt.Sprintf("%s:%s", EksaPackageBundleURI, tag)
223-
}
224-
225276
func withCluster(cluster *framework.ClusterE2ETest) *types.Cluster {
226277
return &types.Cluster{
227278
Name: cluster.ClusterName,

test/e2e/vsphere_test.go

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2930,11 +2930,7 @@ func TestVSphereKubernetes129UbuntuAuthenticatedRegistryMirrorCuratedPackagesSim
29302930
framework.WithClusterFiller(api.WithWorkerNodeCount(1)),
29312931
framework.WithClusterFiller(api.WithExternalEtcdTopology(1)),
29322932
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube129)),
2933-
framework.WithAuthenticatedRegistryMirror(constants.VSphereProviderName,
2934-
v1alpha1.OCINamespace{
2935-
Registry: EksaPackagesRegistry,
2936-
Namespace: EksaPackagesRegistryMirrorAlias,
2937-
}),
2933+
framework.WithAuthenticatedRegistryMirror(constants.VSphereProviderName),
29382934
)
29392935
runCuratedPackageInstallSimpleFlowRegistryMirror(test)
29402936
}
@@ -2948,11 +2944,7 @@ func TestVSphereKubernetes134UbuntuAuthenticatedRegistryMirrorCuratedPackagesSim
29482944
framework.WithClusterFiller(api.WithWorkerNodeCount(1)),
29492945
framework.WithClusterFiller(api.WithExternalEtcdTopology(1)),
29502946
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube134)),
2951-
framework.WithAuthenticatedRegistryMirror(constants.VSphereProviderName,
2952-
v1alpha1.OCINamespace{
2953-
Registry: EksaPackagesRegistry,
2954-
Namespace: EksaPackagesRegistryMirrorAlias,
2955-
}),
2947+
framework.WithAuthenticatedRegistryMirror(constants.VSphereProviderName),
29562948
)
29572949
runCuratedPackageInstallSimpleFlowRegistryMirror(test)
29582950
}
@@ -2966,11 +2958,7 @@ func TestVSphereKubernetes130UbuntuAuthenticatedRegistryMirrorCuratedPackagesSim
29662958
framework.WithClusterFiller(api.WithWorkerNodeCount(1)),
29672959
framework.WithClusterFiller(api.WithExternalEtcdTopology(1)),
29682960
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube130)),
2969-
framework.WithAuthenticatedRegistryMirror(constants.VSphereProviderName,
2970-
v1alpha1.OCINamespace{
2971-
Registry: EksaPackagesRegistry,
2972-
Namespace: EksaPackagesRegistryMirrorAlias,
2973-
}),
2961+
framework.WithAuthenticatedRegistryMirror(constants.VSphereProviderName),
29742962
)
29752963
runCuratedPackageInstallSimpleFlowRegistryMirror(test)
29762964
}
@@ -2984,11 +2972,7 @@ func TestVSphereKubernetes131UbuntuAuthenticatedRegistryMirrorCuratedPackagesSim
29842972
framework.WithClusterFiller(api.WithWorkerNodeCount(1)),
29852973
framework.WithClusterFiller(api.WithExternalEtcdTopology(1)),
29862974
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube131)),
2987-
framework.WithAuthenticatedRegistryMirror(constants.VSphereProviderName,
2988-
v1alpha1.OCINamespace{
2989-
Registry: EksaPackagesRegistry,
2990-
Namespace: EksaPackagesRegistryMirrorAlias,
2991-
}),
2975+
framework.WithAuthenticatedRegistryMirror(constants.VSphereProviderName),
29922976
)
29932977
runCuratedPackageInstallSimpleFlowRegistryMirror(test)
29942978
}
@@ -3002,11 +2986,7 @@ func TestVSphereKubernetes132UbuntuAuthenticatedRegistryMirrorCuratedPackagesSim
30022986
framework.WithClusterFiller(api.WithWorkerNodeCount(1)),
30032987
framework.WithClusterFiller(api.WithExternalEtcdTopology(1)),
30042988
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube132)),
3005-
framework.WithAuthenticatedRegistryMirror(constants.VSphereProviderName,
3006-
v1alpha1.OCINamespace{
3007-
Registry: EksaPackagesRegistry,
3008-
Namespace: EksaPackagesRegistryMirrorAlias,
3009-
}),
2989+
framework.WithAuthenticatedRegistryMirror(constants.VSphereProviderName),
30102990
)
30112991
runCuratedPackageInstallSimpleFlowRegistryMirror(test)
30122992
}
@@ -3020,11 +3000,7 @@ func TestVSphereKubernetes133UbuntuAuthenticatedRegistryMirrorCuratedPackagesSim
30203000
framework.WithClusterFiller(api.WithWorkerNodeCount(1)),
30213001
framework.WithClusterFiller(api.WithExternalEtcdTopology(1)),
30223002
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube133)),
3023-
framework.WithAuthenticatedRegistryMirror(constants.VSphereProviderName,
3024-
v1alpha1.OCINamespace{
3025-
Registry: EksaPackagesRegistry,
3026-
Namespace: EksaPackagesRegistryMirrorAlias,
3027-
}),
3003+
framework.WithAuthenticatedRegistryMirror(constants.VSphereProviderName),
30283004
)
30293005
runCuratedPackageInstallSimpleFlowRegistryMirror(test)
30303006
}

test/framework/cluster.go

Lines changed: 70 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -651,17 +651,18 @@ func (e *ClusterE2ETest) CleanupDownloadedArtifactsAndImages(opts ...CommandOpt)
651651
e.Run("rm", "-rf", defaultDownloadArtifactsOutputLocation, defaultDownloadImagesOutputLocation)
652652
}
653653

654+
func getBundleManifestLocation() string {
655+
if _, err := os.Stat(defaultDownloadArtifactsOutputLocation); err == nil {
656+
return bundleReleasePathFromArtifacts
657+
}
658+
return defaultBundleReleaseManifestFile
659+
}
660+
654661
// DownloadImages runs the EKS-A `download images` command with appropriate args.
655662
func (e *ClusterE2ETest) DownloadImages(opts ...CommandOpt) {
656663
downloadImagesArgs := []string{"download", "images", "-o", defaultDownloadImagesOutputLocation}
657664
if getBundlesOverride() == "true" {
658-
var bundleManifestLocation string
659-
if _, err := os.Stat(defaultDownloadArtifactsOutputLocation); err == nil {
660-
bundleManifestLocation = bundleReleasePathFromArtifacts
661-
} else {
662-
bundleManifestLocation = defaultBundleReleaseManifestFile
663-
}
664-
downloadImagesArgs = append(downloadImagesArgs, "--bundles-override", bundleManifestLocation)
665+
downloadImagesArgs = append(downloadImagesArgs, "--bundles-override", getBundleManifestLocation())
665666
}
666667
e.RunEKSA(downloadImagesArgs, opts...)
667668
if _, err := os.Stat(defaultDownloadImagesOutputLocation); err != nil {
@@ -676,18 +677,67 @@ func (e *ClusterE2ETest) ImportImages(opts ...CommandOpt) {
676677
clusterConfig := e.ClusterConfig.Cluster
677678
registyMirrorEndpoint, registryMirrorPort := clusterConfig.Spec.RegistryMirrorConfiguration.Endpoint, clusterConfig.Spec.RegistryMirrorConfiguration.Port
678679
registryMirrorHost := net.JoinHostPort(registyMirrorEndpoint, registryMirrorPort)
679-
var bundleManifestLocation string
680-
if _, err := os.Stat(defaultDownloadArtifactsOutputLocation); err == nil {
681-
bundleManifestLocation = bundleReleasePathFromArtifacts
682-
} else {
683-
bundleManifestLocation = defaultBundleReleaseManifestFile
684-
}
680+
bundleManifestLocation := getBundleManifestLocation()
685681
importImagesArgs := []string{"import images", "--input", defaultDownloadImagesOutputLocation, "--bundles", bundleManifestLocation, "--registry", registryMirrorHost, "--insecure"}
686682
e.RunEKSA(importImagesArgs, opts...)
687683
}
688684

685+
// GetDiagnosticCollectorImage returns the diagnostic collector image from the bundle file,
686+
// or falls back to a hardcoded URI if reading from disk fails.
687+
func (e *ClusterE2ETest) GetDiagnosticCollectorImage() string {
688+
const fallbackImage = "public.ecr.aws/eks-anywhere/diagnostic-collector:v0.16.2-eks-a-41"
689+
690+
bundleManifestLocation := getBundleManifestLocation()
691+
692+
// Try to read the bundle file
693+
bundleData, err := os.ReadFile(bundleManifestLocation)
694+
if err != nil {
695+
e.T.Logf("Could not read bundle file, using fallback image: %v", err)
696+
return fallbackImage
697+
}
698+
699+
// Try to parse the bundle
700+
var bundles releasev1.Bundles
701+
if err := yaml.Unmarshal(bundleData, &bundles); err != nil {
702+
e.T.Logf("Could not parse bundle file, using fallback image: %v", err)
703+
return fallbackImage
704+
}
705+
706+
// Check if version bundles exist
707+
if len(bundles.Spec.VersionsBundles) == 0 {
708+
e.T.Log("No version bundles found in bundle file, using fallback image")
709+
return fallbackImage
710+
}
711+
712+
return bundles.Spec.VersionsBundles[0].Eksa.DiagnosticCollector.VersionedImage()
713+
}
714+
715+
// GetPackageControllerRepo returns the bundle's package controller chart image.
716+
func (e *ClusterE2ETest) GetPackageControlleChartRepo() (string, error) {
717+
bundleManifestLocation := getBundleManifestLocation()
718+
719+
// Read the bundle file
720+
bundleData, err := os.ReadFile(bundleManifestLocation)
721+
if err != nil {
722+
return "", fmt.Errorf("failed to read bundle file %s: %w", bundleManifestLocation, err)
723+
}
724+
725+
// Parse the bundle
726+
var bundles releasev1.Bundles
727+
if err := yaml.Unmarshal(bundleData, &bundles); err != nil {
728+
return "", fmt.Errorf("failed to parse bundle file: %w", err)
729+
}
730+
731+
// Get the package controller chart image from the first version bundle
732+
if len(bundles.Spec.VersionsBundles) == 0 {
733+
return "", fmt.Errorf("no version bundles found in bundle file")
734+
}
735+
736+
return bundles.Spec.VersionsBundles[0].PackageController.HelmChart.Image(), nil
737+
}
738+
689739
// CopyPackages runs the EKS-A `copy packages` command to copy curated packages to the registry mirror.
690-
func (e *ClusterE2ETest) CopyPackages(packageMirrorAlias string, packageChartRegistry string, packageRegistry string, opts ...CommandOpt) {
740+
func (e *ClusterE2ETest) CopyPackages(packageMirrorAlias string, packageRegistry string, opts ...CommandOpt) {
691741
clusterConfig := e.ClusterConfig.Cluster
692742
registyMirrorEndpoint, registryMirrorPort := clusterConfig.Spec.RegistryMirrorConfiguration.Endpoint, clusterConfig.Spec.RegistryMirrorConfiguration.Port
693743
registryMirrorHost := net.JoinHostPort(registyMirrorEndpoint, registryMirrorPort)
@@ -700,12 +750,12 @@ func (e *ClusterE2ETest) CopyPackages(packageMirrorAlias string, packageChartReg
700750
"copy", "packages",
701751
registryMirrorHost + "/" + packageMirrorAlias,
702752
"--kube-version", kubeVersion,
703-
"--src-chart-registry", packageChartRegistry,
753+
"--src-chart-registry", packageRegistry,
704754
"--src-image-registry", packageRegistry,
705755
"--dst-insecure",
706756
}
707757

708-
e.T.Logf("Copying curated packages to registry mirror: %s", registryMirrorHost)
758+
e.T.Logf("Copying curated packages to registry mirror: %s/%s", registryMirrorHost, packageMirrorAlias)
709759
e.RunEKSA(copyPackagesArgs, opts...)
710760
}
711761

@@ -1327,22 +1377,6 @@ func (e *ClusterE2ETest) WithCluster(f func(e *ClusterE2ETest)) {
13271377
f(e)
13281378
}
13291379

1330-
// WithClusterRegistryMirror helps with bringing up and tearing down E2E test clusters when using registry mirror.
1331-
func (e *ClusterE2ETest) WithClusterRegistryMirror(packageMirrorAlias string, packageChartRegistry string, packageRegistry string, f func(e *ClusterE2ETest)) {
1332-
e.GenerateClusterConfig()
1333-
e.DownloadArtifacts()
1334-
e.ExtractDownloadedArtifacts()
1335-
e.DownloadImages()
1336-
e.ImportImages()
1337-
e.CopyPackages(packageMirrorAlias, packageChartRegistry, packageRegistry)
1338-
e.CreateCluster(WithBundlesOverride(bundleReleasePathFromArtifacts))
1339-
defer func() {
1340-
e.GenerateSupportBundleIfTestFailed()
1341-
e.DeleteCluster(WithBundlesOverride(bundleReleasePathFromArtifacts))
1342-
}()
1343-
f(e)
1344-
}
1345-
13461380
// Like WithCluster but does not delete the cluster. Useful for debugging.
13471381
func (e *ClusterE2ETest) WithPersistentCluster(f func(e *ClusterE2ETest)) {
13481382
configPath := e.KubeconfigFilePath()
@@ -2188,10 +2222,13 @@ func (e *ClusterE2ETest) ApplyPackageFile(packageName, targetNamespace string, P
21882222
func (e *ClusterE2ETest) CurlEndpoint(endpoint, namespace string, extraCurlArgs ...string) string {
21892223
ctx := context.Background()
21902224

2225+
diagnosticCollectorImage := e.GetDiagnosticCollectorImage()
2226+
21912227
e.T.Log("Launching pod to curl endpoint", endpoint)
21922228
randomname := fmt.Sprintf("%s-%s", "curl-test", utilrand.String(7))
21932229
curlPodName, err := e.KubectlClient.RunCurlPod(context.TODO(),
2194-
namespace, randomname, e.KubeconfigFilePath(), append([]string{"curl", endpoint}, extraCurlArgs...))
2230+
namespace, randomname, e.KubeconfigFilePath(), diagnosticCollectorImage,
2231+
append([]string{"curl", endpoint}, extraCurlArgs...))
21952232
if err != nil {
21962233
e.T.Fatalf("error launching pod: %s", err)
21972234
}

test/framework/registry_mirror.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,13 @@ func WithRegistryMirrorEndpointAndCert(providerName string) ClusterE2ETestOpt {
6767
// WithRegistryMirrorOciNamespaces sets up e2e for registry mirrors with ocinamespaces.
6868
func WithRegistryMirrorOciNamespaces(providerName string) ClusterE2ETestOpt {
6969
return func(e *ClusterE2ETest) {
70-
ociNamespaces := defaultOciNamespaces(e)
70+
ociNamespaces := DefaultOciNamespaces(e)
7171
setupRegistryMirrorEndpointAndCert(e, providerName, false, ociNamespaces...)
7272
}
7373
}
7474

75-
func defaultOciNamespaces(e *ClusterE2ETest) []v1alpha1.OCINamespace {
75+
// DefaultOciNamespaces returns the default OCI namespaces from environment variables.
76+
func DefaultOciNamespaces(e *ClusterE2ETest) []v1alpha1.OCINamespace {
7677
var ociNamespaces []v1alpha1.OCINamespace
7778

7879
checkRequiredEnvVars(e.T, registryMirrorOciNamespacesRequiredEnvVars)
@@ -139,7 +140,7 @@ func WithAuthenticatedRegistryMirror(providerName string, optNamespaces ...v1alp
139140

140141
var ociNamespaces []v1alpha1.OCINamespace
141142
if len(optNamespaces) > 0 {
142-
ociNamespaces = append(defaultOciNamespaces(e), optNamespaces...)
143+
ociNamespaces = append(DefaultOciNamespaces(e), optNamespaces...)
143144
}
144145

145146
certificate, err := base64.StdEncoding.DecodeString(registryCert)

0 commit comments

Comments
 (0)