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

fix: Mark composite as unready if resources are skipped #137

Conversation

MisterMX
Copy link
Contributor

This small fix marks the desired composite as unready in the response if one of the resource templates is skipped due to a missing required patch path.

Related to #12.

Comment on lines +276 to +278
if skipped > 0 {
rsp.GetDesired().GetComposite().Ready = fnv1beta1.Ready_READY_FALSE
}
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately I don't think this'll work. Functions can't directly specify the readiness of the XR, they're supposed to influence it by specifying the readiness of composed resources.

https:/crossplane/function-sdk-go/blob/29ea8ddbfa554ede602e4ca7f13c5883112159a3/proto/v1beta1/run_function.proto#L230-L231

Obviously that makes this tricky, given Crossplane wouldn't even know the composed resource exists in this case. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, tests turned out, that it is not working as expected since the ready state of the composite is hardcoded in crossplane to be determined by the ready state of the composed resources.

We have implemented a workaround that sets an arbitrary composed resource to unready until a set of dependent resources is available. Its more like a hack than an actual solution but it seems to be the only way to prevent this issue at the moment.

@negz are there any plans to change this behaviour in the implementation of the function renderer of Crossplane? It is very confusing that the ready field exists but is not recognized at all.

@MisterMX
Copy link
Contributor Author

Closing since it does not actually solve the problem due to Crossplane ignoring the ready property for composite resources.

We solved this problem in a custom function implementation by keeping an arbitrary resource explicitly as unready until all other resources exist. Then the regular readiness checks takes over.

@MisterMX MisterMX closed this Aug 14, 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.

2 participants