Skip to content

Commit

Permalink
chore(external-secrets): migrate to Docker harness (#2479)
Browse files Browse the repository at this point in the history
Signed-off-by: Mauren Berti <[email protected]>
  • Loading branch information
stormqueen1990 authored Apr 12, 2024
1 parent 1a792e8 commit acd922b
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions images/external-secrets/tests/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,34 @@ data "oci_string" "ref" {
input = var.digest
}

# TODO: Convert this to imagetest_harness_container when ready
data "oci_exec_test" "version" {
digest = var.digest
script = <<EOF
# We expect the command to fail, but want its output anyway.
( docker run --rm $IMAGE_NAME --help 2>&1 || true ) | grep external-secrets
EOF
data "imagetest_inventory" "this" {}

resource "imagetest_harness_docker" "this" {
name = "external-secrets-container"
inventory = data.imagetest_inventory.this

envs = {
IMAGE_NAME : var.digest
}
}

data "imagetest_inventory" "this" {}
resource "imagetest_feature" "this" {
harness = imagetest_harness_docker.this
name = "basic container test"
description = "basic container test to verify that things run as expected"

steps = [
{
name = "Run container"
cmd = <<EOT
docker run --rm $IMAGE_NAME --help 2>&1
EOT
}
]
}

resource "imagetest_harness_k3s" "this" {
name = "external-secrets"
name = "external-secrets-k3s"
inventory = data.imagetest_inventory.this

sandbox = {
Expand Down

0 comments on commit acd922b

Please sign in to comment.