From bab1e713a04306a176b0e2ae130a46d278943512 Mon Sep 17 00:00:00 2001 From: Fuming Zhang Date: Mon, 19 Dec 2022 07:48:41 +0000 Subject: [PATCH] update --- src/aks-preview/HISTORY.rst | 3 + .../managed_cluster_decorator.py | 58 ------------------- 2 files changed, 3 insertions(+), 58 deletions(-) diff --git a/src/aks-preview/HISTORY.rst b/src/aks-preview/HISTORY.rst index 87f759a7cba..4f3d600b176 100644 --- a/src/aks-preview/HISTORY.rst +++ b/src/aks-preview/HISTORY.rst @@ -12,12 +12,15 @@ To release a new version, please select a new version number (usually plus 1 to Pending +++++++ +0.5.121 ++++++++ * Remove defender related code after GA, reuse the implementation in azure-cli/acs. * Remove check_raw_parameters in update code path, reuse the implementation in azure-cli/acs. * Remove oidc issuer related code after GA, reuse the implementation in azure-cli/acs. * Fix monitoring addon option `--enable-syslog` for `aks addon enable`. * Remove deprecated option `--node-zones`, use `--zones` instead. * Remove gpu instance profile related code after GA, reuse the implementation in azure-cli/acs. +* Remove http proxy config related code after GA, reuse the implementation in azure-cli/acs. 0.5.120 +++++++ diff --git a/src/aks-preview/azext_aks_preview/managed_cluster_decorator.py b/src/aks-preview/azext_aks_preview/managed_cluster_decorator.py index 9bea3befbba..545a1e9e273 100644 --- a/src/aks-preview/azext_aks_preview/managed_cluster_decorator.py +++ b/src/aks-preview/azext_aks_preview/managed_cluster_decorator.py @@ -188,40 +188,6 @@ def get_addon_consts(self) -> Dict[str, str]: addon_consts["CONST_GITOPS_ADDON_NAME"] = CONST_GITOPS_ADDON_NAME return addon_consts - def get_http_proxy_config(self) -> Union[Dict, ManagedClusterHTTPProxyConfig, None]: - """Obtain the value of http_proxy_config. - - :return: dictionary, ManagedClusterHTTPProxyConfig or None - """ - # read the original value passed by the command - http_proxy_config = None - http_proxy_config_file_path = self.raw_param.get("http_proxy_config") - # validate user input - if http_proxy_config_file_path: - if not os.path.isfile(http_proxy_config_file_path): - raise InvalidArgumentValueError( - "{} is not valid file, or not accessable.".format( - http_proxy_config_file_path - ) - ) - http_proxy_config = get_file_json(http_proxy_config_file_path) - if not isinstance(http_proxy_config, dict): - raise InvalidArgumentValueError( - "Error reading Http Proxy Config from {}. " - "Please see https://aka.ms/HttpProxyConfig for correct format.".format( - http_proxy_config_file_path - ) - ) - - # In create mode, try to read the property value corresponding to the parameter from the `mc` object - if self.decorator_mode == DecoratorMode.CREATE: - if self.mc and self.mc.http_proxy_config is not None: - http_proxy_config = self.mc.http_proxy_config - - # this parameter does not need dynamic completion - # this parameter does not need validation - return http_proxy_config - def get_pod_cidrs_and_service_cidrs_and_ip_families(self) -> Tuple[ Union[List[str], None], Union[List[str], None], @@ -1961,16 +1927,6 @@ def set_up_addon_profiles(self, mc: ManagedCluster) -> ManagedCluster: mc.addon_profiles = addon_profiles return mc - def set_up_http_proxy_config(self, mc: ManagedCluster) -> ManagedCluster: - """Set up http proxy config for the ManagedCluster object. - - :return: the ManagedCluster object - """ - self._ensure_mc(mc) - - mc.http_proxy_config = self.context.get_http_proxy_config() - return mc - def set_up_pod_security_policy(self, mc: ManagedCluster) -> ManagedCluster: """Set up pod security policy for the ManagedCluster object. @@ -2180,8 +2136,6 @@ def construct_mc_profile_preview(self, bypass_restore_defaults: bool = False) -> # DO NOT MOVE: keep this on top, construct the default ManagedCluster profile mc = self.construct_mc_profile_default(bypass_restore_defaults=True) - # set up http proxy config - mc = self.set_up_http_proxy_config(mc) # set up pod security policy mc = self.set_up_pod_security_policy(mc) # set up pod identity profile @@ -2361,16 +2315,6 @@ def update_api_server_access_profile(self, mc: ManagedCluster) -> ManagedCluster return mc - def update_http_proxy_config(self, mc: ManagedCluster) -> ManagedCluster: - """Set up http proxy config for the ManagedCluster object. - - :return: the ManagedCluster object - """ - self._ensure_mc(mc) - - mc.http_proxy_config = self.context.get_http_proxy_config() - return mc - def update_kube_proxy_config(self, mc: ManagedCluster) -> ManagedCluster: """Update kube proxy config for the ManagedCluster object. @@ -2676,8 +2620,6 @@ def update_mc_profile_preview(self) -> ManagedCluster: # DO NOT MOVE: keep this on top, fetch and update the default ManagedCluster profile mc = self.update_mc_profile_default() - # set up http proxy config - mc = self.update_http_proxy_config(mc) # update pod security policy mc = self.update_pod_security_policy(mc) # update pod identity profile