-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
New, very simple data sources for GCR Repo and Image. #954
New, very simple data sources for GCR Repo and Image. #954
Conversation
Thanks @ndmckinley looks good |
google/provider.go
Outdated
@@ -75,7 +76,8 @@ func Provider() terraform.ResourceProvider { | |||
"google_compute_region_instance_group": dataSourceGoogleComputeRegionInstanceGroup(), | |||
"google_container_cluster": dataSourceGoogleContainerCluster(), | |||
"google_container_engine_versions": dataSourceGoogleContainerEngineVersions(), | |||
"google_active_folder": dataSourceGoogleActiveFolder(), | |||
"google_gcr_repository": dataSourceGoogleGcrRepo(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use the acronym GCR or expand it to container_registry
.
It is also weird to have google_g(oogle)c(ontainer)r(egistry)_repository. google
is repeated twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed - expanded it.
@@ -9,7 +9,7 @@ import ( | |||
func TestDataSourceGoogleGcrRepository(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename the tests too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
} | ||
} | ||
|
||
func gcrRepoRead(d *schema.ResourceData, meta interface{}) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
For reasons I can't figure out, these new docs are crashing the website. I know it's got to be these because it doesn't happen on master, and it does happen on this branch, even with the branch rebased on top of master. The error message is not helping me:
Any ideas? |
Rename also the go files. |
|
||
This data source fetches the project name, and provides the appropriate URLs to use for container registry for this project. | ||
|
||
The URLs are computed entirely offline - as long as the project exists, they will be valid, but this data source does not contact GCR at any point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to use the GCR acronym, you should spell it out fully the first time you use it and add the acronym between parentheses after it.
"github.com/hashicorp/terraform/helper/schema" | ||
) | ||
|
||
func dataSourceGoogleContainerRepo() *schema.Resource { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would split the 2 data sources in different files to follow our convention of one resource or one data source per source file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I take back what I said about the website - error repros when I delete both the files I added and use the google.erb from master, so this change probably doesn't cause that issue. |
|
New, very simple data sources for GCR Repo and Image, plus docs.
Add project import regex
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
I think this fixed #607, but I'm a little fuzzy on the use-case there, so I'd like someone who requested / thumbs-up'd that to look at the code and make sure it's helpful before I invest the time in writing the docs.