Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Separate filtering into pre- and post- phases #869

Merged
merged 1 commit into from
Dec 29, 2017

Conversation

squaremo
Copy link
Member

When selecting controllers to be updated, we find all those defined in
the repo, then ask the cluster for each one of those, before
subjecting any of them to filtering.

In the case of updating a single controller, this means we do a lot of
calculation that will be redundant, since we don't care about anything
but that controller. It also means any problem with some other
controller in the cluster will prevent that controller being updated.

Instead, use a prefilter to select only the controllers we're going to
ask the cluster about, then apply filters on the information we got
from the cluster*.

An exeption is the treatment of Locked resources -- we have this
information from the repo, but look at it after everything
else. I've kept this, somewhat artificially, to be consistent for now.

*Technically we shouldn't be asking the cluster anything, just
updating the controllers defined in the repo. But one thing at a time.

// in the slice will have higher priority (they are run first).
func (rc *ReleaseContext) SelectServices(results update.Result, filters ...update.ControllerFilter) ([]*update.ControllerUpdate, error) {
defined, err := rc.FindDefinedServices()
// files and the running platform. `ContollerFilter`s can be provided

This comment was marked as abuse.

When selecting controllers to be updated, we find all those defined in
the repo, then ask the cluster for each one of those, before
subjecting any of them to filtering.

In the case of updating a single controller, this means we do a lot of
calculation that will be redundant, since we don't care about anything
but that controller. It also means any problem with some other
controller in the cluster will prevent that controller being updated.

Instead, use a prefilter to select only the controllers we're going to
ask the cluster about, *then* apply filters on the information we got
from the cluster*.

An exeption is the treatment of Locked resources -- we have this
information from the repo, but look at it _after_ everything
else. I've kept this, somewhat artificially, to be consistent for now.

*Technically we shouldn't be asking the cluster anything, just
updating the controllers defined in the repo. But one thing at a time.
@squaremo squaremo force-pushed the issue/868-cannot-read-cronjob branch from 4939c7b to d1ca57f Compare December 29, 2017 11:25
@squaremo squaremo merged commit 687e1f7 into master Dec 29, 2017
@squaremo squaremo deleted the issue/868-cannot-read-cronjob branch December 29, 2017 11:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants