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

Predicate to filter out ignored objects #31

Merged

Conversation

itamar-marom
Copy link
Collaborator

@itamar-marom itamar-marom commented Mar 21, 2023

Fixes #4

Description

Instead of filtering CRs in the Reconcile function, we want predicates to filter them out.

This PR deprecates the Spec.Ignored and handles the ignore functionality with the annotation druid.apache.org/ignored. When the value of this annotation is "true" the object will be ignored. Any other value will reconcile the object.

The API still exists to avoid breaking change.

Also, the logic of the Spec.Ignored in the Reconcile function has been removed, and a new function has been added to the predicates.

Also, some consts has moved to new file - types.go


This PR has:

  • been tested on a real K8S cluster to ensure creation of a brand new Druid cluster works.
  • been tested for backward compatibility on a real K*S cluster by applying the changes introduced here on an existing Druid cluster. If there are any backward incompatible changes then they have been noted in the PR description.
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added documentation for new or modified features or behaviors.

Key changed/added files in this PR
  • predicates.go
  • handler.go
  • types.go

@itamar-marom itamar-marom changed the title Predicate to filter out CR Specs Predicate to filter out ignored objects Mar 22, 2023
@itamar-marom itamar-marom marked this pull request as ready for review March 22, 2023 22:27
Copy link
Contributor

@AdheipSingh AdheipSingh left a comment

Choose a reason for hiding this comment

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

Thanks LGTM.

@AdheipSingh AdheipSingh merged commit a4f308b into datainfrahq:master Mar 24, 2023
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.

Use predicate to filter out CR Specs NOT to be reconciled
2 participants