Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Feature: Basic support for Google Artifact Registry #35

Closed
wants to merge 23 commits into from

Conversation

patricklubach
Copy link
Contributor

Hello there,

as the current version of terraform-google-gcr-cleaner only supports Google Container Registry, I wanted to add basic support for Google Artifact Registry as the gcr-cleaner already supports it and I need this feature for myself. Please have a look on this.

@patricklubach
Copy link
Contributor Author

patricklubach commented Jan 20, 2022

I have to run pre-commit and extend the README. I will add the additional variable shortly.

@patricklubach
Copy link
Contributor Author

Hello @anouarchattouna, @PascalBourdier and @mirakl-admin, do anyone of have time to have a look on this? Would highly appreciate if you catch time.

* Implement dry_run to easily list images to delete

* Add dry-run in filter (used for job name)

* Update locals to remove dry_run condition when parameters is not set

* Fix expression for dry_run for repositories
@anouarchattouna
Copy link
Contributor

Hi @patricklubach, thank you for this PR.
We will have a look ASAP!

Copy link
Contributor

@anouarchattouna anouarchattouna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition, the google-beta provider should be added and configured in examples

locals.tf Outdated Show resolved Hide resolved
variables.tf Outdated Show resolved Hide resolved
iam.tf Outdated Show resolved Hide resolved
iam.tf Outdated Show resolved Hide resolved
iam.tf Show resolved Hide resolved
@anouarchattouna
Copy link
Contributor

I am facing this error when testing the minimal example

│ Error: Error retrieving IAM policy for artifactregistry repository "projects/my-test-project/locations/europe-west3/repositories/nginx": googleapi: Error 403: The caller does not have permission

│   with module.gcr_cleaner.google_artifact_registry_repository_iam_member.member["nginx"],
│   on ../../iam.tf line 42, in resource "google_artifact_registry_repository_iam_member" "member":
│   42: resource "google_artifact_registry_repository_iam_member" "member" {

@patricklubach
Copy link
Contributor Author

I'll try to quickly resolve all your findings. Thank you very much for reviewing!

@patricklubach patricklubach changed the title Basic support for Google Artifact Registry Feture: Basic support for Google Artifact Registry Jan 28, 2022
@patricklubach patricklubach changed the title Feture: Basic support for Google Artifact Registry Feature: Basic support for Google Artifact Registry Jan 28, 2022
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, this kind of file should not be added to your PR.

Copy link
Contributor Author

@patricklubach patricklubach Jan 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, I don't know why this is included. All I did, is rebased my branch with the current main branch. Normally this shouldn't be changed or am I wrong?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please rebase yours with the last upstream main branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did but seems to be no changes to this issue. What's weird, is when I am doing a git diff upstream/main locally, I cannot see that these files are changed.

@patricklubach
Copy link
Contributor Author

I am facing this error when testing the minimal example

│ Error: Error retrieving IAM policy for artifactregistry repository "projects/my-test-project/locations/europe-west3/repositories/nginx": googleapi: Error 403: The caller does not have permission
│
│   with module.gcr_cleaner.google_artifact_registry_repository_iam_member.member["nginx"],
│   on ../../iam.tf line 42, in resource "google_artifact_registry_repository_iam_member" "member":
│   42: resource "google_artifact_registry_repository_iam_member" "member" {

I tested minimal example and it works for me. No permissions is truly a very generic issue. Is there some way I can help you?

@patricklubach
Copy link
Contributor Author

@anouarchattouna I created another PR #39 that do not have all these file changes and close this one. I think the reason for this was a bit messed up git history. Sorry for that inconvenience.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants