Skip to content

Commit

Permalink
tests/e2e: Add auth registry docker tests
Browse files Browse the repository at this point in the history
Run the authenticated regsitry tests for docker cloud provider

Signed-off-by: stevenhorsman <[email protected]>
  • Loading branch information
stevenhorsman committed Aug 13, 2024
1 parent a9edb71 commit e76838c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/cloud-api-adaptor/test/e2e/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package e2e

import (
"os"
"testing"

_ "github.com/confidential-containers/cloud-api-adaptor/src/cloud-api-adaptor/test/provisioner/docker"
Expand Down Expand Up @@ -109,3 +110,21 @@ func TestDockerKbsKeyRelease(t *testing.T) {
keyBrokerService.EnableKbsCustomizedResourcePolicy("allow_all.rego")
DoTestKbsKeyRelease(t, testEnv, assert)
}

func TestDockerCreatePeerPodWithAuthenticatedImageWithoutCredentials(t *testing.T) {
assert := DockerAssert{}
if os.Getenv("AUTHENTICATED_REGISTRY_IMAGE") != "" {
DoTestCreatePeerPodWithAuthenticatedImageWithoutCredentials(t, testEnv, assert)
} else {
t.Skip("Authenticated Image Name not exported")
}
}

func TestDockerCreatePeerPodWithAuthenticatedImageWithValidCredentials(t *testing.T) {
assert := DockerAssert{}
if os.Getenv("REGISTRY_CREDENTIAL_ENCODED") != "" && os.Getenv("AUTHENTICATED_REGISTRY_IMAGE") != "" {
DoTestCreatePeerPodWithAuthenticatedImageWithValidCredentials(t, testEnv, assert)
} else {
t.Skip("Registry Credentials, or authenticated image name not exported")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ func (lio *DockerInstallOverlay) Edit(ctx context.Context, cfg *envconf.Config,
}
}

if err := lio.Overlay.SetAuthJsonSecretIfApplicable(); err != nil {
return err
}

if err := lio.Overlay.YamlReload(); err != nil {
return err
}
Expand Down

0 comments on commit e76838c

Please sign in to comment.