Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
252ede2
about to add check for if DCR is available in regions
daweim0 Jun 8, 2021
7b55668
tested
daweim0 Jun 10, 2021
f9e85a3
forgot to remove an exception
daweim0 Jun 11, 2021
f4a08e9
fixed linter problems
daweim0 Jun 11, 2021
e6eba96
merge
daweim0 Jun 14, 2021
10d1429
fixed some linter errors
daweim0 Jun 14, 2021
4639a0b
fixing linter errors
daweim0 Jun 15, 2021
0b25b7f
fixing some feedback, more to come
daweim0 Jun 15, 2021
6b2873a
fixed all feedback and a bug
daweim0 Jun 16, 2021
a8f31c6
cleanup
daweim0 Jun 16, 2021
70ecaa6
addressed comments and static analyzer errors
daweim0 Jun 17, 2021
5f4a295
Update src/aks-preview/azext_aks_preview/_help.py
daweim0 Jun 17, 2021
9d1852b
Update src/aks-preview/azext_aks_preview/_help.py
daweim0 Jun 17, 2021
be239f6
fix linter error
daweim0 Jun 17, 2021
33a27ef
fixed small errors
daweim0 Jun 18, 2021
c4653bb
added unit tests, cleaned up the msi/sp auth check
daweim0 Jun 26, 2021
5c750d7
adding unit tests
daweim0 Jun 28, 2021
4f3a720
commenting out tests which require a subscription-level feature flag
daweim0 Jun 28, 2021
2c6e107
uncommented tests, put them in a list to not run
daweim0 Jun 30, 2021
7032201
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
daweim0 Jun 30, 2021
fb3767a
bumping version number
daweim0 Jul 8, 2021
49bec04
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
daweim0 Jul 8, 2021
7211a81
fixed a bug in regions where DCRs are not enabled
daweim0 Jul 8, 2021
979b709
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
daweim0 Jul 8, 2021
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: 2 additions & 2 deletions src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3418,7 +3418,7 @@ def aks_disable_addons(cmd, client, resource_group_name, name, addons, no_wait=F
if addons == "monitoring" and CONST_MONITORING_ADDON_NAME in instance.addon_profiles and \
instance.addon_profiles[CONST_MONITORING_ADDON_NAME].enabled and \
CONST_MONITORING_USING_AAD_MSI_AUTH in instance.addon_profiles[CONST_MONITORING_ADDON_NAME].config and \
instance.addon_profiles[CONST_MONITORING_ADDON_NAME].config[CONST_MONITORING_USING_AAD_MSI_AUTH]:
str(instance.addon_profiles[CONST_MONITORING_ADDON_NAME].config[CONST_MONITORING_USING_AAD_MSI_AUTH]).lower() == 'true':
# remove the DCR association because otherwise the DCR can't be deleted
_ensure_container_insights_for_monitoring(
cmd,
Expand Down Expand Up @@ -3465,7 +3465,7 @@ def aks_enable_addons(cmd, client, resource_group_name, name, addons, workspace_

if CONST_MONITORING_ADDON_NAME in instance.addon_profiles and instance.addon_profiles[CONST_MONITORING_ADDON_NAME].enabled:
if CONST_MONITORING_USING_AAD_MSI_AUTH in instance.addon_profiles[CONST_MONITORING_ADDON_NAME].config and \
instance.addon_profiles[CONST_MONITORING_ADDON_NAME].config[CONST_MONITORING_USING_AAD_MSI_AUTH]:
str(instance.addon_profiles[CONST_MONITORING_ADDON_NAME].config[CONST_MONITORING_USING_AAD_MSI_AUTH]).lower() == 'true':
if not msi_auth:
raise ArgumentUsageError("--enable-msi-auth-for-monitoring can not be used on clusters with service principal auth.")
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1306,11 +1306,33 @@ def test_aks_create_with_monitoring_legacy_auth(self, resource_group, resource_g
'--generate-ssh-keys --enable-managed-identity ' \
'--enable-addons monitoring ' \
'--node-count 1 '
self.cmd(create_cmd, checks=[
response = self.cmd(create_cmd, checks=[
self.check('addonProfiles.omsagent.enabled', True),
self.exists('addonProfiles.omsagent.config.logAnalyticsWorkspaceResourceID'),
self.check('addonProfiles.omsagent.config.useAADAuth', 'False')
])
]).get_output_in_json()

# make sure a DCR was not created

cluster_resource_id = response["id"]
subscription = cluster_resource_id.split("/")[2]
workspace_resource_id = response["addonProfiles"]["omsagent"]["config"]["logAnalyticsWorkspaceResourceID"]
workspace_name = workspace_resource_id.split("/")[-1]
workspace_resource_group = workspace_resource_id.split("/")[4]

try:
# check that the DCR was created
dataCollectionRuleName = f"DCR-{workspace_name}"
dcr_resource_id = f"/subscriptions/{subscription}/resourceGroups/{workspace_resource_group}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}"
get_cmd = f'rest --method get --url https://management.azure.com{dcr_resource_id}?api-version=2019-11-01-preview'
self.cmd(get_cmd, checks=[
self.check('properties.destinations.logAnalytics[0].workspaceResourceId', f'{workspace_resource_id}')
])

assert False
except Exception as err:
pass # this is expected


# make sure monitoring can be smoothly disabled
self.cmd(f'aks disable-addons -a monitoring -g={resource_group} -n={aks_name}')
Expand Down
2 changes: 1 addition & 1 deletion src/aks-preview/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from codecs import open as open1
from setuptools import setup, find_packages

VERSION = "0.5.20"
VERSION = "0.5.21"
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
Expand Down