Skip to content

Add cli option to disable the default global zones #10028

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions lib/cli/nodesetupcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ void NodeSetupCommand::InitParameters(boost::program_options::options_descriptio
("accept-config", "Accept config from parent node")
("accept-commands", "Accept commands from parent node")
("master", "Use setup for a master instance")
("global_zones", po::value<std::vector<std::string> >(), "The names of the additional global zones to 'global-templates' and 'director-global'.")
("global_zones", po::value<std::vector<std::string> >(), "The names of the additional global zones to add to the default ones (if not deactivated).")
("no-default-global-zones", "Do not add the default global-zones 'global-templates' and 'director-global'")
("disable-confd", "Disables the conf.d directory during the setup");

hiddenDesc.add_options()
Expand Down Expand Up @@ -148,7 +149,10 @@ int NodeSetupCommand::SetupMaster(const boost::program_options::variables_map& v
/* write zones.conf and update with zone + endpoint information */
Log(LogInformation, "cli", "Generating zone and object configuration.");

std::vector<String> globalZones { "global-templates", "director-global" };
std::vector<String> globalZones {};
if (!vm.count("no-default-global-zones")) {
globalZones = {"global-templates", "director-global"};
}
std::vector<std::string> setupGlobalZones;

if (vm.count("global_zones"))
Expand Down Expand Up @@ -493,7 +497,11 @@ int NodeSetupCommand::SetupNode(const boost::program_options::variables_map& vm,
if (vm.count("parent_zone"))
parentZoneName = vm["parent_zone"].as<std::string>();

std::vector<String> globalZones { "global-templates", "director-global" };
std::vector<String> globalZones {};
if (!vm.count("no-default-global-zones")) {
globalZones = {"global-templates", "director-global"};
}

std::vector<std::string> setupGlobalZones;

if (vm.count("global_zones"))
Expand Down