Skip to content

Conversation

@estroz
Copy link
Member

@estroz estroz commented Nov 21, 2018

Description of the change: document predicate usage in SDK controllers.

Motivation for the change: improves documentation of controller features.

@estroz estroz added the docs label Nov 21, 2018
@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 21, 2018
@hasbro17
Copy link
Contributor

Great work. The doc looks good overall. Can we just extend the example a bit more to make it more illustrative:

pred := predicate.Funcs{
	UpdateFunc: func(e event.UpdateEvent) bool {
		// Ignore updates to CR status in which case metadata.Generation does not change
		return e.MetaOld.GetGeneration() != e.MetaNew.GetGeneration()
	},
	DeleteFunc: func(e event.DeleteEvent) bool {
		// Evaluates to false if the object has been confirmed deleted.
		return !e.DeleteStateUnknown
	},
}

Copy link
Contributor

@hasbro17 hasbro17 left a comment

Choose a reason for hiding this comment

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

LGTM

@estroz estroz merged commit 1b1ebc0 into operator-framework:master Nov 28, 2018
@estroz estroz deleted the doc-predicate branch November 28, 2018 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants