Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion src/containerapp/azext_containerapp/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
MANAGED_CERTIFICATE_RT = "managedCertificates"
PRIVATE_CERTIFICATE_RT = "certificates"

DEV_SERVICE_LIST = ["kafka", "postgres", "redis"]
DEV_SERVICE_LIST = ["kafka", "postgres", "redis", "mariadb"]

DEV_KAFKA_IMAGE = 'kafka'
DEV_KAFKA_SERVICE_TYPE = 'kafka'
Expand All @@ -32,6 +32,10 @@
DEV_REDIS_SERVICE_TYPE = 'redis'
DEV_REDIS_CONTAINER_NAME = 'redis'

DEV_MARIADB_IMAGE = 'mariadb'
DEV_MARIADB_SERVICE_TYPE = 'mariadb'
DEV_MARIADB_CONTAINER_NAME = 'mariadb'

PENDING_STATUS = "Pending"
SUCCEEDED_STATUS = "Succeeded"
UPDATING_STATUS = "Updating"
Expand Down
15 changes: 15 additions & 0 deletions src/containerapp/azext_containerapp/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,11 @@
short-summary: Commands to manage the kafka service for the Container Apps environment.
"""

helps['containerapp service mariadb'] = """
type: group
short-summary: Commands to manage the mariadb service for the Container Apps environment.
"""

helps['containerapp service redis create'] = """
type: command
short-summary: Command to create the redis service.
Expand All @@ -417,6 +422,11 @@
short-summary: Command to create the kafka service.
"""

helps['containerapp service mariadb create'] = """
type: command
short-summary: Command to create the mariadb service.
"""

helps['containerapp service redis delete'] = """
type: command
short-summary: Command to delete the redis service.
Expand All @@ -432,6 +442,11 @@
short-summary: Command to delete the kafka service.
"""

helps['containerapp service mariadb delete'] = """
type: command
short-summary: Command to delete the mariadb service.
"""

helps['containerapp env update'] = """
type: command
short-summary: Update a Container Apps environment.
Expand Down
4 changes: 4 additions & 0 deletions src/containerapp/azext_containerapp/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ def load_command_table(self, _):
g.custom_command('create', 'create_kafka_service', supports_no_wait=True)
g.custom_command('delete', 'delete_kafka_service', confirmation=True, supports_no_wait=True)

with self.command_group('containerapp service mariadb') as g:
g.custom_command('create', 'create_mariadb_service', supports_no_wait=True)
g.custom_command('delete', 'delete_mariadb_service', confirmation=True, supports_no_wait=True)

with self.command_group('containerapp identity') as g:
g.custom_command('assign', 'assign_managed_identity', supports_no_wait=True, exception_handler=ex_handler_factory())
g.custom_command('remove', 'remove_managed_identity', supports_no_wait=True, exception_handler=ex_handler_factory())
Expand Down
13 changes: 12 additions & 1 deletion src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
NAME_INVALID, NAME_ALREADY_EXISTS, ACR_IMAGE_SUFFIX, HELLO_WORLD_IMAGE, LOG_TYPE_SYSTEM, LOG_TYPE_CONSOLE,
MANAGED_CERTIFICATE_RT, PRIVATE_CERTIFICATE_RT, PENDING_STATUS, SUCCEEDED_STATUS, DEV_POSTGRES_IMAGE, DEV_POSTGRES_SERVICE_TYPE,
DEV_POSTGRES_CONTAINER_NAME, DEV_REDIS_IMAGE, DEV_REDIS_SERVICE_TYPE, DEV_REDIS_CONTAINER_NAME, DEV_KAFKA_CONTAINER_NAME,
DEV_KAFKA_IMAGE, DEV_KAFKA_SERVICE_TYPE, DEV_SERVICE_LIST)
DEV_KAFKA_IMAGE, DEV_KAFKA_SERVICE_TYPE, DEV_MARIADB_CONTAINER_NAME, DEV_MARIADB_IMAGE, DEV_MARIADB_SERVICE_TYPE, DEV_SERVICE_LIST)

logger = get_logger(__name__)

Expand Down Expand Up @@ -219,6 +219,17 @@ def delete_kafka_service(cmd, service_name, resource_group_name, no_wait=False):
return DevServiceUtils.delete_service(cmd, service_name, resource_group_name, no_wait, DEV_KAFKA_SERVICE_TYPE)


def create_mariadb_service(cmd, service_name, environment_name, resource_group_name, no_wait=False,
disable_warnings=True):
return DevServiceUtils.create_service(cmd, service_name, environment_name, resource_group_name, no_wait,
disable_warnings, DEV_MARIADB_IMAGE, DEV_MARIADB_SERVICE_TYPE,
DEV_MARIADB_CONTAINER_NAME)


def delete_mariadb_service(cmd, service_name, resource_group_name, no_wait=False):
return DevServiceUtils.delete_service(cmd, service_name, resource_group_name, no_wait, DEV_MARIADB_SERVICE_TYPE)


def update_containerapp_yaml(cmd, name, resource_group_name, file_name, from_revision=None, no_wait=False):
yaml_containerapp = process_loaded_yaml(load_yaml_file(file_name))
if type(yaml_containerapp) != dict: # pylint: disable=unidiomatic-typecheck
Expand Down
Loading