Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
4 changes: 4 additions & 0 deletions src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ To release a new version, please select a new version number (usually plus 1 to
Pending
+++++++

18.0.0b7
+++++++
* Populate location of managed namespaces using managed cluster's location

18.0.0b6
+++++++
* Quality improvements for `az aks extension` and `az aks extension type` command groups
Expand Down
12 changes: 12 additions & 0 deletions src/aks-preview/azext_aks_preview/managednamespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from azure.cli.core.util import (
sdk_no_wait,
)
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.containerservice import ContainerServiceClient

from azext_aks_preview._consts import (
CONST_NAMESPACE_NETWORK_POLICY_RULE_DENYALL,
Expand All @@ -27,11 +29,19 @@
from azext_aks_preview._client_factory import CUSTOM_MGMT_AKS_PREVIEW


def get_cluster_location(cmd, resource_group_name, cluster_name):
containerservice_client = get_mgmt_service_client(cmd.cli_ctx, ContainerServiceClient)
cluster = containerservice_client.managed_clusters.get(resource_group_name, cluster_name)
return cluster.location


def aks_managed_namespace_add(cmd, client, raw_parameters, headers, no_wait):
resource_group_name = raw_parameters.get("resource_group_name")
cluster_name = raw_parameters.get("cluster_name")
namespace_name = raw_parameters.get("name")

namespace_config = constructNamespace(cmd, raw_parameters, namespace_name)
namespace_config.location = get_cluster_location(cmd, resource_group_name, cluster_name)

return sdk_no_wait(
no_wait,
Expand Down Expand Up @@ -193,7 +203,9 @@ def aks_managed_namespace_update(cmd, client, raw_parameters, headers, existedNa
resource_group_name = raw_parameters.get("resource_group_name")
cluster_name = raw_parameters.get("cluster_name")
namespace_name = raw_parameters.get("name")

namespace_config = updateNamespace(cmd, raw_parameters, existedNamespace)
namespace_config.location = get_cluster_location(cmd, resource_group_name, cluster_name)

return sdk_no_wait(
no_wait,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ interactions:
User-Agent:
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.13 (Linux-6.2.0-1019-azure-x86_64-with-glibc2.31)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000003?api-version=2024-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000003?api-version=2022-09-01
response:
body:
string: '{"name":"cliakstest000003","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000003","etag":"W/\"7127d835-9718-4371-90ff-92fc1b94ff90\"","location":"westus2","properties":{"provisioningState":"Updating","resourceGuid":"e4b75712-afae-49a4-a9a5-383357645a73","publicIPAddressVersion":"IPv4","publicIPAllocationMethod":"Static","idleTimeoutInMinutes":4,"ipTags":[],"ddosSettings":{"protectionMode":"VirtualNetworkInherited"}},"type":"Microsoft.Network/publicIPAddresses","sku":{"name":"Standard","tier":"Regional"}}'
Expand Down Expand Up @@ -162,7 +162,7 @@ interactions:
User-Agent:
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.13 (Linux-6.2.0-1019-azure-x86_64-with-glibc2.31)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000003?api-version=2024-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000003?api-version=2022-09-01
response:
body:
string: '{"name":"cliakstest000003","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000003","etag":"W/\"47ad53ef-d340-4086-aff6-c14189acdd40\"","location":"westus2","properties":{"provisioningState":"Succeeded","resourceGuid":"e4b75712-afae-49a4-a9a5-383357645a73","ipAddress":"20.36.22.30","publicIPAddressVersion":"IPv4","publicIPAllocationMethod":"Static","idleTimeoutInMinutes":4,"ipTags":[],"ddosSettings":{"protectionMode":"VirtualNetworkInherited"}},"type":"Microsoft.Network/publicIPAddresses","sku":{"name":"Standard","tier":"Regional"}}'
Expand Down Expand Up @@ -210,7 +210,7 @@ interactions:
User-Agent:
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.13 (Linux-6.2.0-1019-azure-x86_64-with-glibc2.31)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000003?api-version=2024-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000003?api-version=2022-09-01
response:
body:
string: '{"name":"cliakstest000003","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000003","etag":"W/\"47ad53ef-d340-4086-aff6-c14189acdd40\"","location":"westus2","properties":{"provisioningState":"Succeeded","resourceGuid":"e4b75712-afae-49a4-a9a5-383357645a73","ipAddress":"20.36.22.30","publicIPAddressVersion":"IPv4","publicIPAllocationMethod":"Static","idleTimeoutInMinutes":4,"ipTags":[],"ddosSettings":{"protectionMode":"VirtualNetworkInherited"}},"type":"Microsoft.Network/publicIPAddresses","sku":{"name":"Standard","tier":"Regional"}}'
Expand Down Expand Up @@ -307,7 +307,7 @@ interactions:
User-Agent:
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.13 (Linux-6.2.0-1019-azure-x86_64-with-glibc2.31)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000004?api-version=2024-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000004?api-version=2022-09-01
response:
body:
string: '{"name":"cliakstest000004","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000004","etag":"W/\"9638a254-b6f4-41a3-943e-4f705b6689e7\"","location":"westus2","properties":{"provisioningState":"Updating","resourceGuid":"1cf6849c-74ad-4031-9177-32451323a7f3","publicIPAddressVersion":"IPv4","publicIPAllocationMethod":"Static","idleTimeoutInMinutes":4,"ipTags":[],"ddosSettings":{"protectionMode":"VirtualNetworkInherited"}},"type":"Microsoft.Network/publicIPAddresses","sku":{"name":"Standard","tier":"Regional"}}'
Expand Down Expand Up @@ -405,7 +405,7 @@ interactions:
User-Agent:
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.13 (Linux-6.2.0-1019-azure-x86_64-with-glibc2.31)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000004?api-version=2024-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000004?api-version=2022-09-01
response:
body:
string: '{"name":"cliakstest000004","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000004","etag":"W/\"868d30d1-c1f4-49ba-86ef-04263cda6575\"","location":"westus2","properties":{"provisioningState":"Succeeded","resourceGuid":"1cf6849c-74ad-4031-9177-32451323a7f3","ipAddress":"20.36.15.82","publicIPAddressVersion":"IPv4","publicIPAllocationMethod":"Static","idleTimeoutInMinutes":4,"ipTags":[],"ddosSettings":{"protectionMode":"VirtualNetworkInherited"}},"type":"Microsoft.Network/publicIPAddresses","sku":{"name":"Standard","tier":"Regional"}}'
Expand Down Expand Up @@ -453,7 +453,7 @@ interactions:
User-Agent:
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.13 (Linux-6.2.0-1019-azure-x86_64-with-glibc2.31)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000004?api-version=2024-07-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000004?api-version=2022-09-01
response:
body:
string: '{"name":"cliakstest000004","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/cliakstest000004","etag":"W/\"868d30d1-c1f4-49ba-86ef-04263cda6575\"","location":"westus2","properties":{"provisioningState":"Succeeded","resourceGuid":"1cf6849c-74ad-4031-9177-32451323a7f3","ipAddress":"20.36.15.82","publicIPAddressVersion":"IPv4","publicIPAllocationMethod":"Static","idleTimeoutInMinutes":4,"ipTags":[],"ddosSettings":{"protectionMode":"VirtualNetworkInherited"}},"type":"Microsoft.Network/publicIPAddresses","sku":{"name":"Standard","tier":"Regional"}}'
Expand Down
Loading
Loading