Skip to content

Commit

Permalink
Platform#3202 (#12)
Browse files Browse the repository at this point in the history
* refs platform#3202: add support for public registry mirror (dockerhub)

* refs platform3202: update changelog

* refs platform#3202: changelog fix

---------

Co-authored-by: Stefano Sibilia <stefano.sibilia@sparkfabrik.com>
  • Loading branch information
Stevesibilia and Stevesibilia authored Oct 9, 2024
1 parent 0785c75 commit bb1ad0f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 13 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

Expand Down

0 comments on commit bb1ad0f

Please sign in to comment.