From bb1ad0fae0e70880bc7152f245f8733829f31861 Mon Sep 17 00:00:00 2001 From: Stefano Sibilia <24303019+Stevesibilia@users.noreply.github.com> Date: Wed, 9 Oct 2024 16:16:45 +0200 Subject: [PATCH] Platform#3202 (#12) * refs platform#3202: add support for public registry mirror (dockerhub) * refs platform3202: update changelog * refs platform#3202: changelog fix --------- Co-authored-by: Stefano Sibilia --- CHANGELOG.md | 6 ++++++ main.tf | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be235d8..ed70f00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,12 @@ Following semver, any non backwards compatible feature implies that the next rel ## [Unreleased] +## [0.6.0] - 2024-10-09 + +[Compare with previous version](https://github.com/sparkfabrik/terraform-google-gcp-artifact-registry/compare/0.5.0...0.6.0) + +- FEATURE: add support for mirror public registry (Docker Hub) if `custom_repository_uri` is `DOCKER_HUB` + ## [0.5.0] - 2024-08-29 [Compare with previous version](https://github.com/sparkfabrik/terraform-google-gcp-artifact-registry/compare/0.4.0...0.5.0) diff --git a/main.tf b/main.tf index 9de5388..37c7ad6 100644 --- a/main.tf +++ b/main.tf @@ -90,9 +90,19 @@ resource "google_artifact_registry_repository" "repositories" { content { description = remote_repository_config.value.description == "" ? each.value.description : remote_repository_config.value.description - docker_repository { - custom_repository { - uri = remote_repository_config.value.custom_repository_uri + dynamic "docker_repository" { + for_each = remote_repository_config.value.custom_repository_uri != "DOCKER_HUB" ? [remote_repository_config.value] : [] + content { + custom_repository { + uri = remote_repository_config.value.custom_repository_uri + } + } + } + + dynamic "docker_repository" { + for_each = remote_repository_config.value.custom_repository_uri == "DOCKER_HUB" ? [remote_repository_config.value] : [] + content { + public_repository = "DOCKER_HUB" } }