Use server-side apply patch to update the resolved cross-resource references#623
Merged
turkenh merged 1 commit intocrossplane:masterfrom Dec 11, 2023
Merged
Conversation
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.
Description of your changes
This PR proposes to use server-side apply patch operations in managed.APISimpleReferenceResolver when updating the resolved cross-resource references. This will enable us to address the issue reported in crossplane-contrib/provider-upjet-aws#975 by specifying the SSA merge strategy for the object list
spec.forProvider.vpcConfigand with the root cause described in detail here.An example patch document computed while updating the resolved VPC ID for the following manifests:
is:
{ "apiVersion": "ec2.aws.upbound.io/v1beta1", "kind": "Subnet", "spec": { "forProvider": { "vpcId": "vpc-08f590a352d767c2f", "vpcIdRef": { "name": "sample-vpc-alper-1" } } } }And the resulting managed field object is:
{ "apiVersion": "ec2.aws.upbound.io/v1beta1", "fieldsType": "FieldsV1", "fieldsV1": { "f:spec": { "f:forProvider": { "f:vpcId": {}, "f:vpcIdRef": { "f:name": {} } } } }, "manager": "managed.crossplane.io/api-simple-reference-resolver", "operation": "Apply", "time": "2023-12-07T14:51:26Z" }I have:
make reviewable testto ensure this PR is ready for review.How has this code been tested
Tested via a custom build of
upbound/provider-awswith the above manifests and also with the configuration packagesupbound/configuration-aws-eksandupbound/configuration-aws-networkin the context of crossplane-contrib/provider-upjet-aws#975. The AWS family provider packages used in these tests areindex.docker.io/ulucinar/provider-aws-{ec2, iam, eks}:v0.45.0-c914fe18a92011992e32630ca4d0dba4a8f36242and the configuration packages areindex.docker.io/ulucinar/configuration-aws-{network, eks}:v0.45.0-c914fe18a92011992e32630ca4d0dba4a8f36242.