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

Manual releases comply with container image tag filters; and --force #1270

Merged
merged 4 commits into from
Aug 14, 2018

Conversation

rndstr
Copy link
Contributor

@rndstr rndstr commented Aug 4, 2018

This PR makes manual releases to comply with container image tag filters (previously only automated releases did so), and adds the option to force a release outside of these constraints. force also ignores locked controllers when targeted at specific controllers.

Please have a lock at individual commit messages for further details.

Closes #941
Closes #1054

@rndstr rndstr requested a review from squaremo August 4, 2018 00:13
@rndstr rndstr force-pushed the issue/941-force-release branch from 1cecd52 to 91da27a Compare August 4, 2018 00:17
@squaremo
Copy link
Member

squaremo commented Aug 9, 2018

Should this be for merge into master?

Copy link
Member

@squaremo squaremo left a comment

Choose a reason for hiding this comment

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

Neatly done. I've commented on the two main changes; in both cases the condition and accompanying explanation didn't quite scan; but, if they make sense to you, that is fine with me.

@@ -80,6 +82,16 @@ func (opts *controllerReleaseOpts) RunE(cmd *cobra.Command, args []string) error
return newUsageError("please supply either --all, or at least one --controller=<controller>")
}

if opts.force && opts.allControllers && opts.allImages {

This comment was marked as abuse.

This comment was marked as abuse.

if err != nil {
return nil, nil, err
// Only consider locked images if specific controllers requested and forced
if len(ids) == 0 || !s.Force {

This comment was marked as abuse.

filteredImages := imageRepos.GetRepoImages(currentImageID.Name).FilterAndSort(policy.PatternAll)
tagPattern := policy.PatternAll
// Only consider _all_ images if specific image requested and forced
if s.ImageSpec == ImageSpecLatest || !s.Force {

This comment was marked as abuse.

This comment was marked as abuse.

@rndstr rndstr force-pushed the issue/941-force-release branch from 91da27a to bd4ea9e Compare August 13, 2018 19:11
@rndstr rndstr changed the base branch from issue/706-semver-filtering-ordering to master August 13, 2018 19:12
@rndstr rndstr force-pushed the issue/941-force-release branch from bd4ea9e to 3c2d3e2 Compare August 14, 2018 20:24
rndstr added 3 commits August 14, 2018 13:35
The automated release process complies with container image tag filters
that only release images that match that tag pattern.

This commit extends the manual release to comply with image tag filters
as well.
A manual release through the API or then with fluxctl may come across
cases where configuration prevents it to perform a certain update. That
can either be a locked controller, or a container image that is
filtered. This PR adds `--force` to the CLI and `Force` to the release
spec in the API to circumvent restrictions on a per-command basis.

For locked controllers, `--force` will disregard their locked state when
controllers are listed separeately. But `--all` invocation will ignore
the `--force` flag.

For container tag filters, `--force` will allow to update to images
outside of that specification. Again, using `--update-all-images` will
remove the effect of `--force` for images.

For older daemons used in conjunction with a new fluxctl, the `--force`
param will just be ignored which should be OK since it's doing less than
intended.
@rndstr rndstr force-pushed the issue/941-force-release branch from 3c2d3e2 to 4a61243 Compare August 14, 2018 20:36
Can be commit and sync, we only care about sync.
@rndstr rndstr force-pushed the issue/941-force-release branch from 4a61243 to 8858231 Compare August 14, 2018 20:40
@rndstr rndstr merged commit 66bf8a0 into master Aug 14, 2018
@rndstr rndstr deleted the issue/941-force-release branch August 14, 2018 20:57
@rade
Copy link
Contributor

rade commented Aug 14, 2018

Shouldn't there have been some docs updates in this? E.g. in https://github.com/weaveworks/flux/blob/master/site/using.md#image-tag-filtering, where it says "When automation is turned on...". And surely the --force flag deserves a mention somewhere.

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.

3 participants