mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-14 11:08:06 +00:00
adding option to only deploy the rbac resources (#818)
adds option to only deploy the rbac resources closes #814
This commit is contained in:
@ -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. "
|
||||
|
Reference in New Issue
Block a user