Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from azure.mgmt.containerinstance.models import (
Container,
ContainerGroup,
ContainerGroupNetworkProfile,
ContainerPort,
EnvironmentVariable,
IpAddress,
Expand Down Expand Up @@ -88,6 +89,7 @@ class AzureContainerInstancesOperator(BaseOperator):
:param restart_policy: Restart policy for all containers within the container group.
Possible values include: 'Always', 'OnFailure', 'Never'
:param ip_address: The IP address type of the container group.
:param network_profile: The network profile information for a container group.

**Example**::

Expand Down Expand Up @@ -142,6 +144,7 @@ def __init__(
restart_policy: str = 'Never',
ip_address: Optional[IpAddress] = None,
ports: Optional[List[ContainerPort]] = None,
network_profile: Optional[ContainerGroupNetworkProfile] = None,
**kwargs,
) -> None:
super().__init__(**kwargs)
Expand Down Expand Up @@ -179,6 +182,7 @@ def __init__(
)
self.ip_address = ip_address
self.ports = ports
self.network_profile = network_profile

def execute(self, context: "Context") -> int:
# Check name again in case it was templated.
Expand Down Expand Up @@ -251,6 +255,7 @@ def execute(self, context: "Context") -> int:
os_type=self.os_type,
tags=self.tags,
ip_address=self.ip_address,
network_profile=self.network_profile,
)

self._ci_hook.create_or_update(self.resource_group, self.name, container_group)
Expand Down