Skip to content
Closed
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
4 changes: 4 additions & 0 deletions src/connectedk8s/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

1.10.4
++++++
* Fixed the issue where the 'connectedk8s proxy' command would fail if the kubeconfig file was empty.

1.10.3
++++++
* Fixed linting and styling issues, and added type annotations.
Expand Down
4 changes: 2 additions & 2 deletions src/connectedk8s/azext_connectedk8s/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def load_arguments(self, command: CLICommand) -> None:
COMMAND_LOADER_CLS = Connectedk8sCommandsLoader

__all__ = [
"helps",
"Connectedk8sCommandsLoader",
"COMMAND_LOADER_CLS",
"Connectedk8sCommandsLoader",
"helps",
]
10 changes: 4 additions & 6 deletions src/connectedk8s/azext_connectedk8s/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
Create_Directory_Fault_Type = (
"Error while creating directory for placing the executable"
)
Remove_File_Fault_Type = "Error while deleting the specified file"
Run_Clientproxy_Fault_Type = "Error while starting client proxy process."
Post_Hybridconn_Fault_Type = (
"Error while posting hybrid connection details to proxy process"
Expand Down Expand Up @@ -460,23 +461,20 @@
)
DNS_Check_Result_String = "DNS Result:"
AZ_CLI_ADAL_TO_MSAL_MIGRATE_VERSION = "2.30.0"
CLIENT_PROXY_VERSION = "1.3.022011"
CLIENT_PROXY_VERSION = "1.3.028501"
CLIENT_PROXY_FOLDER = ".clientproxy"
API_SERVER_PORT = 47011
CLIENT_PROXY_PORT = 47010
CLIENTPROXY_CLIENT_ID = "04b07795-8ddb-461a-bbee-02f9e1bf7b46"
API_CALL_RETRIES = 12
DEFAULT_REQUEST_TIMEOUT = 10 # seconds
RELEASE_DATE_WINDOWS = "release12-01-23"
RELEASE_DATE_LINUX = "release12-01-23"
CSP_REFRESH_TIME = 300

# Default timeout in seconds for Onboarding Helm Install
DEFAULT_MAX_ONBOARDING_TIMEOUT_HELMVALUE_SECONDS = "1200"

# URL constants
CSP_Storage_Url = "https://k8sconnectcsp.azureedge.net"
CSP_Storage_Url_Mooncake = "https://k8sconnectcsp.blob.core.chinacloudapi.cn"
CSP_Storage_Url_Fairfax = "https://k8sconnectcsp.azureedge.us"
CLIENT_PROXY_MCR_TARGET = "mcr.microsoft.com/azureconnectivity/proxy"
HELM_STORAGE_URL = "https://k8connecthelm.azureedge.net"
HELM_VERSION = "v3.12.2"
Download_And_Install_Kubectl_Fault_Type = "Failed to download and install kubectl"
Expand Down
42 changes: 42 additions & 0 deletions src/connectedk8s/azext_connectedk8s/_fileutils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

import os

from azure.cli.core import azclierror, telemetry
from knack import log

import azext_connectedk8s._constants as consts

logger = log.get_logger(__name__)


def delete_file(file_path: str, message: str, warning: bool = False) -> None:
# pylint: disable=broad-except
if os.path.isfile(file_path):
try:
os.remove(file_path)
except Exception as e:
telemetry.set_exception(
exception=e,
fault_type=consts.Remove_File_Fault_Type,
summary=f"Unable to delete file at {file_path}",
)
if warning:
logger.warning(message)
else:
raise azclierror.FileOperationError(message + "Error: " + str(e)) from e


def create_directory(file_path: str, error_message: str) -> None:
try:
os.makedirs(file_path)
except Exception as e:
telemetry.set_exception(
exception=e,
fault_type=consts.Create_Directory_Fault_Type,
summary="Unable to create installation directory",
)
raise azclierror.FileOperationError(error_message + "Error: " + str(e)) from e
12 changes: 0 additions & 12 deletions src/connectedk8s/azext_connectedk8s/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1542,18 +1542,6 @@ def az_cli(args_str: str) -> Any:
return True


# def is_cli_using_msal_auth():
# response_cli_version = az_cli("version --output json")
# try:
# cli_version = response_cli_version['azure-cli']
# except Exception as ex:
# raise CLIInternalError(f"Unable to decode the az cli version installed: {ex}")
# if version.parse(cli_version) >= version.parse(consts.AZ_CLI_ADAL_TO_MSAL_MIGRATE_VERSION):
# return True
# else:
# return False


def is_cli_using_msal_auth() -> bool:
response_cli_version = az_cli("version --output json")
try:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
Loading
Loading