diff --git a/k8s-custom-pipelines.yml b/k8s-custom-pipelines.yml index 76666940070..185af022510 100644 --- a/k8s-custom-pipelines.yml +++ b/k8s-custom-pipelines.yml @@ -95,7 +95,7 @@ stages: - bash : | echo "Downloading the kind script" - curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64 + curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64 chmod +x ./kind ./kind create cluster displayName: "Create and Start the Kind cluster" diff --git a/src/k8s-extension/HISTORY.rst b/src/k8s-extension/HISTORY.rst index eeed091c6cc..e5560ac1e81 100644 --- a/src/k8s-extension/HISTORY.rst +++ b/src/k8s-extension/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.5.1 +++++++++++++++++++ +* Remove pyhelm which was causing users to have git installed + 0.5.0 ++++++++++++++++++ * Add microsoft.openservicemesh customization to check distros diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py index c5ad73ac35f..048dfe58637 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py @@ -12,8 +12,6 @@ from azure.cli.core.azclierror import InvalidArgumentValueError, RequiredArgumentMissingError from azure.cli.core.commands.client_factory import get_subscription_id -from pyhelm.chartbuilder import ChartBuilder -from pyhelm.repo import VersionError from packaging import version import yaml @@ -69,7 +67,7 @@ def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_t # NOTE-2: Return a valid ExtensionInstance object, Instance name and flag for Identity create_identity = False - _validate_tested_distro(cmd, resource_group_name, cluster_name, version) + # _validate_tested_distro(cmd, resource_group_name, cluster_name, version) extension_instance = ExtensionInstance( extension_type=extension_type, @@ -107,58 +105,58 @@ def Delete(self, client, resource_group_name, cluster_name, name, cluster_type): pass -def _validate_tested_distro(cmd, cluster_resource_group_name, cluster_name, extension_version): +# def _validate_tested_distro(cmd, cluster_resource_group_name, cluster_name, extension_version): - field_unavailable_error = '\"testedDistros\" field unavailable for version {0} of microsoft.openservicemesh, ' \ - 'cannot determine if this Kubernetes distribution has been properly tested'.format(extension_version) +# field_unavailable_error = '\"testedDistros\" field unavailable for version {0} of microsoft.openservicemesh, ' \ +# 'cannot determine if this Kubernetes distribution has been properly tested'.format(extension_version) - if version.parse(str(extension_version)) <= version.parse("0.8.3"): - logger.warning(field_unavailable_error) - return +# if version.parse(str(extension_version)) <= version.parse("0.8.3"): +# logger.warning(field_unavailable_error) +# return - subscription_id = get_subscription_id(cmd.cli_ctx) - resources = cf_resources(cmd.cli_ctx, subscription_id) +# subscription_id = get_subscription_id(cmd.cli_ctx) +# resources = cf_resources(cmd.cli_ctx, subscription_id) - cluster_resource_id = '/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Kubernetes' \ - '/connectedClusters/{2}'.format(subscription_id, cluster_resource_group_name, cluster_name) +# cluster_resource_id = '/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Kubernetes' \ +# '/connectedClusters/{2}'.format(subscription_id, cluster_resource_group_name, cluster_name) - resource = resources.get_by_id(cluster_resource_id, '2020-01-01-preview') - cluster_distro = resource.properties['distribution'].lower() +# resource = resources.get_by_id(cluster_resource_id, '2020-01-01-preview') +# cluster_distro = resource.properties['distribution'].lower() - if cluster_distro == "general": - logger.warning('Unable to determine if distro has been tested for microsoft.openservicemesh, ' - 'kubernetes distro: \"general\"') - return +# if cluster_distro == "general": +# logger.warning('Unable to determine if distro has been tested for microsoft.openservicemesh, ' +# 'kubernetes distro: \"general\"') +# return - tested_distros = _get_tested_distros(extension_version) +# tested_distros = _get_tested_distros(extension_version) - if tested_distros is None: - logger.warning(field_unavailable_error) - elif cluster_distro not in tested_distros.split(): - logger.warning('Untested kubernetes distro for microsoft.openservicemesh, Kubernetes distro is %s', - cluster_distro) +# if tested_distros is None: +# logger.warning(field_unavailable_error) +# elif cluster_distro not in tested_distros.split(): +# logger.warning('Untested kubernetes distro for microsoft.openservicemesh, Kubernetes distro is %s', +# cluster_distro) -def _get_tested_distros(chart_version): +# def _get_tested_distros(chart_version): - try: - chart_arc = ChartBuilder({ - "name": OpenServiceMesh.CHART_NAME, - "version": str(chart_version), - "source": { - "type": "repo", - "location": OpenServiceMesh.CHART_LOCATION - } - }) - except VersionError: - raise InvalidArgumentValueError( - "Invalid version '{}' for microsoft.openservicemesh".format(chart_version) - ) +# try: +# chart_arc = ChartBuilder({ +# "name": OpenServiceMesh.CHART_NAME, +# "version": str(chart_version), +# "source": { +# "type": "repo", +# "location": OpenServiceMesh.CHART_LOCATION +# } +# }) +# except VersionError: +# raise InvalidArgumentValueError( +# "Invalid version '{}' for microsoft.openservicemesh".format(chart_version) +# ) - values = chart_arc.get_values() - values_yaml = yaml.load(values.raw, Loader=yaml.FullLoader) +# values = chart_arc.get_values() +# values_yaml = yaml.load(values.raw, Loader=yaml.FullLoader) - try: - return values_yaml['OpenServiceMesh']['testedDistros'] - except KeyError: - return None +# try: +# return values_yaml['OpenServiceMesh']['testedDistros'] +# except KeyError: +# return None diff --git a/src/k8s-extension/azext_k8s_extension/tests/latest/test_open_service_mesh.py b/src/k8s-extension/azext_k8s_extension/tests/latest/test_open_service_mesh.py index 72e94a06831..61b774045ce 100644 --- a/src/k8s-extension/azext_k8s_extension/tests/latest/test_open_service_mesh.py +++ b/src/k8s-extension/azext_k8s_extension/tests/latest/test_open_service_mesh.py @@ -9,14 +9,15 @@ import unittest from azure.cli.core.azclierror import InvalidArgumentValueError -from azext_k8s_extension.partner_extensions.OpenServiceMesh import _get_tested_distros +# from azext_k8s_extension.partner_extensions.OpenServiceMesh import _get_tested_distros TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) class TestOpenServiceMesh(unittest.TestCase): def test_bad_osm_arc_version(self): - version = "0.7.1" - err = "Invalid version \'" + str(version) + "\' for microsoft.openservicemesh" - with self.assertRaises(InvalidArgumentValueError) as argError: - _get_tested_distros(version) - self.assertEqual(str(argError.exception), err) + # version = "0.7.1" + # err = "Invalid version \'" + str(version) + "\' for microsoft.openservicemesh" + # with self.assertRaises(InvalidArgumentValueError) as argError: + # _get_tested_distros(version) + # self.assertEqual(str(argError.exception), err) + pass diff --git a/src/k8s-extension/setup.py b/src/k8s-extension/setup.py index a8400af15cc..a9a7f60fbaa 100644 --- a/src/k8s-extension/setup.py +++ b/src/k8s-extension/setup.py @@ -30,11 +30,9 @@ ] # TODO: Add any additional SDK dependencies here -DEPENDENCIES = [ - 'pyhelm' -] +DEPENDENCIES = [] -VERSION = "0.5.0" +VERSION = "0.5.1" with open('README.rst', 'r', encoding='utf-8') as f: README = f.read() diff --git a/testing/Bootstrap.ps1 b/testing/Bootstrap.ps1 index c9123ba6d03..0598b139c79 100644 --- a/testing/Bootstrap.ps1 +++ b/testing/Bootstrap.ps1 @@ -18,15 +18,10 @@ if (-not (Test-Path -Path $PSScriptRoot/tmp)) { if (!$SkipInstall) { Write-Host "Removing the old connnectedk8s extension..." az extension remove -n connectedk8s - $connectedk8sVersion = $ENVCONFIG.extensionVersion.connectedk8s - if (!$connectedk8sVersion) { - Write-Host "connectedk8s extension version wasn't specified" -ForegroundColor Red - Exit 1 - } - Write-Host "Installing connectedk8s version $connectedk8sVersion..." - az extension add --source ./bin/connectedk8s-$connectedk8sVersion-py3-none-any.whl + Write-Host "Installing connectedk8s..." + az extension add -n connectedk8s if (!$?) { - Write-Host "Unable to find connectedk8s version $connectedk8sVersion, exiting..." + Write-Host "Unable to install connectedk8s, exiting..." exit 1 } } @@ -76,5 +71,10 @@ if ($?) Write-Host "Connecting the cluster to Arc with connectedk8s..." $Env:KUBECONFIG="$PSScriptRoot/tmp/KUBECONFIG" -$Env:HELMVALUESPATH="$PSScriptRoot/bin/connectedk8s-values.yaml" az connectedk8s connect -g $ENVCONFIG.resourceGroup -n $ENVCONFIG.arcClusterName +if (!$?) +{ + kubectl get pods -A + Exit 1 +} +Write-Host "Successfully onboarded the cluster to Azure" \ No newline at end of file diff --git a/testing/bin/connectedk8s-1.0.0-py3-none-any.whl b/testing/bin/connectedk8s-1.0.0-py3-none-any.whl deleted file mode 100644 index 08f34250036..00000000000 Binary files a/testing/bin/connectedk8s-1.0.0-py3-none-any.whl and /dev/null differ diff --git a/testing/bin/connectedk8s-values.yaml b/testing/bin/connectedk8s-values.yaml deleted file mode 100644 index 5d76bd4521b..00000000000 --- a/testing/bin/connectedk8s-values.yaml +++ /dev/null @@ -1,3 +0,0 @@ -systemDefaultValues: - extensionoperator: - enabled: true \ No newline at end of file diff --git a/testing/settings.template.json b/testing/settings.template.json index 04eda8e4dfa..5129dbd0a20 100644 --- a/testing/settings.template.json +++ b/testing/settings.template.json @@ -6,7 +6,6 @@ "extensionVersion": { "k8s-extension": "0.3.0", - "k8s-extension-private": "0.1.0", - "connectedk8s": "1.0.0" + "k8s-extension-private": "0.1.0" } } \ No newline at end of file