Skip to content

Commit 5f981f4

Browse files
committed
resolve conflict on history version
2 parents 234c26c + f3be071 commit 5f981f4

File tree

108 files changed

+49497
-32800
lines changed

Some content is hidden

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

108 files changed

+49497
-32800
lines changed

src/aks-preview/HISTORY.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ To release a new version, please select a new version number (usually plus 1 to
1212
Pending
1313
+++++++
1414

15-
18.0.0b7
15+
18.0.0b8
1616
+++++++
1717
* Populate location of managed namespaces using managed cluster's location
1818

19+
18.0.0b7
20+
+++++++
21+
* Add option `--disable-http-proxy` to `az aks update`.
22+
1923
18.0.0b6
2024
+++++++
2125
* Quality improvements for `az aks extension` and `az aks extension type` command groups

src/aks-preview/azext_aks_preview/_help.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,9 @@
12621262
- name: --migrate-vmas-to-vms
12631263
type: bool
12641264
short-summary: Migrate cluster with VMAS node pool to VMS node pool.
1265+
- name: --disable-http-proxy
1266+
type: bool
1267+
short-summary: Disable HTTP Proxy Configuration on the cluster.
12651268
examples:
12661269
- name: Reconcile the cluster back to its current state.
12671270
text: az aks update -g MyResourceGroup -n MyManagedCluster

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,7 @@ def load_arguments(self, _):
14431443
)
14441444

14451445
c.argument('migrate_vmas_to_vms', is_preview=True, action='store_true')
1446+
c.argument("disable_http_proxy", action="store_true", is_preview=True)
14461447

14471448
with self.argument_context("aks upgrade") as c:
14481449
c.argument("kubernetes_version", completer=get_k8s_upgrades_completion_list)

src/aks-preview/azext_aks_preview/custom.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,7 @@ def aks_update(
822822
azure_keyvault_kms_key_vault_network_access=None,
823823
azure_keyvault_kms_key_vault_resource_id=None,
824824
http_proxy_config=None,
825+
disable_http_proxy=False,
825826
bootstrap_artifact_source=None,
826827
bootstrap_container_registry_resource_id=None,
827828
# addons

src/aks-preview/azext_aks_preview/managed_cluster_decorator.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2839,6 +2839,16 @@ def get_migrate_vmas_to_vms(self) -> bool:
28392839
"""
28402840
return self.raw_param.get("migrate_vmas_to_vms")
28412841

2842+
def get_disable_http_proxy(self) -> bool:
2843+
"""Obtain the value of disable_http_proxy.
2844+
2845+
:return: bool
2846+
"""
2847+
# read the original value passed by the command
2848+
disable_http_proxy = self.raw_param.get("disable_http_proxy")
2849+
2850+
return disable_http_proxy
2851+
28422852

28432853
# pylint: disable=too-many-public-methods
28442854
class AKSPreviewManagedClusterCreateDecorator(AKSManagedClusterCreateDecorator):
@@ -5322,6 +5332,22 @@ def update_vmas_to_vms(self, mc: ManagedCluster) -> ManagedCluster:
53225332

53235333
return mc
53245334

5335+
def update_http_proxy_enabled(self, mc: ManagedCluster) -> ManagedCluster:
5336+
"""Update http proxy config for the ManagedCluster object.
5337+
5338+
:return: the ManagedCluster object
5339+
"""
5340+
self._ensure_mc(mc)
5341+
5342+
if self.context.get_disable_http_proxy():
5343+
if mc.http_proxy_config is None:
5344+
mc.http_proxy_config = (
5345+
self.models.ManagedClusterHTTPProxyConfig() # pylint: disable=no-member
5346+
)
5347+
mc.http_proxy_config.enabled = False
5348+
5349+
return mc
5350+
53255351
def update_mc_profile_preview(self) -> ManagedCluster:
53265352
"""The overall controller used to update the preview ManagedCluster profile.
53275353
@@ -5397,6 +5423,8 @@ def update_mc_profile_preview(self) -> ManagedCluster:
53975423
mc = self.update_imds_restriction(mc)
53985424
# update VMAS to VMS
53995425
mc = self.update_vmas_to_vms(mc)
5426+
# update http proxy config
5427+
mc = self.update_http_proxy_enabled(mc)
54005428

54015429
return mc
54025430

src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_create_and_update_with_http_proxy_config.yaml

Lines changed: 5570 additions & 0 deletions
Large diffs are not rendered by default.

src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6022,7 +6022,7 @@ def test_aks_create_with_node_config(self, resource_group, resource_group_locati
60226022
# In any case, AKS clirunner will execute this case in live mode every day to ensure that there are no problems,
60236023
# so mark this case as live_only.
60246024
@live_only()
6025-
@AllowLargeResponse()
6025+
@AllowLargeResponse(99999)
60266026
@AKSCustomResourceGroupPreparer(
60276027
random_name_length=17, name_prefix="clitest", location="westus2"
60286028
)
@@ -6129,6 +6129,28 @@ def test_aks_create_and_update_with_http_proxy_config(
61296129
],
61306130
)
61316131

6132+
self.kwargs.update(
6133+
{
6134+
"resource_group": resource_group,
6135+
"name": aks_name,
6136+
}
6137+
)
6138+
6139+
disable_cmd = "aks update --resource-group={resource_group} --name={name} --disable-http-proxy --aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/DisableHTTPProxyPreview"
6140+
6141+
self.cmd(
6142+
disable_cmd,
6143+
checks=[
6144+
self.check("httpProxyConfig.enabled", False),
6145+
],
6146+
)
6147+
6148+
# delete
6149+
self.cmd(
6150+
"aks delete -g {resource_group} -n {name} --yes --no-wait",
6151+
checks=[self.is_empty()],
6152+
)
6153+
61326154
@AllowLargeResponse()
61336155
@AKSCustomResourceGroupPreparer(
61346156
random_name_length=17, name_prefix="clitest", location="westus2"

src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6511,6 +6511,40 @@ def test_update_http_proxy_config(self):
65116511
)
65126512
self.assertEqual(dec_mc_1, ground_truth_mc_1)
65136513

6514+
# custom value
6515+
dec_2 = AKSPreviewManagedClusterUpdateDecorator(
6516+
self.cmd,
6517+
self.client,
6518+
{
6519+
"disable_http_proxy": True,
6520+
},
6521+
CUSTOM_MGMT_AKS_PREVIEW,
6522+
)
6523+
6524+
mc_2 = self.models.ManagedCluster(
6525+
location="test_location",
6526+
http_proxy_config = self.models.ManagedClusterHTTPProxyConfig(
6527+
enabled=True,
6528+
httpProxy="http://cli-proxy-vm:3128/",
6529+
httpsProxy="https://cli-proxy-vm:3129/",
6530+
)
6531+
)
6532+
dec_2.context.attach_mc(mc_2)
6533+
# fail on passing the wrong mc object
6534+
with self.assertRaises(CLIInternalError):
6535+
dec_2.update_http_proxy_enabled(None)
6536+
dec_mc_2 = dec_2.update_http_proxy_enabled(mc_2)
6537+
6538+
ground_truth_mc_2 = self.models.ManagedCluster(
6539+
location="test_location",
6540+
http_proxy_config = self.models.ManagedClusterHTTPProxyConfig(
6541+
enabled=False,
6542+
httpProxy="http://cli-proxy-vm:3128/",
6543+
httpsProxy="https://cli-proxy-vm:3129/",
6544+
)
6545+
)
6546+
self.assertEqual(dec_mc_2, ground_truth_mc_2)
6547+
65146548
def test_update_pod_identity_profile(self):
65156549
# default value in `aks_update`
65166550
dec_1 = AKSPreviewManagedClusterUpdateDecorator(

src/aks-preview/linter_exclusions.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ aks update:
239239
disable_retina_flow_logs:
240240
rule_exclusions:
241241
- option_length_too_long
242+
disable_http_proxy:
243+
rule_exclusions:
244+
- option_length_too_long
242245
aks delete:
243246
parameters:
244247
ignore_pod_disruption_budget:

src/aks-preview/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from setuptools import setup, find_packages
1111

12-
VERSION = "18.0.0b7"
12+
VERSION = "18.0.0b8"
1313

1414
CLASSIFIERS = [
1515
"Development Status :: 4 - Beta",

0 commit comments

Comments
 (0)