-
Notifications
You must be signed in to change notification settings - Fork 2
Description
What happened?
When using function-kcl, it is common to reference the observed state of the composite resource or other context variables via option("params").ocds.
Current Behavior:
When running crossplane-diff, the ocds variable appears to be empty or unpopulated during the render phase. Consequently, any logic in the KCL function that relies on these variables results in null values in the rendered output. This generates false positives in the diff, showing fields changing from a valid value (live) to null (rendered).
Expected Behavior:
crossplane-diff should ideally mock or allow passing of the Observed Composite context so that KCL functions can render resources correctly with the expected variable values.
How can we reproduce it?
# In the KCL function
ocds = option("params").ocds
region = ocds["composite"]["spec"]["region"] # This evaluates to null/empty during diff
What environment did it happen in?
Crossplane version: 1.20
Kubernetes version : 1.32