terraform-provider-docker/internal/provider/authentication_helpers_test.go
Martin d12e13fac9
fix: ECR authentication (#409)
* chore: Adding makefile targets for local building.

* fix: Implement proper parsing of different ECR auth mechanisms.

* chore: Fix typos and cleanup Makefil [skip ci]
2022-07-15 12:25:36 +02:00

19 lines
476 B
Go

package provider
import "testing"
func TestIsECRRepositoryURL(t *testing.T) {
if !isECRRepositoryURL("2385929435838.dkr.ecr.eu-central-1.amazonaws.com") {
t.Fatalf("Expected true")
}
if !isECRRepositoryURL("39e39fmgvkgd.dkr.ecr.us-east-1.amazonaws.com") {
t.Fatalf("Expected true")
}
if isECRRepositoryURL("39e39fmgvkgd.dkr.ecrus-east-1.amazonaws.com") {
t.Fatalf("Expected false")
}
if !isECRRepositoryURL("public.ecr.aws") {
t.Fatalf("Expected true")
}
}