Skip to content
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

Revert instance diff changes #333

Closed
wants to merge 32 commits into from

Conversation

mbbush
Copy link
Contributor

@mbbush mbbush commented Jan 23, 2024

Description of your changes

See crossplane-contrib/provider-upjet-aws#1104 for more context.

Fixes #

I have:

  • Read and followed Upjet's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Uptest in crossplane-contrib/provider-upjet-aws#1104

negz and others added 30 commits November 11, 2023 23:08
This commit adds SSA merge strategy markers that allow the API server to
granularly merge lists, rather than atomically replacing them. Composition
functions use SSA, so this change means that a function can return only the list
elements it desires (e.g. tags) and those elements will be merged into any
existing elements, without replacing them.

For the moment I've only covered two cases:

* Lists that we know are sets of scalar values (generated from Terraform sets)
* Maps of scalar values (generated from Terraform maps)

I'm hopeful that in both of these cases it _should_ be possible to allow the map
or set to be granularly merged, not atomically replaced.

https://kubernetes.io/docs/reference/using-api/server-side-apply/#merge-strategy

Signed-off-by: Nic Cope <[email protected]>
Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Signed-off-by: Mitch Connors <[email protected]>
Signed-off-by: Mitch Connors <[email protected]>
…okens

- Do not add topological markers for sensitive fields

Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Add server-side apply merge strategy markers
…imeouts while Observe calls

Signed-off-by: Sergen Yalçın <[email protected]>
…ancestate

Put default and configured timeouts to InstanceState for using the timeouts while Observe calls
…rm SDK-based external client

Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Call the registered schema.CustomizeDiffFunc functions in the Terraform SDK-based external client
…igure

the server-side apply merge strategies for object lists & maps.

Signed-off-by: Alper Rifat Ulucinar <[email protected]>
…error-type

Ignore specific error that returned by expandWildcard function
in external-client's Create even if the returned diagnostics contain
errors.

- In most cases, the Terraform plugin SDK's create implementation
  for a resource comprises multiple steps (with the creation of
  the external resource being the very first step). In case, the
  creation succeeds but any of the subsequent steps fail, then
  upjet's TF plugin SDK-based external client will not record
  this state losing the only opportunity to associate the MR
  with the newly provisioned external resource in some cases.
  We now put this initial state into the upjet's in-memory
  state cache so that it's now available for the external-
  client's next observe call.

Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Cache the Terraform instance state returned from schema.Resource.Apply even if the returned diagnostics contain errors
Add config.Resource. ServerSideApplyMergeStrategies to configure the SSA Merge Strategies
- Move the error check to the correct place

Signed-off-by: Sergen Yalçın <[email protected]>
…getexternalnamefn

Pass full state to GetExternalNameFn function to access field other than ID
Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Set the RawPlan for a new terraform.InstanceState returned from an observation
Set diff state's Attributes to nil if the resource does not exist
Signed-off-by: Sergen Yalçın <[email protected]>
…s-for-initprovider

Add reference fields to the InitProvider
This reverts commit 81e2620, reversing
changes made to 1d547af.

Signed-off-by: Matt Bush <[email protected]>
…-diff"

This reverts commit 1d547af, reversing
changes made to 0bc8185.

Signed-off-by: Matt Bush <[email protected]>
@Upbound-CLA
Copy link

Upbound-CLA commented Feb 20, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
4 out of 5 committers have signed the CLA.

✅ ulucinar
✅ mbbush
✅ sergenyalcin
✅ negz
❌ therealmitchconnors
You have signed the CLA already but the status is still pending? Let us recheck it.

@mbbush mbbush closed this Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants