fix(gcp): List locations before getting run services#5919
Merged
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom Dec 22, 2022
Merged
fix(gcp): List locations before getting run services#5919kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
Conversation
This PR has the following changes to source plugin(s) tables:
|
d6f5b36 to
67c8be0
Compare
disq
approved these changes
Dec 22, 2022
bbernays
approved these changes
Dec 22, 2022
kodiakhq bot
pushed a commit
that referenced
this pull request
Dec 27, 2022
🤖 I have created a release *beep* *boop* --- ## [5.3.0](plugins-source-gcp-v5.2.0...plugins-source-gcp-v5.3.0) (2022-12-27) ### Features * **gcp:** Fetch Only enabled services ([#5534](#5534)) ([667b567](667b567)) * **resources:** Add API Gateway ([#5926](#5926)) ([7bb33a8](7bb33a8)) ### Bug Fixes * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.13.1 ([#5897](#5897)) ([ad15915](ad15915)) * **gcp:** List locations before getting run services ([#5919](#5919)) ([7581466](7581466)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
kodiakhq bot
pushed a commit
that referenced
this pull request
Dec 27, 2022
#### Summary Follow up to #5919. Fixes the description link for the `run_locations` table <!--
erezrokah
added a commit
that referenced
this pull request
Dec 29, 2022
<!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 --> #### Summary Relevant API - https://cloud.google.com/artifact-registry/docs/reference/rest Similar to #5919, we need the locations to list the resources (tried using different types of wildcards like `-`, `global`, `*` and they don't work). Same as #5919 the locations list method is only on the old API, so again we can't test this as our testing framework uses HTTP for old API and gRPC server for new, which means we need 2 different endpoints and to change the client endpoint mid sync. I did ran it on our `cq-playground` account and it synced data for all the tables successfully ### Notes The API has a few other list methods, neither part of the Go SDK nor supported by `gcloud` so I didn't add them: - https://cloud.google.com/artifact-registry/docs/reference/rest/v1/projects.locations.repositories.mavenArtifacts/list - https://cloud.google.com/artifact-registry/docs/reference/rest/v1/projects.locations.repositories.npmPackages/list - https://cloud.google.com/artifact-registry/docs/reference/rest/v1/projects.locations.repositories.pythonPackages/list <!-- Use the following steps to ensure your PR is ready to be reviewed - [ ] Read the [contribution guidelines](../blob/main/CONTRIBUTING.md) 🧑🎓 - [ ] Test locally on your own infrastructure - [ ] Run `go fmt` to format your code 🖊 - [ ] Lint your changes via `golangci-lint run` 🚨 (install golangci-lint [here](https://golangci-lint.run/usage/install/#local-installation)) - [ ] Update or add tests 🧪 - [ ] Ensure the status checks below are successful ✅ --->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #5385.
In order to list run services we need to pass a location (can't use the wildcard). The v2 API of cloud run doesn't support listing locations, so we use the v1 API to list the locations, and v2 to list the services.
Thank you @bernays for pointing me to the right API.
This is implemented as a relation since it's a list->list.
Notes:
gcp_run_servicesin the config it will now work + get the locations top level table