[FLINK-36109][snapshot] Add labels to snapshot resources #887
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.
What is the purpose of the change
Adds labels to FlinkStateSnapshot resources managed by the operator to allow for filtering. Currently we have no way to easily filter snapshots resources (e.g. by job reference, snapshot type or state), since the API server only allows to filter by labels for custom resources.
The only way currently is to download all resources from the API-server and filter the resources client-side. Filtering by labels allows the API-server to serve the snapshots in a more optimized way.
Once KEP-4358 is available as GA, we can hopefully gradually switch to using spec and status fields as field selectors.
Brief change log
UpdateControllogic to also update the resource if the labels have changed.Verifying this change
Does this pull request potentially affect one of the following parts:
CustomResourceDescriptors: yes, but only labels were added/changedDocumentation