Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 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
5ff7d66
ContainerInsights extension - Extend dataCollectionSettings with cont…
wanlonghenry Jul 18, 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
2dad4b6
[k8s-extension] Update extension CLI to v1.4.3
Jul 28, 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
5 changes: 5 additions & 0 deletions src/k8s-extension/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
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

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 @@ -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 @@ -100,7 +101,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 +115,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 +456,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 +474,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 +502,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 +688,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 +751,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:
Comment on lines +207 to +208
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask why do you need to use semver instead of packaging?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason is mentioned in AzureArcForKubernetes#241. Please let me know if you need more information.

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.
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