Skip to content

Commit

Permalink
reenabled arm test for autopublish
Browse files Browse the repository at this point in the history
  • Loading branch information
aahel committed Mar 1, 2024
1 parent 4d8bce1 commit c20e044
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/lambda-registrator/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ variable "arch" {
description = "Lambda Architecture. Valid values are arm64 and x86_64"

validation {
condition = can(regex("^(arm64|x86_64)$", var.arch))
condition = contains(["arm64", "x86_64"], var.arch)
error_message = "Invalid value for 'arch', options: 'arm64', 'x86_64'."
}
}
4 changes: 1 addition & 3 deletions test/acceptance/tests/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ func TestBasic(t *testing.T) {
for name, c := range cases {
t.Run(name, func(t *testing.T) {
config := suite.Config()
if config.Arch == "arm64" && c.autoPublishRegistrator {
t.Skip("skipping since we currently dont have arm64 ecr images of lambda registrator")
}
tfVars := config.TFVars()
tfVars["secure"] = c.secure
tfVars["arch"] = config.Arch
Expand Down Expand Up @@ -92,6 +89,7 @@ func TestBasic(t *testing.T) {

if c.autoPublishRegistrator {
tfVars["enable_auto_publish_ecr_image"] = true
tfVars["consul_lambda_registrator_image"] = config.ECRImageURI
if c.privateEcrRepoName != "" {
tfVars["private_ecr_repo_name"] = c.privateEcrRepoName
}
Expand Down
1 change: 1 addition & 0 deletions test/acceptance/tests/setup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,5 @@ module "lambda-registration" {
consul_extension_data_prefix = "/${var.suffix}"
private_ecr_repo_name = var.private_ecr_repo_name
arch = var.arch == "arm64" ? "arm64" : "x86_64"
consul_lambda_registrator_image = var.consul_lambda_registrator_image
}
11 changes: 11 additions & 0 deletions test/acceptance/tests/setup/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,15 @@ variable "arch" {
type = string
default = "x86_64"
description = "Lambda Architecture"
}

variable "consul_lambda_registrator_image" {
description = "The Lambda registrator image to use. Must be provided as <registry/repository:tag>"
type = string
default = "public.ecr.aws/hashicorp/consul-lambda-registrator:0.1.0-beta4"

validation {
condition = can(regex("^[a-zA-Z0-9_.-]+/[a-z0-9_.-]+/[a-z0-9_.-]+:[a-zA-Z0-9_.-]+$", var.consul_lambda_registrator_image))
error_message = "Image format of 'consul_lambda_registrator_image' is invalid. It must be in the format 'registry/repository:tag'."
}
}

0 comments on commit c20e044

Please sign in to comment.