Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Artifact registry docker image data source #16557

Comments

@dibunker
Copy link

dibunker commented Nov 17, 2023

Background

This is somewhat related to the request #4317, but since GCR is being deprecated, I decided to work on creating a data source for Artifact Registry. This is my first time developing in the Terraform Plugin SDK v2, and I'm not sure how to proceed with writing the acceptance test.

What kind of contribution is this issue about?

Handwritten data source.

Related PR(s), if any:

Details

Like in #4317, this would be a data source for a docker image in an Artifact Registry to obtain the fully qualified name and self_link. I've forked the magic modules and started working on a handwritten data source, but I'm stuck on writing the acceptance test.

Conceptually, I understand that I would need an Artifact Registry repository populated with docker images to test the data source against. The question is, how do I get that test fixture? I know there's this public GCR, but I'm not sure if there's an equivalent public Artifact Registry that I could use to test against. If not, is it even possible to push docker images to an Artifact Registry repo within the scope of the test steps once a repository is setup?

I haven't created a PR yet, since the guidelines stated to first test locally, but I would be happy to put up a draft PR if that helps.

b/312432701

@dibunker
Copy link
Author

dibunker commented Nov 20, 2023

@rileykarson That is to get the docker image information, which I'm proposing using on my fork, not for pushing an image.

For the test context, wouldn't we need to create an artifact registry repo, populate it with images, and validate that the API is retrieving the information correctly? That is, the get and list methods are working and the data source attributes are correct.

@ardagnir
Copy link

https://console.cloud.google.com/artifacts/docker/go-containerregistry/us/gcr.io is a public AR repo. It's also a "gcr.io repository", so it should already work as a GCR data source, but should also work for testing AR data sources

@dibunker
Copy link
Author

@ardagnir excellent! I confirmed that I can use the API methods on that AR repo. Now to write some tests.

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.