Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit 5adb00d

Browse files
mdhedleyrileyjbauer
authored andcommitted
Added --no-firewall-rule (#2135)
* Added --no-firewall-rule flag. This prevents the creation of a firewall rule on datalab creation. * Removes accidental extra newline
1 parent 92f68ce commit 5adb00d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tools/cli/commands/create.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,14 @@ def flags(parser):
538538
'\n\n'
539539
'Note that this is a beta feature and unsupported.'))
540540

541+
parser.add_argument(
542+
'--no-firewall-rule',
543+
dest='no_firewall_rule',
544+
action='store_true',
545+
default=False,
546+
help='Disable the automatic creation of a firewall rule'
547+
)
548+
541549
parser.add_argument(
542550
'--no-create-repository',
543551
dest='no_create_repository',
@@ -919,8 +927,9 @@ def prepare(args, gcloud_compute, gcloud_repos):
919927
"""
920928
network_name = args.network_name
921929
ensure_network_exists(args, gcloud_compute, network_name)
922-
prompt_on_unexpected_firewall_rules(args, gcloud_compute, network_name)
923-
ensure_firewall_rule_exists(args, gcloud_compute, network_name)
930+
if not args.no_firewall_rule:
931+
prompt_on_unexpected_firewall_rules(args, gcloud_compute, network_name)
932+
ensure_firewall_rule_exists(args, gcloud_compute, network_name)
924933

925934
disk_name = args.disk_name or '{0}-pd'.format(args.instance)
926935
ensure_disk_exists(args, gcloud_compute, disk_name)

0 commit comments

Comments
 (0)