Skip to content

Commit aa29452

Browse files
committed
Merge branch 'main' into fix-upload-fragment
2 parents 4b8d955 + c34d777 commit aa29452

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3929
-2384
lines changed

src/connectedk8s/HISTORY.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
33
Release History
44
===============
5+
1.11.0
6+
+++++
7+
* [Breaking Change] Removed deprecated '--app-id' and '--app-secret' RBAC parameters from the extension.
8+
* Update cluster diagnostics image to comply with Pod Security Standards-Restricted level( Updated image version:1.31.2).
9+
* Add endpoint overrides for Azure Government cloud environments
10+
* Update Proxy Image to 1.3.032281
11+
512
1.10.11
613
+++++++
714
* Removed hardcoded public ARM endpoint URL for Government clouds.

src/connectedk8s/azext_connectedk8s/_breaking_change.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/connectedk8s/azext_connectedk8s/_constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@
418418

419419
# Connect Precheck Diagnoser constants
420420
Cluster_Diagnostic_Checks_Job_Registry_Path = (
421-
"azurearck8s/helmchart/stable/clusterdiagnosticchecks:1.29.3"
421+
"azurearck8s/helmchart/stable/clusterdiagnosticchecks:1.31.2"
422422
)
423423
Cluster_Diagnostic_Checks_Helm_Install_Failed_Fault_Type = (
424424
"Error while installing cluster diagnostic checks helm release"
@@ -476,7 +476,7 @@
476476
)
477477
DNS_Check_Result_String = "DNS Result:"
478478
AZ_CLI_ADAL_TO_MSAL_MIGRATE_VERSION = "2.30.0"
479-
CLIENT_PROXY_VERSION = "1.3.029301"
479+
CLIENT_PROXY_VERSION = "1.3.032281"
480480
CLIENT_PROXY_FOLDER = ".clientproxy"
481481
API_SERVER_PORT = 47011
482482
CLIENT_PROXY_PORT = 47010

src/connectedk8s/azext_connectedk8s/_params.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -440,20 +440,6 @@ def load_arguments(self: Connectedk8sCommandsLoader, _: CLICommand) -> None:
440440
options_list=["--features"],
441441
help="Space-separated list of features you want to enable.",
442442
)
443-
c.argument(
444-
"azrbac_client_id",
445-
options_list=["--app-id"],
446-
arg_group="Azure RBAC",
447-
help="Application ID for enabling Azure RBAC.",
448-
deprecate_info=c.deprecate(hide=True),
449-
)
450-
c.argument(
451-
"azrbac_client_secret",
452-
options_list=["--app-secret"],
453-
arg_group="Azure RBAC",
454-
help="Application secret for enabling Azure RBAC.",
455-
deprecate_info=c.deprecate(hide=True),
456-
)
457443
c.argument(
458444
"azrbac_skip_authz_check",
459445
options_list=["--skip-azure-rbac-list"],

src/connectedk8s/azext_connectedk8s/_utils.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,7 @@ def helm_install_release(
13151315
]
13161316

13171317
# Special configurations from 2022-09-01 ARM metadata.
1318+
# "dataplaneEndpoints" property does not appear in arm_metadata structure for public and AGC clouds.
13181319
if "dataplaneEndpoints" in arm_metadata:
13191320
if "arcConfigEndpoint" in arm_metadata["dataplaneEndpoints"]:
13201321
notification_endpoint = arm_metadata["dataplaneEndpoints"][
@@ -1364,6 +1365,10 @@ def helm_install_release(
13641365
"'arcConfigEndpoint' doesn't exist under 'dataplaneEndpoints' in the ARM metadata."
13651366
)
13661367

1368+
# Add overrides for AGC Scenario
1369+
if cloud_name.lower() == "ussec" or cloud_name.lower() == "usnat":
1370+
add_agc_endpoint_overrides(location, cloud_name, arm_metadata, cmd_helm_install)
1371+
13671372
# Add helmValues content response from DP
13681373
cmd_helm_install = parse_helm_values(helm_content_values, cmd_helm=cmd_helm_install)
13691374

@@ -1839,3 +1844,51 @@ def helm_update_agent(
18391844
logger.info(str.format(consts.Update_Agent_Success, cluster_name))
18401845
with contextlib.suppress(OSError):
18411846
os.remove(user_values_location)
1847+
1848+
1849+
def add_agc_endpoint_overrides(
1850+
location: str,
1851+
cloud_name: str,
1852+
arm_metadata: dict[str, Any],
1853+
cmd_helm_install: list[str],
1854+
) -> None:
1855+
logger.debug("Adding AGC scenario overrides.")
1856+
1857+
arm_metadata_endpoint_array = (
1858+
arm_metadata["authentication"]["loginEndpoint"].strip("/").split(".")
1859+
)
1860+
if len(arm_metadata_endpoint_array) < 4:
1861+
raise CLIInternalError("Unexpected loginEndpoint format for AGC")
1862+
1863+
cloud_suffix = arm_metadata_endpoint_array[3]
1864+
endpoint_suffix = (
1865+
arm_metadata_endpoint_array[2] + "." + arm_metadata_endpoint_array[3]
1866+
)
1867+
if cloud_name.lower() == "usnat":
1868+
cloud_suffix = (
1869+
arm_metadata_endpoint_array[2]
1870+
+ "."
1871+
+ arm_metadata_endpoint_array[3]
1872+
+ "."
1873+
+ arm_metadata_endpoint_array[4]
1874+
)
1875+
endpoint_suffix = cloud_suffix
1876+
1877+
cmd_helm_install.extend(
1878+
[
1879+
"--set",
1880+
f"global.microsoftArtifactRepository=mcr.microsoft.{cloud_suffix}",
1881+
"--set",
1882+
f"systemDefaultValues.activeDirectoryEndpoint=https://login.microsoftonline.{endpoint_suffix}",
1883+
"--set",
1884+
f"systemDefaultValues.azureArcAgents.config_dp_endpoint_override=https://{location}.dp.kubernetesconfiguration.azure.{endpoint_suffix}",
1885+
"--set",
1886+
f"systemDefaultValues.clusterconnect-agent.notification_dp_endpoint_override=https://guestnotificationservice.azure.{endpoint_suffix}",
1887+
"--set",
1888+
f"systemDefaultValues.clusterconnect-agent.relay_endpoint_suffix_override=.servicebus.cloudapi.{endpoint_suffix}",
1889+
"--set",
1890+
f"systemDefaultValues.clusteridentityoperator.his_endpoint_override=https://gbl.his.arc.azure.{endpoint_suffix}/discovery?location={location}&api-version=1.1-preview",
1891+
"--set",
1892+
f"systemDefaultValues.image.repository=mcr.microsoft.{cloud_suffix}",
1893+
]
1894+
)

src/connectedk8s/azext_connectedk8s/custom.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2975,8 +2975,6 @@ def enable_features(
29752975
features: list[str],
29762976
kube_config: str | None = None,
29772977
kube_context: str | None = None,
2978-
azrbac_client_id: str | None = None,
2979-
azrbac_client_secret: str | None = None,
29802978
azrbac_skip_authz_check: str | None = None,
29812979
skip_ssl_verification: bool = False,
29822980
cl_oid: str | None = None,

src/connectedk8s/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# TODO: Confirm this is the right version number you want and it matches your
1414
# HISTORY.rst entry.
1515

16-
VERSION = "1.10.11"
16+
VERSION = "1.11.0"
1717

1818
# The full list of classifiers is available at
1919
# https://pypi.python.org/pypi?%3Aaction=list_classifiers

src/containerapp/HISTORY.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Release History
44
===============
55
upcoming
66
++++++
7+
* 'az containerapp function invocations': Update application insights query
8+
* 'az containerapp function keys': Update minimum replica check
79

810
1.3.0b1
911
++++++

src/containerapp/azext_containerapp/_utils.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,17 @@ def create_acrpull_role_assignment_if_needed(cmd, registry_server, registry_iden
835835
time.sleep(5)
836836

837837

838+
def get_min_replicas_from_revision(cmd, resource_group_name, container_app_name, revision_name):
839+
revision_def = ContainerAppClient.show_revision(
840+
cmd=cmd,
841+
resource_group_name=resource_group_name,
842+
container_app_name=container_app_name,
843+
name=revision_name
844+
)
845+
min_replicas = safe_get(revision_def, "properties", "template", "scale", "minReplicas", default=None)
846+
return min_replicas
847+
848+
838849
def get_random_replica(cmd, resource_group_name, container_app_name, revision_name):
839850
logger.debug(f"Getting random replica for container app: name='{container_app_name}', resource_group='{resource_group_name}', revision='{revision_name}'")
840851

@@ -851,6 +862,18 @@ def get_random_replica(cmd, resource_group_name, container_app_name, revision_na
851862

852863
if not replicas:
853864
logger.debug(f"No replicas found for revision '{revision_name}' - unable to proceed")
865+
logger.debug(f"checking min replica count for revision='{revision_name}'")
866+
867+
min_replicas = get_min_replicas_from_revision(
868+
cmd,
869+
resource_group_name,
870+
container_app_name,
871+
revision_name
872+
)
873+
if min_replicas is None or min_replicas == 0:
874+
logger.debug(f"The revision '{revision_name}' has minReplicas set to 0.")
875+
raise CLIError(f"The revision '{revision_name}' has minReplicas set to 0. Ensure that there is at least one replica. To update minimum replica: Run 'az containerapp update --name {container_app_name} --resource-group {resource_group_name} --min-replica 1'")
876+
854877
raise CLIError(f"No replicas found for revision '{revision_name}' of container app '{container_app_name}'.")
855878

856879
# Filter replicas by running state

src/containerapp/azext_containerapp/_validators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def validate_revision_and_get_name(cmd, resource_group_name, container_app_name,
318318
if not provided_revision_name:
319319
logger.debug("No revision name provided for multiple revision mode container app")
320320
raise ValidationError("Revision name is required when active revision mode is not 'single'.")
321-
return provided_revision_name
321+
return provided_revision_name, active_revision_mode
322322
if not provided_revision_name:
323323
logger.debug("No revision name provided - attempting to determine latest revision")
324324
revision_name = safe_get(containerapp_def, "properties", "latestRevisionName")
@@ -331,9 +331,9 @@ def validate_revision_and_get_name(cmd, resource_group_name, container_app_name,
331331
if not revision_name or revision_name is None:
332332
logger.debug("Could not determine any revision name from container app properties")
333333
raise ValidationError("Could not determine the latest revision name. Please provide --revision.")
334-
return revision_name
334+
return revision_name, active_revision_mode
335335
logger.debug("Using provided revision name: '%s'", provided_revision_name)
336-
return provided_revision_name
336+
return provided_revision_name, active_revision_mode
337337

338338

339339
def validate_functionapp_kind(cmd, resource_group_name, container_app_name):

0 commit comments

Comments
 (0)