Skip to content

Custom state check configuration for TF plugin framework resources#515

Merged
sergenyalcin merged 2 commits intocrossplane:mainfrom
sergenyalcin:custom-state-check
Jul 28, 2025
Merged

Custom state check configuration for TF plugin framework resources#515
sergenyalcin merged 2 commits intocrossplane:mainfrom
sergenyalcin:custom-state-check

Conversation

@sergenyalcin
Copy link
Copy Markdown
Member

Description of your changes

We observed that a new region interceptor for the AWS TF Framework Plugin resources was introduced. This interceptor intervenes between API calls and the upjet fw controller and unconditionally injects the region into the state.

In the upjet fw controllers, we rely on the API request will return the uninterpreted state (the original form). If this state does not reflect the actual state, it will affect the decision-making processes of the upjet fw controller.

For example, in the Observe call of the upjet fw controller, we decide whether a resource exists by checking whether the returned state is null. However, as pointed out, the interceptor always injects the region field. So, every null check will return false, which means that this check will not work correctly. Also, the TF plugin framework's internal decisions rely on performing checks based on whether the state is null or not.

To handle this problem, we introduced a new configuration mechanism for framework resources. At this resource level, it will provide a generic structure for resolving this issue. The goal is to write custom state checks based on specific conditions at the provider and resource levels to determine whether the state is truly empty.

The main reasons for implementing this generically are to avoid moving provider—and resource-specific logic to upjet, to enable the creation of custom empty checkers at the resource level capable of handling the effects of different interceptors in specific situations, and to keep the scope of this change provider—and resource-specific.

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

Tested locally for a few TF plugin framework resources.

Screenshot 2025-07-25 at 15 47 37 Screenshot 2025-07-25 at 15 51 35 Screenshot 2025-07-25 at 15 52 22 Screenshot 2025-07-25 at 16 03 37

Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
@sergenyalcin sergenyalcin marked this pull request as ready for review July 25, 2025 14:53
Copy link
Copy Markdown
Collaborator

@erhancagirici erhancagirici left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sergenyalcin , overall looks good to me. I left a nit comment, which is not a blocker.

Comment thread pkg/config/resource.go Outdated
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
@sergenyalcin sergenyalcin merged commit 7662364 into crossplane:main Jul 28, 2025
6 checks passed
@sergenyalcin sergenyalcin deleted the custom-state-check branch July 28, 2025 12:18
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.

2 participants