-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Manual releases comply with container image tag filters; and --force #1270
Conversation
1cecd52
to
91da27a
Compare
Should this be for merge into master? |
There was a problem hiding this 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.
cmd/fluxctl/release_cmd.go
Outdated
@@ -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.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
update/release.go
Outdated
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.
This comment was marked as abuse.
Sorry, something went wrong.
update/release.go
Outdated
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.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
91da27a
to
bd4ea9e
Compare
bd4ea9e
to
3c2d3e2
Compare
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.
3c2d3e2
to
4a61243
Compare
Can be commit and sync, we only care about sync.
4a61243
to
8858231
Compare
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 |
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