Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
e92fe03
add null check for empty kube-config in connectedk8s proxy scenario
Nov 22, 2024
77ac7cd
Tidying - ruff and type annotations fix (#25)
dimbleby Nov 22, 2024
43e253f
add telemetry for error
atchutbarli Dec 3, 2024
0185e40
initial commit move utils
JorgeDaboub Dec 4, 2024
10e746b
enable at token refresh
JorgeDaboub Dec 4, 2024
cdb52e2
spaces
atchutbarli Dec 4, 2024
52b6d33
clean up
JorgeDaboub Dec 4, 2024
9cc1d72
Update _utils.py
atchutbarli Dec 4, 2024
1733995
fix lint errors
JorgeDaboub Dec 4, 2024
64eb5fe
Merge branch 'atchub/helminstallerror' of https://github.com/AzureArc…
atchutbarli Dec 4, 2024
401c18f
fix lint errors
JorgeDaboub Dec 5, 2024
c9058ca
Merge pull request #27 from AzureArcForKubernetes/jorgedaboub/msal_cs…
JorgeDaboub Dec 5, 2024
2358a49
Add Kubectl Check (#29)
JorgeDaboub Dec 10, 2024
80d29bc
Pull Arc-Proxy from MAR (#28)
JorgeDaboub Jan 9, 2025
23ac335
tests
atchutbarli Jan 29, 2025
ad84e7c
typo
atchutbarli Jan 29, 2025
eae2569
indent
atchutbarli Jan 29, 2025
fe23db0
Update k8s-custom-pipelines.yml
atchutbarli Jan 30, 2025
cd9468b
format
atchutbarli Jan 30, 2025
38d7eaa
tests
atchutbarli Jan 30, 2025
e9efcad
formatting
atchutbarli Jan 30, 2025
a1e4bff
format
atchutbarli Jan 30, 2025
72d8423
Merge branch 'main' into atchub/helminstallerror
atchutbarli Jan 30, 2025
e6b5d0c
add test
atchutbarli Jan 30, 2025
632cc05
Merge branch 'atchub/helminstallerror' of https://github.com/AzureArc…
atchutbarli Jan 30, 2025
61d84b3
initial
atchutbarli Jan 30, 2025
62287e9
final message
atchutbarli Jan 31, 2025
358d2de
format
atchutbarli Jan 31, 2025
46e9f76
Merge pull request #26 from AzureArcForKubernetes/atchub/helminstalle…
atchutbarli Jan 31, 2025
2d97b66
multiline
atchutbarli Jan 31, 2025
68101b2
Merge branch 'Azure:main' into main
bavneetsingh16 Feb 5, 2025
d2a3f30
update connectedk8s cli version and release notes (#31)
bavneetsingh16 Feb 5, 2025
4e28af2
Merge branch 'main' into atchub/oiderrordisplay
atchutbarli Feb 7, 2025
c922645
features
atchutbarli Feb 7, 2025
51f72b9
format
atchutbarli Feb 10, 2025
97be143
format
atchutbarli Feb 10, 2025
15707ee
singlequote
atchutbarli Feb 11, 2025
4194fec
warnings
atchutbarli Feb 11, 2025
d3443af
Merge pull request #30 from AzureArcForKubernetes/atchub/oiderrordisplay
atchutbarli Feb 13, 2025
41d6f64
change helm package download path to mcr (#32)
bavneetsingh16 Feb 13, 2025
cd09156
merge latest changes from upstream
Feb 14, 2025
9ab5e63
update connectedk8s cli version and release notes
Feb 14, 2025
cf44613
update release notes
Feb 14, 2025
e9c4fd8
update description in release notes
Feb 14, 2025
e7d7c70
Merge pull request #34 from AzureArcForKubernetes/pull_upstream_changes
bavneetsingh16 Feb 14, 2025
26dc437
Adds new distro discovery and fix to send the infra instead of generi…
atchutbarli Feb 26, 2025
6096545
Merge branch 'Azure:main' into main
bavneetsingh16 Mar 5, 2025
87476ba
Add documentation update for connectedk8s cli (#33)
atchutbarli Mar 6, 2025
b36f4f3
update release version to 1.10.7 (#36)
atchutbarli Mar 6, 2025
e69f15c
Merge branch 'Azure:main' into main
bavneetsingh16 Mar 6, 2025
62239d7
Update get_login_credentials flow (#37)
JorgeDaboub Mar 7, 2025
3fafb72
Merge branch 'Azure:main' into main
atchutbarli Mar 7, 2025
4145d5d
Add parameterization for the airgapped clouds
matthewmcneal Mar 18, 2025
ad88b47
add pester tests for connectedk8s cli extension
Mar 18, 2025
940942c
Fix azdev style
matthewmcneal Mar 18, 2025
5e59c2b
Merge remote-tracking branch 'origin/main' into mmcneal/Parameterizef…
matthewmcneal Mar 18, 2025
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
20 changes: 10 additions & 10 deletions src/connectedk8s/azext_connectedk8s/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@
AHB_Enum_Values = ["True", "False", "NotApplicable"]
Feature_Values = ["cluster-connect", "azure-rbac", "custom-locations"]
CRD_FOR_FORCE_DELETE = [
"arccertificates.clusterconfig.azure.com",
"azureclusteridentityrequests.clusterconfig.azure.com",
"azureextensionidentities.clusterconfig.azure.com",
"connectedclusters.arc.azure.com",
"customlocationsettings.clusterconfig.azure.com",
"extensionconfigs.clusterconfig.azure.com",
"gitconfigs.clusterconfig.azure.com",
"arccertificates.clusterconfig.azure",
"azureclusteridentityrequests.clusterconfig.azure",
"azureextensionidentities.clusterconfig.azure",
"connectedclusters.arc.azure",
"customlocationsettings.clusterconfig.azure",
"extensionconfigs.clusterconfig.azure",
"gitconfigs.clusterconfig.azure",
]
Helm_Install_Release_Userfault_Messages = [
"forbidden",
Expand Down Expand Up @@ -418,7 +418,7 @@

# Connect Precheck Diagnoser constants
Cluster_Diagnostic_Checks_Job_Registry_Path = (
"mcr.microsoft.com/azurearck8s/helmchart/stable/clusterdiagnosticchecks:0.2.2"
"azurearck8s/helmchart/stable/clusterdiagnosticchecks:0.2.2"
)
Cluster_Diagnostic_Checks_Helm_Install_Failed_Fault_Type = (
"Error while installing cluster diagnostic checks helm release"
Expand Down Expand Up @@ -481,8 +481,8 @@
DEFAULT_MAX_ONBOARDING_TIMEOUT_HELMVALUE_SECONDS = "1200"

# URL constants
CLIENT_PROXY_MCR_TARGET = "mcr.microsoft.com/azureconnectivity/proxy"
HELM_MCR_URL = "mcr.microsoft.com/azurearck8s/helm"
CLIENT_PROXY_MCR_TARGET = "azureconnectivity/proxy"
HELM_MCR_URL = "azurearck8s/helm"
HELM_VERSION = "v3.12.2"
Download_And_Install_Kubectl_Fault_Type = "Failed to download and install kubectl"
Azure_Access_Token_Variable = "AZURE_ACCESS_TOKEN"
Expand Down
19 changes: 18 additions & 1 deletion src/connectedk8s/azext_connectedk8s/_precheckutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

if TYPE_CHECKING:
from kubernetes.client import BatchV1Api, CoreV1Api
from knack.commands import CLICommand

logger = get_logger(__name__)
# pylint: disable=unused-argument, too-many-locals, too-many-branches, too-many-statements, line-too-long
Expand All @@ -30,6 +31,7 @@


def fetch_diagnostic_checks_results(
cmd: CLICommand,
corev1_api_instance: CoreV1Api,
batchv1_api_instance: BatchV1Api,
helm_client_location: str,
Expand All @@ -52,6 +54,7 @@ def fetch_diagnostic_checks_results(
# Executing the cluster_diagnostic_checks job and fetching the logs obtained
cluster_diagnostic_checks_container_log = (
executing_cluster_diagnostic_checks_job(
cmd,
corev1_api_instance,
batchv1_api_instance,
helm_client_location,
Expand Down Expand Up @@ -135,6 +138,7 @@ def fetch_diagnostic_checks_results(


def executing_cluster_diagnostic_checks_job(
cmd: CLICommand,
corev1_api_instance: CoreV1Api,
batchv1_api_instance: BatchV1Api,
helm_client_location: str,
Expand Down Expand Up @@ -208,8 +212,21 @@ def executing_cluster_diagnostic_checks_job(
)
return None

active_directory_array = cmd.cli_ctx.cloud.endpoints.active_directory.split(".")

# default for public, mc, ff clouds
mcr_postfix = active_directory_array[2]
# special cases for USSec, exclude part of suffix
if len(active_directory_array) == 4 and active_directory_array[2] == "microsoft":
mcr_postfix = active_directory_array[3]
# special case for USNat
elif len(active_directory_array) == 5:
mcr_postfix = active_directory_array[2] + "." + active_directory_array[3] + "." + active_directory_array[4]

mcr_url = f"mcr.microsoft.{mcr_postfix}"

chart_path = azext_utils.get_chart_path(
consts.Cluster_Diagnostic_Checks_Job_Registry_Path,
f"{mcr_url}/{consts.Cluster_Diagnostic_Checks_Job_Registry_Path}",
kube_config,
kube_context,
helm_client_location,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from azure.cli.core import azclierror, telemetry
from azure.cli.core.style import Style, print_styled_text
from knack import log
from knack.commands import CLICommand

import azext_connectedk8s._constants as consts
import azext_connectedk8s._fileutils as file_utils
Expand All @@ -22,6 +23,7 @@

# Downloads client side proxy to connect to Arc Connectivity Platform
def install_client_side_proxy(
cmd: CLICommand,
arc_proxy_folder: Optional[str], debug: bool = False
) -> str:
client_operating_system = _get_client_operating_system()
Expand All @@ -48,7 +50,7 @@ def install_client_side_proxy(
)

_download_proxy_from_MCR(
install_dir, proxy_name, client_operating_system, client_architecture
cmd, install_dir, proxy_name, client_operating_system, client_architecture
)
_check_proxy_installation(install_dir, proxy_name, debug)

Expand All @@ -64,9 +66,23 @@ def install_client_side_proxy(


def _download_proxy_from_MCR(
dest_dir: str, proxy_name: str, operating_system: str, architecture: str
cmd: CLICommand, dest_dir: str, proxy_name: str, operating_system: str, architecture: str
) -> None:
mar_target = f"{consts.CLIENT_PROXY_MCR_TARGET}/{operating_system.lower()}/{architecture}/arc-proxy"

active_directory_array = cmd.cli_ctx.cloud.endpoints.active_directory.split(".")

# default for public, mc, ff clouds
mcr_postfix = active_directory_array[2]
# special cases for USSec, exclude part of suffix
if len(active_directory_array) == 4 and active_directory_array[2] == "microsoft":
mcr_postfix = active_directory_array[3]
# special case for USNat
elif len(active_directory_array) == 5:
mcr_postfix = active_directory_array[2] + "." + active_directory_array[3] + "." + active_directory_array[4]

mcr_url = f"mcr.microsoft.{mcr_postfix}"

mar_target = f"{mcr_url}/{consts.CLIENT_PROXY_MCR_TARGET}/{operating_system.lower()}/{architecture}/arc-proxy"
logger.debug(
"Downloading Arc Connectivity Proxy from %s in Microsoft Artifact Regristy.",
mar_target,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
if TYPE_CHECKING:
from subprocess import Popen

from knack.commands import CLICommmand
from knack.commands import CLICommand
from requests.models import Response

from azext_connectedk8s.vendored_sdks.preview_2024_07_01.models import (
Expand All @@ -30,7 +30,7 @@


def handle_post_at_to_csp(
cmd: CLICommmand,
cmd: CLICommand,
api_server_port: int,
tenant_id: str,
clientproxy_process: Popen[bytes],
Expand Down
Loading
Loading