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
[salt-cloud] Protect against passing command line arguments as names for the --destroy command in map files #24036
Comments
I was unaware that you could select a subset of a map, and it's definitely not intentional. But I don't understand why you need to specify a map file, then only the machines inside the map which you want to destroy. The map doesn't provide any information that would be useful for destroying. Why not just specify the names and call it good? |
@techhat I hadn't thought of it that way, I don't often use the command without a map. Only thing I'm curious about is the follow use case :
Am I sure that it's not going to delete web.example.org from Amazon if I just use |
@arthurlogilab, no, there's no guarantee that if both are available, that the wrong one won't be destroyed. But Salt Cloud also wasn't designed to be able to handle duplicate IDs, because it assumes that all IDs belong to the same master. Recent issues that have been submitted have made it clear that people are regularly using one Salt Cloud instance to manage clouds with multiple salt-masters, or at least with multiple infrastructures. It looks like it's time to do some rethinking on this. |
After discussing this with @techhat, we've decided that we're not going to support this behavior. A warning has been added to the docs declaring this. However, we should help protect against accidentally deleting an entire map file if someone does attempt to pass in a specific argument to the map file. The best thing to do here is to make sure that no arguments being passed in, ever, are ignored. Or, at the very least, raise an invocation error. See the discussion in #9772 for another example. I'm editing the title of this issue to reflect this change. |
@arthurlogilab I am not sure how are you getting to that point where
Versions Report:
The stacktrace should be cleaned up, but I am not sure how you're getting past that stacktrace. I tried this on 2015.5.0, as well as 2015.5.2. |
@rallytime switch the -d and the -m in your command line. I thought we had that cleaned up, but that's what's causing your traceback. |
One can create a subset of a map by using the following command :
It seems that adding a --destroy offers to destroy all machines
The text was updated successfully, but these errors were encountered: