Skip to content

Conversation

@mateczagany
Copy link
Contributor

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

  • Before the end of each reconciliation phase of a snapshot, update its labels to reflect the latest spec/status.
  • Change UpdateControl logic to also update the resource if the labels have changed.

Verifying this change

  • Unit testing
  • Manual testing

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changes to the CustomResourceDescriptors: yes, but only labels were added/changed
  • Core observer or reconciler logic that is regularly executed: yes

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

Copy link
Contributor

@gyfora gyfora left a comment

Choose a reason for hiding this comment

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

Looks good! Please rebase on main

@gyfora gyfora merged commit d2c0173 into apache:main Oct 11, 2024
233 checks passed
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