-
Notifications
You must be signed in to change notification settings - Fork 19
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 #123
Conversation
/test-examples="examples/conditionalaccess/accesspolicy.yaml" |
1 similar comment
/test-examples="examples/conditionalaccess/accesspolicy.yaml" |
87dd8fb
to
834500d
Compare
/test-examples="examples/conditionalaccess/v1beta2/accesspolicy.yaml" |
834500d
to
0410759
Compare
/test-examples="examples/conditionalaccess/v1beta2/accesspolicy.yaml" |
1 similar comment
/test-examples="examples/conditionalaccess/v1beta2/accesspolicy.yaml" |
e53de92
to
bf9bf2a
Compare
/test-examples="examples/conditionalaccess/v1beta2/accesspolicy.yaml" |
8342e74
to
510d8bc
Compare
/test-examples="examples/conditionalaccess/v1beta2/accesspolicy.yaml" |
1 similar comment
/test-examples="examples/conditionalaccess/v1beta2/accesspolicy.yaml" |
/test-examples="examples/conditionalaccess/v1beta2/location.yaml" |
Hi @sergenyalcin, I'll just disable the import tests for |
/test-examples="examples/conditionalaccess/v1beta2/accesspolicy.yaml" |
/test-examples="examples/conditionalaccess/v1beta2/location.yaml" |
94b8e78
to
d3c803e
Compare
/test-examples="examples/conditionalaccess/v1beta2/accesspolicy.yaml" |
/test-examples="examples/conditionalaccess/v1beta2/location.yaml" |
/test-examples="examples/conditionalaccess/v1beta1/accesspolicy.yaml" |
d3c803e
to
1970fe5
Compare
/test-examples="examples/conditionalaccess/v1beta2/accesspolicy.yaml" |
/test-examples="examples/conditionalaccess/v1beta2/location.yaml" |
/test-examples="examples/conditionalaccess/v1beta2/accesspolicy.yaml" |
2 similar comments
/test-examples="examples/conditionalaccess/v1beta2/accesspolicy.yaml" |
/test-examples="examples/conditionalaccess/v1beta2/accesspolicy.yaml" |
50405c1
to
9e2c280
Compare
/test-examples="examples/applications/v1beta1/application.yaml" |
/test-examples="examples/groups/v1beta1/member.yaml" |
/test-examples="examples/serviceprincipaldelegated/v1beta1/permissiongrant.yaml" |
/test-examples="examples/synchronization/v1beta1/job.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. Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Signed-off-by: Alper Rifat Ulucinar <[email protected]>
to facilitate downgrades Signed-off-by: Alper Rifat Ulucinar <[email protected]>
…bjects - Fix the example manifest examples/directoryroles/v1beta1/customdirectoryrole.yaml Signed-off-by: Alper Rifat Ulucinar <[email protected]>
…dded object API versions Signed-off-by: Alper Rifat Ulucinar <[email protected]>
…eta1 & v1beta2 versions of the CRDs that have converted singleton lists in their APIs and enable the conversion webhooks. - Use kustomize to inject the spec.conversion stanzas to the generated CRDs - Dependency version Bumps: kind -> v0.21.0, up -> v0.28.0, uptest -> v0.11.1 - Pin uxp version to 1.14.6-up.1 Signed-off-by: Alper Rifat Ulucinar <[email protected]>
…ion to set the webhook TLS certificates directory. - Duplicate GVKs in zz_register.go are removed. - Hubs and spokes are now generated from scratch at each "make generate". Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Signed-off-by: Alper Rifat Ulucinar <[email protected]>
97f194c
to
803e88e
Compare
/test-examples="examples/groups/v1beta1/member.yaml" |
/test-examples="examples/serviceprincipaldelegated/v1beta1/permissiongrant.yaml" |
/test-examples="examples/synchronization/v1beta1/job.yaml" |
/test-examples="examples/groups/v1beta1/member.yaml" |
/test-examples="examples/conditionalaccess/v1beta2/accesspolicy.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!
- Bump upjet to commit 03a207b6416a - Bump uptest to version v0.12.0-9.gac371c9 Signed-off-by: Alper Rifat Ulucinar <[email protected]>
/test-examples="examples/conditionalaccess/v1beta2/accesspolicy.yaml" |
/test-examples="examples/groups/v1beta1/member.yaml" |
Upgrade Test
Upgrade test successful Downgrade Test
Downgrade test successful |
Description of your changes
Depends on: crossplane/upjet#387
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 had to configure field name overrides for
HTTP{S}HealthCheck.compute
andVersion.dialogflowcx
so that the correspnding type names for thespec.forProvider
,spec.initParameter
andstate.atProvider
fields are not duplicated with the introduction ofv1beta2
packages.We have also removed the SSA merge strategy configurations from the
v1beta2
versions ofCluster.container
&NodePool.container
resources because the related fields are no longer lists and have been converted to embedded objects in theirv1beta2
versions.I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR if necessary.How has this code been tested
A successful uptest run with the converted APIs is observed here: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8723779942
Examples from successful uptest runs with conversion Webhooks enabled:
Uptest runs for available uptestable resources:
v1beta1 resources
examples/administrativeunits/v1beta1/unit.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783425311examples/app/v1beta1/roleassignment.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783436140examples/applications/v1beta1/application.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783428288examples/applications/v1beta1/certificate.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783429397examples/applications/v1beta1/federatedidentitycredential.yaml
https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783592783examples/applications/v1beta1/password.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783850825examples/applications/v1beta1/preauthorized.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783430121examples/conditionalaccess/v1beta1/accesspolicy.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783431498examples/conditionalaccess/v1beta1/location.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783432163examples/directoryroles/v1beta1/customdirectoryrole.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783432941examples/directoryroles/v1beta1/roleassignment.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8782162727examples/groups/v1beta1/group.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783599499examples/groups/v1beta1/member.yaml
: Uptest failed in the delete step (testhooks/delete-member.sh: permission denied), manual test successful.examples/policies/v1beta1/claimsmappingpolicy.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783602801examples/serviceprincipaldelegated/v1beta1/permissiongrant.yaml
: Uptest failed in the delete step (testhooks/delete-permissiongrant.sh: permission denied), manual test successful.examples/serviceprincipals/v1beta1/certificate.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8787919126examples/serviceprincipals/v1beta1/claimsmappingpolicyassignment.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8784604890examples/serviceprincipals/v1beta1/password.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8785038521examples/serviceprincipals/v1beta1/principal.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8784021673examples/synchronization/v1beta1/job.yaml
: Uptest failed in the delete step (testhooks/delete-secret.sh: permission denied), manual test successful.examples/users/v1beta1/user.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783620282v1beta2 ressources
examples/applications/v1beta2/application.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783430807examples/conditionalaccess/v1beta2/accesspolicy.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783431498examples/conditionalaccess/v1beta2/location.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783929325examples/groups/v1beta2/group.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8783439239examples/serviceprincipals/v1beta2/principal.yaml
: https://github.com/crossplane-contrib/provider-upjet-azuread/actions/runs/8784864220