Add cloud quota preferences#761
Conversation
| "google_tags_tag_value": config.IdentifierFromProvider, | ||
|
|
||
| // cloudquotas | ||
| "google_cloud_quotas_quota_preference": config.TemplatedStringAsIdentifier("name", "{{ .parameters.parent }}/locations/global/quotaPreferences/{{ .external_name }}"), |
There was a problem hiding this comment.
I think I got this right? https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_quotas_quota_preference#name-4 looks like a pretty cut and dry version of https://github.com/crossplane/upjet/blob/main/docs/adding-new-resource.md#gcp
There was a problem hiding this comment.
Yes, it seems okay, but since we are using the name parameter in the external name here, it would be a good idea to mark it as required. Here is an example configuration:
provider-upjet-gcp/config/redis/config.go
Line 28 in ae12d12
Also, it would be good to move the cloudquotas group to the lines with cloud groups in alphabetical order.
There was a problem hiding this comment.
Done. I believe :) See 190ed4b.
I was anticipating that adding this would affect the code generation and, in turn, mark it as required in the openapi schema at https://github.com/jacobstr/provider-upjet-gcp/blob/1db2f529d96c09b7de407c4775a9d1c3a8440a78/package/crds/cloudquotas.gcp.upbound.io_quotapreferences.yaml#L232
|
|
||
| "google_essential_contacts_contact$": ReplaceGroupWords("", 2), | ||
|
|
||
| "google_cloud_quotas.+$": ReplaceGroupWords("", 2), |
There was a problem hiding this comment.
This little bit is underdocumented in the https://github.com/crossplane/upjet/blob/main/docs/adding-new-resource.md#gcp guide fwiw, but adding this induced the code generation for a new provider as well.
There was a problem hiding this comment.
When we don't add this, which group does it add the resource to?
There was a problem hiding this comment.
cloud.gcp.upbound.io/v1beta1
|
/test-examples="examples/cloudquotas/v1beta1/quotapreference.yaml" |
1 similar comment
|
/test-examples="examples/cloudquotas/v1beta1/quotapreference.yaml" |
cd1f919 to
7be31c1
Compare
| dimensions: | ||
| region: us-east1 | ||
| parent: projects/my-project-name | ||
| quotaConfig: |
There was a problem hiding this comment.
The code gen was producing an array here and that was leading to test failures. I inspected the generated code and the QuotaConfigParameters property is not a slice.
Seems like something to nip in the bud lest the code gen want to clobber my bespoke tuning?
There was a problem hiding this comment.
This is a missing/not handled issue in our code generation pipeline. I opened an issue for this on Upjet after you came across this, feel free to leave a comment there.
However, from what I see here, you have removed the generated example. Changing the generated examples is not recommended and will cause errors in the CI pipeline. After running make generate, please leave the generated example as is and make the corrections in the copied one.
There was a problem hiding this comment.
Pardon the laaate response here. The generated examples are the ones in examples-generated? So leave those intact and modify examples.
Double checking because we're commenting on examples folder. I had not committed the generated example. Just committed a moment ago.
turkenf
left a comment
There was a problem hiding this comment.
Welcome, Jacob Straszynski! 😊
Thanks so much for your first contribution with this PR — I appreciate your effort and patience. I've left a few comments for you to consider.
| "google_tags_tag_value": config.IdentifierFromProvider, | ||
|
|
||
| // cloudquotas | ||
| "google_cloud_quotas_quota_preference": config.TemplatedStringAsIdentifier("name", "{{ .parameters.parent }}/locations/global/quotaPreferences/{{ .external_name }}"), |
There was a problem hiding this comment.
Yes, it seems okay, but since we are using the name parameter in the external name here, it would be a good idea to mark it as required. Here is an example configuration:
provider-upjet-gcp/config/redis/config.go
Line 28 in ae12d12
Also, it would be good to move the cloudquotas group to the lines with cloud groups in alphabetical order.
|
|
||
| "google_essential_contacts_contact$": ReplaceGroupWords("", 2), | ||
|
|
||
| "google_cloud_quotas.+$": ReplaceGroupWords("", 2), |
There was a problem hiding this comment.
When we don't add this, which group does it add the resource to?
| dimensions: | ||
| region: us-east1 | ||
| parent: projects/my-project-name | ||
| quotaConfig: |
There was a problem hiding this comment.
This is a missing/not handled issue in our code generation pipeline. I opened an issue for this on Upjet after you came across this, feel free to leave a comment there.
However, from what I see here, you have removed the generated example. Changing the generated examples is not recommended and will cause errors in the CI pipeline. After running make generate, please leave the generated example as is and make the corrections in the copied one.
|
This provider repo does not have enough maintainers to address every pull request. Since there has been no activity in the last 90 days it is now marked as |
|
/fresh |
|
/test-examples="examples/cloudquotas/v1beta1/quotapreference.yaml" |
|
Hrm I see the job failed:
The file example does have a |
|
@jacobstr, now that the v2 version is out, we're keen to include this PR in the next release of this provider. Can you please rebase it on the latest code from the main? If you can't continue contributing to this one, we'd be happy to take it over for you. |
Initial steps to get the code gen goodness going. I'm aiming to produce a cloudquotas provider for the family as well. Signed-off-by: Jacob Straszynski <jacob.straszynski@planet.com>
Signed-off-by: Jacob Straszynski <jacob.straszynski@planet.com>
Unsure why the code generation made this example a list instead of an object. I suppose terraform allows multiple blocks for some resources, but it doesn't look like a good fit here. Signed-off-by: Jacob Straszynski <jacob.straszynski@planet.com>
Signed-off-by: Jacob Straszynski <jacob.straszynski@planet.com>
Based on feedback from @turkenf since we are using the name parameter in the external name here, it would be a good idea to mark it as required. Signed-off-by: Jacob Straszynski <jacob.straszynski@planet.com>
Signed-off-by: Jacob Straszynski <jacob.straszynski@planet.com> Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
|
Hİ @jacobstr, thanks for your work on this PR. We'd like to get this merged and make sure you get credit for it. We'll take it from here by updating it to resolve conflicts with main and fixing the tests. Appreciate your contribution! |
1db2f52 to
0792efe
Compare
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
0792efe to
ad3899e
Compare
|
/test-examples="examples/cloudquotas/cluster/v1beta1/quotapreference.yaml" |
Description of your changes
Addresses #550. Bulk of the content was this diff in the first commit, everything else was code generation.
Fixes #550
I have:
make reviewableto ensure this PR is ready for review.How has this code been tested
I intend to respond with a comment as outlined here https://github.com/crossplane/upjet/blob/main/docs/adding-new-resource.md#automated-tests---uptest