Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions src/connectedk8s/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Release History
===============
1.3.6
++++++

* Updated patch behaviour for Azure Hybrid Benefit property

1.3.5
++++++

Expand Down
6 changes: 6 additions & 0 deletions src/connectedk8s/azext_connectedk8s/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,12 @@ def update_connected_cluster(cmd, client, resource_group_name, cluster_name, htt
patch_cc_response = update_connected_cluster_internal(client, resource_group_name, cluster_name, tags, distribution, distribution_version, azure_hybrid_benefit)

proxy_params_unset = (https_proxy == "" and http_proxy == "" and no_proxy == "" and proxy_cert == "" and not disable_proxy)

# Returning the ARM response if only AHB is being updated
arm_properties_only_ahb_set = (tags is None and distribution is None and distribution_version is None and azure_hybrid_benefit is not None)
if proxy_params_unset and auto_upgrade is None and container_log_path is None and arm_properties_only_ahb_set:
return patch_cc_response
Comment on lines +951 to +954
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test case for this change?

Copy link
Copy Markdown
Contributor Author

@akashkeshari akashkeshari Nov 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhoxing-ms , The test case for that is already covered in the test file. I have re-recorded the tests which should have covered this case

self.cmd('connectedk8s update -g akkeshar -n {name} --azure-hybrid-benefit true --kube-config {kubeconfig} --yes', checks=[

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks~


if proxy_params_unset and not auto_upgrade and arm_properties_unset and not container_log_path:
raise RequiredArgumentMissingError(consts.No_Param_Error)

Expand Down
Loading