Skip to content
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

oadm prune --namespace=myns does not limit to specified namespace #9502

Closed
soltysh opened this issue Jun 23, 2016 · 4 comments
Closed

oadm prune --namespace=myns does not limit to specified namespace #9502

soltysh opened this issue Jun 23, 2016 · 4 comments

Comments

@soltysh
Copy link
Contributor

soltysh commented Jun 23, 2016

While working on my pruning image card, I wanted to test the pruning only within my test namespace, but invoking oadm prune images -n test --loglevel=4 showed me that all namespaces were taken into consideration. Looking at the pruning source code (builds.go, deployments.go, images.go) we always use kapi.NamespaceAll. The question is should we take namespace into consideration?

In my opinion, and from talking to @miminar for builds and deployments it's quite straightforward, so yes. Unfortunately for images, it's not that simple, since Images are non-namespaced objects, but others using them (ImageStreams, Pods, ReplicationControllerss, BuildConfigs, Builds, DeploymentConfigs) are. The only problem here is, that we can't be sure if an Image which might be a candidate for pruning in one namespace, might be still used in others. In other words, we would have to look through all namespaces still but remove only from those specified.

@miminar @smarterclayton @derekwaynecarr @deads2k thoughts?

@mfojtik
Copy link
Contributor

mfojtik commented Jun 23, 2016

@soltysh I agree. If we support -n on prune we should take it into account when pruning.

@soltysh soltysh assigned soltysh and unassigned mfojtik Jun 23, 2016
@deads2k
Copy link
Contributor

deads2k commented Jun 23, 2016

In other words, we would have to look through all namespaces still but remove only from those specified.

I don't understand. Given an image that isn't used in a particular namespace, what would you do? You can't remove it unless other namespaces aren't using it, but if you're checking other namespaces, it's no longer contained to a namespace.

How about you simply detect if they specified -n and then fail?

@smarterclayton
Copy link
Contributor

It's likely that prune could prune just the image streams for -n. But it
definitely can't remove images.

On Thu, Jun 23, 2016 at 10:14 AM, David Eads notifications@github.com
wrote:

In other words, we would have to look through all namespaces still but
remove only from those specified.

I don't understand. Given an image that isn't used in a particular
namespace, what would you do? You can't remove it unless other namespaces
aren't using it, but if you're checking other namespaces, it's no longer
contained to a namespace.

How about you simply detect if they specified -n and then fail?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#9502 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABG_p5g_leUofibqxzSWRyGC0MZvBrd5ks5qOpTHgaJpZM4I8qIv
.

@soltysh
Copy link
Contributor Author

soltysh commented Jun 23, 2016

I like @smarterclayton idea. I'll go with that, esp. it's reasonable to reason about, with images being non-namespaced resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants