-
Notifications
You must be signed in to change notification settings - Fork 645
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
stop and remove using regex names #900
stop and remove using regex names #900
Conversation
08fe3ab
to
a4cbc30
Compare
Codecov Report
@@ Coverage Diff @@
## master #900 +/- ##
============================================
- Coverage 53.78% 52.21% -1.57%
+ Complexity 1617 1501 -116
============================================
Files 154 150 -4
Lines 8174 8034 -140
Branches 1251 1212 -39
============================================
- Hits 4396 4195 -201
- Misses 3342 3426 +84
+ Partials 436 413 -23
|
c5fe3f0
to
68e4c12
Compare
68e4c12
to
a038311
Compare
51ceadd
to
c7d2cc9
Compare
* Based on the work of fabric8io#900 (thanks !) * Fixed conflicts * Removed the top-level properties and just check whether the ImageConfiguration has the regular expression set. * Not sure how useful `aliasRegex` is as I suppose that an alias is a fixed name without any version information and stable across releases. For now I removed it (and moved to a `cleanupRegexp` parameter in the image configuration which is the image regexp to use for stop/remove. * Added some docs and streamlined the code a bit
Thanks for the PR, I think this a perfectly valid use case. I resolved the conflicts and made some updates to streamline a bit:
'hope this is ok for you. wrt to |
@@ -81,7 +86,7 @@ public String inspectExecContainer(String containerId) { | |||
} | |||
|
|||
public String listContainers(String ... filter) { | |||
Builder builder = u("containers/json"); | |||
Builder builder = u("containers/json").p("all", true); |
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.
Not sure why do need "all" here ?
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.
Yes, this is so even if the container is stopped it can still be removed. Without "all" only running containers are returned.
c7d2cc9
to
4dbd16b
Compare
fyi, just did a rebase and pushed. |
Sorry did not send feedback I gleaned over this a long time ago and thought it was accepted, it kinda fell off the radar... Alias regex was just so it would be consistent if they are using alias naming. ie.
could be removed with |
@rohanKanojia this is another PR which would need a bit of love. If you feel fancy, you can resolve the conflicts (shouldn't be hard, and then let's try to get this merged). |
1a990b3
to
fab9b7e
Compare
fab9b7e
to
1cdff34
Compare
Signed-off-by: William Rose <[email protected]>
@rohanKanojia @wrosenuance I think this PR overlaps with #1215 so we should decide which one to continue. |
We added now #1215, so this should cover your use case, too. You can expect a release over the weekend. Thanks a lot for the PR and sorry for being that late ;-) |
So we use the maven artifactID as the image name and the version number as the tag for naming our images and containers, the problem is once the version number changes, we can no longer stop or remove old images to deploy the new ones.
This was a quick fix we put together, i don't know how useful this would be to others, But thought i'd at least throw it out there. If it's not useful feel free to close.
Usage:
Enabled stop and remove using regex.
Then under the image tags: