adding option to only deploy the rbac resources (#818)

adds option to only deploy the rbac resources
closes #814
This commit is contained in:
Cheick Keita
2021-05-06 10:44:51 -07:00
committed by GitHub
parent 883f46c72b
commit c01c30fa7a

View File

@ -888,11 +888,14 @@ def arg_file(arg: str) -> str:
def main() -> None:
states = [
rbac_only_states = [
("check_region", Client.check_region),
("rbac", Client.setup_rbac),
("arm", Client.deploy_template),
("assign_scaleset_identity_role", Client.assign_scaleset_identity_role),
]
full_deployment_states = rbac_only_states + [
("apply_migrations", Client.apply_migrations),
("queues", Client.create_queues),
("eventgrid", Client.create_eventgrid),
@ -948,8 +951,8 @@ def main() -> None:
parser.add_argument("--client_secret")
parser.add_argument(
"--start_at",
default=states[0][0],
choices=[x[0] for x in states],
default=full_deployment_states[0][0],
choices=[x[0] for x in full_deployment_states],
help=(
"Debug deployments by starting at a specific state. "
"NOT FOR PRODUCTION USE. (default: %(default)s)"
@ -994,6 +997,12 @@ def main() -> None:
"--subscription_id",
type=str,
)
parser.add_argument(
"--rbac_only",
action="store_true",
help="execute only the steps required to create the rbac resources",
)
args = parser.parse_args()
if shutil.which("func") is None:
@ -1030,6 +1039,15 @@ def main() -> None:
logging.getLogger("deploy").setLevel(logging.INFO)
if args.rbac_only:
logger.warning(
"'rbac_only' specified. The deployment will execute "
"only the steps required to create the rbac resources"
)
states = rbac_only_states
else:
states = full_deployment_states
if args.start_at != states[0][0]:
logger.warning(
"*** Starting at a non-standard deployment state. "