-
Notifications
You must be signed in to change notification settings - Fork 76
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
Convert all singleton lists in the MR APIs to embedded objects #733
Conversation
2bc9ecb
to
41c9bbf
Compare
ceab332
to
7f8c647
Compare
/test-examples="examples/cdn/v1beta2/endpoint.yaml" |
/test-examples="examples/cdn/v1beta2/frontdoorrule.yaml" |
/test-examples="examples/compute/v1beta2/capacityreservation.yaml" |
/test-examples="examples/compute/v1beta2/sharedimage.yaml" |
/test-examples="examples/cdn/v1beta2/endpoint.yaml" |
1 similar comment
/test-examples="examples/cdn/v1beta2/endpoint.yaml" |
/test-examples="examples/cdn/v1beta2/frontdoorrule.yaml" |
/test-examples="examples/compute/v1beta2/capacityreservation.yaml" |
/test-examples="examples/compute/v1beta2/sharedimage.yaml" |
/test-examples="examples/containerservice/v1beta2/kubernetescluster.yaml" |
/test-examples="examples/cosmosdb/v1beta2/account.yaml" |
/test-examples="examples/dbforpostgresql/v1beta2/server.yaml" |
/test-examples="examples/network/v1beta2/profile.yaml" |
/test-examples="examples/network/v1beta2/routefilter.yaml" |
/test-examples="examples/sql/v1beta2/mssqlelasticpool.yaml" |
/test-examples="examples/web/v1beta2/appserviceplan.yaml" |
/test-examples="examples/network/v1beta1/routefilter.yaml" |
/test-examples="examples/network/v1beta2/subnet.yaml" |
/test-examples="examples/cosmosdb/v1beta2/mongocollection.yaml" |
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.
Thanks @ulucinar LGTM!
/test-examples="examples/network/v1beta2/subnet.yaml" |
- Terraform configuration blocks, even if they have a MaxItems constraint of 1, are (almost) always generated as lists. We now generate the lists with a MaxItems constraint of 1 as embedded objects in our MR APIs. - This also helps when updating or patching via SSA the (previously list) objects. The merging strategy implemented by SSA requires configuration for associative lists and converting the singleton lists into embedded objects removes the configuration need. - Bump up to v0.28.0 - Temporarily add the $(UPTEST_LOCAL) make target to consume uptest from the main channel. Signed-off-by: Alper Rifat Ulucinar <[email protected]>
…larations - Run "make generate" Signed-off-by: Alper Rifat Ulucinar <[email protected]>
…fig.Resource.Type's with config.Resource.TerraformName's. Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Signed-off-by: Alper Rifat Ulucinar <[email protected]>
…e.PreviousVersions for the prevention of the type name conflicts in the generated multi-versioned CRDs. - config.Resource.OverrideFieldNames is being deprecated in favor of config.Resource.PreviousVersions. - Bump upjet to commit b5622a10e14d. Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Signed-off-by: Sergen Yalçın <[email protected]>
…cile version is v1beta2 Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Signed-off-by: Sergen Yalçın <[email protected]>
… generated Signed-off-by: Sergen Yalçın <[email protected]>
/test-examples="examples/network/v1beta2/subnet.yaml" |
with singleton lists Signed-off-by: Alper Rifat Ulucinar <[email protected]>
/test-examples="examples/network/v1beta2/subnet.yaml" |
Description of your changes
Depends on: crossplane/upjet#387, crossplane/upjet#400, crossplane/upjet#402, #739
Terraform configuration blocks, even if they have a MaxItems constraint of 1, are (almost) always generated as lists. We
now generate the lists with a MaxItems constraint of 1 as embedded objects in our MR APIs.
This also helps when updating or patching via SSA the (previously list) objects. The merging strategy implemented by SSA requires configuration for associative lists and converting the singleton lists into embedded objects removes the configuration need.
The provider generates the converted embedded objects in the new
v1beta2
versions of the CRD APIs and registers upjet's identity converter and the singleton list converters to be invoked, in chain, by the CRD API conversion webhooks. This implies that thev1beta1
versions stay intact, and old clients not aware of the new APIs should continue functioning as before (backwards-compatibility). Any clients willing to use the embedded objects-based APIs should be updated to use thev1beta2
versions of the CRD APIs.If a resource contains no singleton lists, then the
v1beta2
version is not generated for it.We need #745 to fix the configurations to address an inconsistency between the JSON & Go resource schemas.
I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR if necessary.config.Resource.References[*].Type
withconfig.Resource.References[*].TerraformName
v1beta2
manifests.v1beta1
How has this code been tested
Via various uptest runs below.