Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
3cc8452
Kubernetes Data Protection Extension CLI (#173)
Miraj50 Aug 25, 2022
6c56613
{AKS - ARC} fix: Update DCR creation to Clusters resource group inste…
bragi92 Sep 28, 2022
083ed6d
Add self-signed cert to fix PR gate for azureml extension
Sep 27, 2022
0a6208d
adding the api version to the operation definition in the client factory
Sep 29, 2022
2121a2e
Merge pull request #181 from AzureArcForKubernetes/deesharma/exttypes
deeksha345 Sep 29, 2022
9c6835c
bump k8s-extension version to 1.3.6
Sep 29, 2022
1aaef92
Merge pull request #182 from AzureArcForKubernetes/release-1.3.6
deeksha345 Sep 29, 2022
700bee5
adding tests for all 4 extension types calls
Sep 30, 2022
efd86d4
adding to test config file
Sep 30, 2022
8dcef49
updating the api version for extension types to be the correct versio…
Sep 30, 2022
2ecb63a
add test case for flux extension (#184)
bavneetsingh16 Oct 3, 2022
f1c9348
Merge branch 'k8s-extension/public' into deesharma/exttypestests
deeksha345 Oct 5, 2022
5c57791
Merge pull request #183 from AzureArcForKubernetes/deesharma/exttypes…
deeksha345 Oct 5, 2022
84dcc92
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Oct 5, 2022
4ae3aa6
bump k8s-extension version to 1.3.6
Oct 5, 2022
0213a71
bump k8s-extension version to 1.3.6
Oct 6, 2022
a2a8be4
Merge pull request #186 from AzureArcForKubernetes/release-1.3.6
deeksha345 Oct 6, 2022
ef3e79f
adding upstream test for extension types
Oct 17, 2022
eeadb2b
Merge pull request #189 from AzureArcForKubernetes/deesharma/addingex…
deeksha345 Oct 17, 2022
0378ecf
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Oct 17, 2022
929928f
updating history.rst
Oct 17, 2022
374edcf
Merge pull request #190 from AzureArcForKubernetes/release-1.3.6
deeksha345 Oct 18, 2022
5b6b4dc
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Oct 18, 2022
e95cd6e
Merge branch 'k8s-extension/public' into release-1.3.6
Oct 18, 2022
477613d
Merge pull request #191 from AzureArcForKubernetes/release-1.3.6
deeksha345 Oct 18, 2022
cbd30bf
[Dapr] Prompt user for existing Dapr installation during extension cr…
shubham1172 Nov 10, 2022
5d8592e
Merge branch 'main' of github.com:Azure/azure-cli-extensions into rel…
Nov 15, 2022
155fb01
bump k8s-extension version to 1.3.7
Nov 15, 2022
0d74a15
Merge branch 'main' of github.com:Azure/azure-cli-extensions into rel…
Nov 16, 2022
c88e8ef
Merge branch 'main' of github.com:Azure/azure-cli-extensions into rel…
Nov 18, 2022
464cca7
Merge pull request #196 from AzureArcForKubernetes/release-1.3.7
bavneetsingh16 Nov 18, 2022
0487616
[Dapr] Disable applying CRDs during a downgrade (#193)
shubham1172 Nov 28, 2022
d54d6ab
ContainerInsights extension - Add dataCollectionSettings configurati…
ganga1980 Dec 2, 2022
b2f1319
Upgrade Python version from 3.6 to 3.7 (#203)
NarayanThiru Dec 15, 2022
ee8a070
[Dapr] Do not apply CRD hook when version is unchanged or auto-upgrad…
shubham1172 Dec 16, 2022
e054268
add dummy key for amalogs as well
Dec 29, 2022
4a6fcdb
Merge branch 'k8s-extension/public' into user/amagraw/fix-bug/rename
pfrcks Dec 30, 2022
9b65294
Merge pull request #207 from pfrcks/user/amagraw/fix-bug/rename
deeksha345 Dec 30, 2022
887661d
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Jan 12, 2023
beffb3f
bump k8s-extension version to 1.3.8
Jan 12, 2023
f6e39ca
Merge branch 'k8s-extension/public' into release-1.3.8
deeksha345 Jan 12, 2023
6015026
Adding GA api version 2022-11-01 exposing isSystemExtension and suppo…
Nov 18, 2022
97c808f
Seperate args for plan name, product and publisher
Dec 13, 2022
d35686c
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Jan 13, 2023
c6d351f
Merge branch 'release-1.3.8' of https://github.com/AzureArcForKuberne…
Jan 13, 2023
0cd6017
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Jan 18, 2023
1b51c5e
updating cassete file
Jan 12, 2023
c1f8614
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Jan 19, 2023
2ff27e9
Merge pull request #199 from AzureArcForKubernetes/ariflakhani/2022-1…
Arif-lakhani Jan 20, 2023
e10938b
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Jan 23, 2023
2fb41e7
Merge branch 'k8s-extension/public' into release-1.3.8
deeksha345 Jan 23, 2023
8a48eea
updating HISTORY.rst
Jan 23, 2023
601d4c7
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
Jan 23, 2023
8319907
Merge pull request #209 from AzureArcForKubernetes/release-1.3.8
deeksha345 Jan 23, 2023
942738f
Deprecate longer parameter names when accepting config settings (#213)
Arif-lakhani Jan 31, 2023
f122f93
merge from upstream branch
Jan 31, 2023
9aa7d3d
Release 1.3.9
Jan 31, 2023
398f140
Merge pull request #214 from AzureArcForKubernetes/release/1.3.9
Arif-lakhani Jan 31, 2023
2473565
make containerinsights dcr name consistent (#211)
ganga1980 Feb 2, 2023
0845f61
[Dapr] Update version comparison logic to use semver based comparison…
shubham1172 Feb 17, 2023
ffb8a95
bump k8s-extension version to 1.4.0 (#220)
bavneetsingh16 Feb 17, 2023
c957325
Revert "bump k8s-extension version to 1.4.0 (#220)" (#222)
bavneetsingh16 Feb 17, 2023
9c0c41a
Merge branch 'main' of github.com:Azure/azure-cli-extensions into new…
Feb 18, 2023
de4f530
[k8s-extension] Update extension CLI to v1.4.0
Feb 18, 2023
e67bfda
Merge pull request #223 from AzureArcForKubernetes/new_release
bavneetsingh16 Feb 18, 2023
b0ee4c2
sync with upstream cli repo
Mar 22, 2023
4ced5e8
update release history
Mar 22, 2023
f30b5c9
fix openservice mesh cli testcase issue
Mar 22, 2023
03d9b63
Merge pull request #225 from AzureArcForKubernetes/sync_cli_upstream
bavneetsingh16 Mar 22, 2023
e09dcc6
Zetia/fix ssl secret flag (#224)
zetiaatgithub Mar 22, 2023
db556d2
feat: public preview support for microsoft.azuremonitor.containers.me…
bragi92 May 19, 2023
87a25a8
Merge branch 'main' of github.com:Azure/azure-cli-extensions into rel…
May 19, 2023
3a154e9
Merge pull request #229 from AzureArcForKubernetes/release-1.4.1
bavneetsingh16 May 20, 2023
4f2b74c
remove redundant extension test (#230)
bavneetsingh16 May 20, 2023
6e583a9
ci MSI default for arc cluster (#231)
wanlonghenry May 31, 2023
b295046
Merge branch 'main' of github.com:Azure/azure-cli-extensions into rel…
Jun 23, 2023
029ce31
bump k8s-extension version to 1.4.2
Jun 23, 2023
30a373b
Merge pull request #235 from AzureArcForKubernetes/release-1.4.2
bavneetsingh16 Jun 23, 2023
dfd1139
ContainerInsights extension - Extend dataCollectionSettings config se…
ganga1980 Jun 30, 2023
a33424b
Generated files for 2023-05-01-preview
Jun 30, 2023
a7fa6eb
Support for 2023-05-01-preview
Jul 5, 2023
290f24c
Rename get to show
Jul 5, 2023
4f6da18
Added ExtensionType api test cases
Jul 17, 2023
5ff7d66
ContainerInsights extension - Extend dataCollectionSettings with cont…
wanlonghenry Jul 18, 2023
57679f8
Fix for Liniting issues
Jul 19, 2023
9beb747
Fixing test cases
Jul 19, 2023
1f7b9ce
comment failing test cases
Jul 24, 2023
42d8b15
[k8s-extension] add kind tag in DCR creation (#240)
wanlonghenry Jul 25, 2023
e9aebbc
Use semver package (#241)
shubham1172 Jul 28, 2023
e36dfad
bump k8s-extension version to 1.4.3
Jul 28, 2023
2561f35
Merge pull request #243 from AzureArcForKubernetes/release-1.4.3
bavneetsingh16 Jul 28, 2023
3a2d4a8
Reverting commented test cases
Jul 25, 2023
4fa705d
Add support to skip provisioning of prerequisites for Azure Monitor K…
ms-hujia Aug 1, 2023
980d53b
{ARC} fix: update logic to sanitize cluster name for dc* objects (#242)
bragi92 Aug 1, 2023
29f1210
Fix osm-arc version check for CI tags (#244)
nshankar13 Aug 2, 2023
f230c8e
New cassette file
Aug 3, 2023
5091eaa
Remove unused propeties from table format
Aug 3, 2023
c2ac205
Merge branch 'k8s-extension/public' into arif/2021_05_01_preview
Arif-lakhani Aug 3, 2023
a122362
Merge pull request #236 from AzureArcForKubernetes/arif/2021_05_01_pr…
Arif-lakhani Aug 10, 2023
740fa4d
Merge branch 'main' of github.com:Azure/azure-cli-extensions into rel…
Aug 11, 2023
5ac1d97
bump k8s-extension version 1.4.3
Aug 11, 2023
e1250ee
Merge pull request #246 from AzureArcForKubernetes/release-new-1.4.3
bavneetsingh16 Aug 11, 2023
8df0be1
Add old commands back with deprecated status
Aug 11, 2023
aebbef4
Fix linting issues
Aug 14, 2023
a74f76d
Merge pull request #247 from AzureArcForKubernetes/ariflakhani/deprecate
Arif-lakhani Aug 14, 2023
9f8159c
Reverting changes for extensions type api
Aug 22, 2023
7166e84
change the location for test runs and arc clusters
Aug 23, 2023
6be2701
Merge pull request #249 from AzureArcForKubernetes/revertextensionstype
Arif-lakhani Aug 23, 2023
584815d
[k8s-extension] create new cli release - v1.4.3 (#250)
bavneetsingh16 Aug 23, 2023
aa77ff2
Revert "[k8s-extension] create new cli release - v1.4.3 (#250)" (#251)
bavneetsingh16 Aug 23, 2023
7944db5
Merge branch 'main' of github.com:Azure/azure-cli-extensions into new…
Aug 23, 2023
96beb6f
[k8s-extension] Update extension CLI to v1.4.3
Aug 23, 2023
b79d107
Merge pull request #253 from AzureArcForKubernetes/new_cli-1.4.3
bavneetsingh16 Aug 24, 2023
aa3f2be
remove redundant test files
Aug 24, 2023
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
8 changes: 8 additions & 0 deletions src/k8s-extension/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
Release History
===============

1.4.3
++++++++++++++++++
* microsoft.azuremonitor.containers: Extend ContainerInsights Extension dataCollectionSettings with streams and containerlogv2 field. Also, add a kind tag in DCR creation for the ContainerInsights extension.
* microsoft.dapr: Use semver instead of packaging
* microsoft.azuremonitor.containers.metrics: update logic to sanitize cluster name for dc* objects
* microsoft.openservicemesh: Fix osm-arc version check for CI tags
* add support to skip provisioning of prerequisites for Azure Monitor K8s extensions

1.4.2
++++++++++++++++++
* microsoft.azuremonitor.containers: ContainerInsights Extension Managed Identity Auth Enabled by default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import json
import re

from ..utils import get_cluster_rp_api_version
from ..utils import get_cluster_rp_api_version, is_skip_prerequisites_specified

from knack.log import get_logger

Expand Down Expand Up @@ -48,16 +48,19 @@ def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_t
if release_train is None:
release_train = 'stable'

cluster_subscription = get_subscription_id(cmd.cli_ctx)
ensure_azure_monitor_profile_prerequisites(
cmd,
cluster_rp,
cluster_subscription,
resource_group_name,
cluster_name,
configuration_settings,
cluster_type
)
if not is_skip_prerequisites_specified(configuration_settings):
cluster_subscription = get_subscription_id(cmd.cli_ctx)
ensure_azure_monitor_profile_prerequisites(
cmd,
cluster_rp,
cluster_subscription,
resource_group_name,
cluster_name,
configuration_settings,
cluster_type
)
else:
logger.info("Provisioning of prerequisites is skipped")

create_identity = True
extension = Extension(
Expand All @@ -72,6 +75,16 @@ def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_t
return extension, name, create_identity

def Delete(self, cmd, client, resource_group_name, cluster_name, name, cluster_type, cluster_rp, yes):
# cluster_rp, _ = get_cluster_rp_api_version(cluster_type=cluster_type, cluster_rp=cluster_rp)
cluster_rp, _ = get_cluster_rp_api_version(cluster_type=cluster_type, cluster_rp=cluster_rp)
try:
extension = client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, name)
except Exception:
pass # its OK to ignore the exception since MSI auth in preview

if (extension is not None) and (extension.configuration_settings is not None):
if is_skip_prerequisites_specified(extension.configuration_settings):
logger.info("Deprovisioning of prerequisites is skipped")
return

cluster_subscription = get_subscription_id(cmd.cli_ctx)
unlink_azure_monitor_profile_artifacts(cmd, cluster_subscription, resource_group_name, cluster_name)
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import json
import re

from ..utils import get_cluster_rp_api_version
from ..utils import get_cluster_rp_api_version, is_skip_prerequisites_specified
from .. import consts

from knack.log import get_logger
Expand All @@ -31,6 +31,7 @@
cf_resources, cf_resource_groups, cf_log_analytics)

logger = get_logger(__name__)
DCR_API_VERSION = "2022-06-01"


class ContainerInsights(DefaultExtension):
Expand Down Expand Up @@ -59,8 +60,11 @@ def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_t
'only supports cluster scope and single instance of this extension.', extension_type)
logger.warning("Defaulting to extension name '%s' and release-namespace '%s'", name, release_namespace)

_get_container_insights_settings(cmd, resource_group_name, cluster_rp, cluster_type, cluster_name, configuration_settings,
configuration_protected_settings, is_ci_extension_type)
if not is_skip_prerequisites_specified(configuration_settings):
_get_container_insights_settings(cmd, resource_group_name, cluster_rp, cluster_type, cluster_name, configuration_settings,
configuration_protected_settings, is_ci_extension_type)
else:
logger.info("Provisioning of prerequisites is skipped")

# NOTE-2: Return a valid Extension object, Instance name and flag for Identity
create_identity = True
Expand All @@ -85,6 +89,11 @@ def Delete(self, cmd, client, resource_group_name, cluster_name, name, cluster_t
except Exception:
pass # its OK to ignore the exception since MSI auth in preview

if (extension is not None) and (extension.configuration_settings is not None):
if is_skip_prerequisites_specified(extension.configuration_settings):
logger.info("Deprovisioning of prerequisites is skipped")
return

subscription_id = get_subscription_id(cmd.cli_ctx)
# handle cluster type here
cluster_resource_id = '/subscriptions/{0}/resourceGroups/{1}/providers/{2}/{3}/{4}'.format(subscription_id, resource_group_name, cluster_rp, cluster_type, cluster_name)
Expand All @@ -100,7 +109,7 @@ def Delete(self, cmd, client, resource_group_name, cluster_name, name, cluster_t
if (isinstance(useAADAuthSetting, str) and str(useAADAuthSetting).lower() == "true") or (isinstance(useAADAuthSetting, bool) and useAADAuthSetting):
useAADAuth = True
if useAADAuth:
association_url = cmd.cli_ctx.cloud.endpoints.resource_manager + f"{cluster_resource_id}/providers/Microsoft.Insights/dataCollectionRuleAssociations/ContainerInsightsExtension?api-version=2021-04-01"
association_url = cmd.cli_ctx.cloud.endpoints.resource_manager + f"{cluster_resource_id}/providers/Microsoft.Insights/dataCollectionRuleAssociations/ContainerInsightsExtension?api-version={DCR_API_VERSION}"
for _ in range(3):
try:
send_raw_request(cmd.cli_ctx, "GET", association_url,)
Expand All @@ -114,7 +123,7 @@ def Delete(self, cmd, client, resource_group_name, cluster_name, name, cluster_t
pass # its OK to ignore the exception since MSI auth in preview

if isDCRAExists:
association_url = cmd.cli_ctx.cloud.endpoints.resource_manager + f"{cluster_resource_id}/providers/Microsoft.Insights/dataCollectionRuleAssociations/ContainerInsightsExtension?api-version=2021-04-01"
association_url = cmd.cli_ctx.cloud.endpoints.resource_manager + f"{cluster_resource_id}/providers/Microsoft.Insights/dataCollectionRuleAssociations/ContainerInsightsExtension?api-version={DCR_API_VERSION}"
for _ in range(3):
try:
send_raw_request(cmd.cli_ctx, "DELETE", association_url,)
Expand Down Expand Up @@ -455,6 +464,8 @@ def _get_container_insights_settings(cmd, cluster_resource_group_name, cluster_r
subscription_id = get_subscription_id(cmd.cli_ctx)
workspace_resource_id = ''
useAADAuth = True
if 'amalogs.useAADAuth' not in configuration_settings:
configuration_settings['amalogs.useAADAuth'] = "true"
extensionSettings = {}

if configuration_settings is not None:
Expand All @@ -471,11 +482,15 @@ def _get_container_insights_settings(cmd, cluster_resource_group_name, cluster_r
logger.info("provided useAADAuth flag is : %s", useAADAuthSetting)
if (isinstance(useAADAuthSetting, str) and str(useAADAuthSetting).lower() == "true") or (isinstance(useAADAuthSetting, bool) and useAADAuthSetting):
useAADAuth = True
else:
useAADAuth = False
elif 'amalogs.useAADAuth' in configuration_settings:
useAADAuthSetting = configuration_settings['amalogs.useAADAuth']
logger.info("provided useAADAuth flag is : %s", useAADAuthSetting)
if (isinstance(useAADAuthSetting, str) and str(useAADAuthSetting).lower() == "true") or (isinstance(useAADAuthSetting, bool) and useAADAuthSetting):
useAADAuth = True
else:
useAADAuth = False
if useAADAuth and ('dataCollectionSettings' in configuration_settings):
dataCollectionSettingsString = configuration_settings["dataCollectionSettings"]
logger.info("provided dataCollectionSettings is : %s", dataCollectionSettingsString)
Expand All @@ -495,6 +510,14 @@ def _get_container_insights_settings(cmd, cluster_resource_group_name, cluster_r
namspaces = dataCollectionSettings["namespaces"]
if isinstance(namspaces, list) is False:
raise InvalidArgumentValueError('namespaces must be an array type')
if 'enableContainerLogV2' in dataCollectionSettings.keys():
enableContainerLogV2Value = dataCollectionSettings["enableContainerLogV2"]
if not isinstance(enableContainerLogV2Value, bool):
raise InvalidArgumentValueError('enableContainerLogV2Value value MUST be either true or false')
if 'streams' in dataCollectionSettings.keys():
streams = dataCollectionSettings["streams"]
if isinstance(streams, list) is False:
raise InvalidArgumentValueError('streams must be an array type')
extensionSettings["dataCollectionSettings"] = dataCollectionSettings

workspace_resource_id = workspace_resource_id.strip()
Expand Down Expand Up @@ -673,34 +696,35 @@ def _ensure_container_insights_dcr_for_monitoring(cmd, subscription_id, cluster_
if (cluster_region not in region_ids):
raise ClientRequestError(f"Data Collection Rule Associations are not supported for cluster region {cluster_region}")

dcr_url = cmd.cli_ctx.cloud.endpoints.resource_manager + f"{dcr_resource_id}?api-version=2021-04-01"
dcr_url = cmd.cli_ctx.cloud.endpoints.resource_manager + f"{dcr_resource_id}?api-version={DCR_API_VERSION}"
# get existing tags on the container insights extension DCR if the customer added any
existing_tags = get_existing_container_insights_extension_dcr_tags(cmd, dcr_url)
streams = ["Microsoft-ContainerInsights-Group-Default"]
if extensionSettings is not None and 'dataCollectionSettings' in extensionSettings.keys():
dataCollectionSettings = extensionSettings["dataCollectionSettings"]
if dataCollectionSettings is not None and 'streams' in dataCollectionSettings.keys():
streams = dataCollectionSettings["streams"]

# create the DCR
dcr_creation_body = json.dumps(
{
"location": workspace_region,
"tags": existing_tags,
"kind": "Linux",
"properties": {
"dataSources": {
"extensions": [
{
"name": "ContainerInsightsExtension",
"streams": [
"Microsoft-ContainerInsights-Group-Default"
],
"streams": streams,
"extensionName": "ContainerInsights",
"extensionSettings": extensionSettings
}
]
},
"dataFlows": [
{
"streams": [
"Microsoft-ContainerInsights-Group-Default"

],
"streams": streams,
"destinations": ["la-workspace"],
}
],
Expand Down Expand Up @@ -735,7 +759,7 @@ def _ensure_container_insights_dcr_for_monitoring(cmd, subscription_id, cluster_
},
}
)
association_url = cmd.cli_ctx.cloud.endpoints.resource_manager + f"{cluster_resource_id}/providers/Microsoft.Insights/dataCollectionRuleAssociations/ContainerInsightsExtension?api-version=2021-04-01"
association_url = cmd.cli_ctx.cloud.endpoints.resource_manager + f"{cluster_resource_id}/providers/Microsoft.Insights/dataCollectionRuleAssociations/ContainerInsightsExtension?api-version={DCR_API_VERSION}"
for _ in range(3):
try:
send_raw_request(cmd.cli_ctx, "PUT", association_url, body=association_body,)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from copy import deepcopy
from knack.log import get_logger
from knack.prompting import prompt, prompt_y_n
from packaging import version as packaging_version
from semver import VersionInfo

from ..vendored_sdks.models import Extension, PatchExtension, Scope, ScopeCluster
from .DefaultExtension import DefaultExtension
Expand Down Expand Up @@ -204,7 +204,7 @@ def _is_downgrade(v1: str, v2: str) -> bool:
Returns True if version v1 is less than version v2.
"""
try:
return packaging_version.Version(v1) < packaging_version.Version(v2)
except packaging_version.InvalidVersion:
return VersionInfo.parse(v1) < VersionInfo.parse(v2)
except ValueError:
logger.debug("Warning: Unable to compare versions %s and %s.", v1, v2)
return True # This will cause the apply-CRDs hook to be disabled, which is safe.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_t

def _validate_tested_distro(cmd, cluster_resource_group_name, cluster_name, extension_version, extension_release_train):

logger.warning("Running validated distros...")
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)

Expand Down Expand Up @@ -104,7 +103,10 @@ def _validate_tested_distro(cmd, cluster_resource_group_name, cluster_name, exte

extension_version = tags[len(tags) - 1]

if version.parse(str(extension_version)) <= version.parse("0.8.3"):
ext_str = str(extension_version)

# Don't parse version for test and CI tags
if "pr" not in ext_str and "release" not in ext_str and version.parse(ext_str) <= version.parse("0.8.3"):
logger.warning(field_unavailable_error)
return

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
# All DC* object names should end only in alpha numeric (after `length` trim)
# DCE remove underscore from cluster name
def sanitize_name(name, objtype, length):
name = name[0:length]
length = length - 1
if objtype == DC_TYPE.DCE:
name = name.replace("_", "")
name = name[0:length]
name = ''.join(char for char in name if char.isalnum() or char == '-')
lastIndexAlphaNumeric = len(name) - 1
while ((name[lastIndexAlphaNumeric].isalnum() is False) and lastIndexAlphaNumeric > -1):
lastIndexAlphaNumeric = lastIndexAlphaNumeric - 1
Expand Down
14 changes: 14 additions & 0 deletions src/k8s-extension/azext_k8s_extension/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,17 @@ def is_dogfood_cluster(cmd):
urlparse(cmd.cli_ctx.cloud.endpoints.resource_manager).hostname
== consts.DF_RM_HOSTNAME
)


def is_skip_prerequisites_specified(configuration_settings):
# Determine if provisioning to prerequisites should be skipped by a configuration setting named skipPrerequisites.
SKIP_PREQUISITES = 'skipPrerequisites'

has_skip_prerequisites_set = False

if SKIP_PREQUISITES in configuration_settings:
skip_prerequisites_configuration_setting = configuration_settings[SKIP_PREQUISITES]
if (isinstance(skip_prerequisites_configuration_setting, str) and str(skip_prerequisites_configuration_setting).lower() == "true") or (isinstance(skip_prerequisites_configuration_setting, bool) and skip_prerequisites_configuration_setting):
has_skip_prerequisites_set = True

return has_skip_prerequisites_set
2 changes: 1 addition & 1 deletion src/k8s-extension/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# TODO: Add any additional SDK dependencies here
DEPENDENCIES = []

VERSION = "1.4.2"
VERSION = "1.4.3"

with open("README.rst", "r", encoding="utf-8") as f:
README = f.read()
Expand Down