Skip to content
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

[containerapp] az containerapp job create: Fix AttributeError when --trigger-type is None #6840

Merged
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Release History
===============
upcoming
++++++
* 'az containerapp job create': Fix AttributeError when --trigger-type is None
* 'az containerapp update': fix bug for mounting secret volumes using --secret-volume-mount

0.3.41
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ def set_up_vnet_configuration(self):
if self.get_argument_infrastructure_subnet_resource_id() or self.get_argument_docker_bridge_cidr() or self.get_argument_platform_reserved_cidr() or self.get_argument_platform_reserved_dns_ip():
vnet_config_def = VnetConfigurationModel

if self.get_argument_infrastructure_subnet_resource_id is not None:
if self.get_argument_infrastructure_subnet_resource_id() is not None:
vnet_config_def["infrastructureSubnetId"] = self.get_argument_infrastructure_subnet_resource_id()

if self.get_argument_docker_bridge_cidr is not None:
if self.get_argument_docker_bridge_cidr() is not None:
vnet_config_def["dockerBridgeCidr"] = self.get_argument_docker_bridge_cidr()

if self.get_argument_platform_reserved_cidr() is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def post_process(self, r):
r = self.create()

if "properties" in r and "provisioningState" in r["properties"] and r["properties"]["provisioningState"].lower() == "waiting" and not self.get_argument_no_wait():
not self.get_argument_disable_warnings() and logger.warning('Containerapp job creation in progress. Please monitor the creation using `az containerapp job show -n {} -g {}`'.format(self.get_argument_name, self.get_argument_resource_group_name()))
not self.get_argument_disable_warnings() and logger.warning('Containerapp job creation in progress. Please monitor the creation using `az containerapp job show -n {} -g {}`'.format(self.get_argument_name(), self.get_argument_resource_group_name()))

return r

Expand Down Expand Up @@ -268,15 +268,15 @@ def construct_payload(self):
manualTriggerConfig_def["parallelism"] = 0 if self.get_argument_parallelism() is None else self.get_argument_parallelism()

scheduleTriggerConfig_def = None
if self.get_argument_trigger_type is not None and self.get_argument_trigger_type().lower() == "schedule":
if self.get_argument_trigger_type() is not None and self.get_argument_trigger_type().lower() == "schedule":
scheduleTriggerConfig_def = ScheduleTriggerModel
scheduleTriggerConfig_def[
"replicaCompletionCount"] = 0 if self.get_argument_replica_completion_count() is None else self.get_argument_replica_completion_count()
scheduleTriggerConfig_def["parallelism"] = 0 if self.get_argument_parallelism() is None else self.get_argument_parallelism()
scheduleTriggerConfig_def["cronExpression"] = self.get_argument_cron_expression()

eventTriggerConfig_def = None
if self.get_argument_trigger_type is not None and self.get_argument_trigger_type().lower() == "event":
if self.get_argument_trigger_type() is not None and self.get_argument_trigger_type().lower() == "event":
scale_def = None
if self.get_argument_min_executions() is not None or self.get_argument_max_executions() is not None or self.get_argument_polling_interval() is not None:
scale_def = JobScaleModel
Expand Down