helper/schema: Disallow validation+diff suppression on computed fields #13878
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.
Although we seem to run
ValidateFunc
andDiffSuppressFunc
for computed-only fields, there is (AFAIK) no value in either validation or diff suppression.For validation - even if the API response contained structures that didn't comply with validation restrictions (and I admit it may happen as some APIs may just change) and we raised that as error there's nothing the user can do about it. They can't change or fix the API. The validation should (IMO) be on the other side - in any fields where we might reference these computed fields.
For diff suppression - This feature was designed to suppress differences/drifts between config and state, not between state and state. That is why it has no effect in the context of compute-only field which has no config value to compare the value from state against.
Related #11005
cc @catsby @djosephsen
Test plan
That one failure is a known issue.
We don't have any Rancher environment to test in for the moment.