forked from Azure/azure-cli-extensions
-
Notifications
You must be signed in to change notification settings - Fork 2
Extend ContainerInsights Extension for high log scale mode support #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3abd1ac
Extend ContainerInsights Extension for high log scale mode support
wanlonghenry a7efafd
update test with retry
wanlonghenry c26d0d0
update test with retry
wanlonghenry 93e986b
clean dcr and dce when delete
wanlonghenry 09a3034
update revert version bump
wanlonghenry d90834a
add check
wanlonghenry 832c52e
update delete logic using workspace_region
wanlonghenry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
testing/test/extensions/public/AzureMonitorHighScale.Tests.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| Describe 'Azure Monitor High Scale Mode Testing' { | ||
| BeforeAll { | ||
| $extensionType = "microsoft.azuremonitor.containers" | ||
| $extensionName = "azuremonitor-containers" | ||
| $extensionAgentName = "omsagent" | ||
| $extensionAgentNamespace = "kube-system" | ||
|
|
||
| . $PSScriptRoot/../../helper/Constants.ps1 | ||
| . $PSScriptRoot/../../helper/Helper.ps1 | ||
| } | ||
|
|
||
| It 'Creates the extension with high log scale mode and checks that it onboards correctly' { | ||
| az $Env:K8sExtensionName create -c $($ENVCONFIG.arcClusterName) -g $($ENVCONFIG.resourceGroup) ` | ||
| --cluster-type connectedClusters --extension-type $extensionType -n $extensionName ` | ||
| --configuration-settings "amalogs.enableHighLogScaleMode=true" --no-wait | ||
| $? | Should -BeTrue | ||
|
|
||
| $output = az $Env:K8sExtensionName show -c $($ENVCONFIG.arcClusterName) -g $($ENVCONFIG.resourceGroup) --cluster-type connectedClusters -n $extensionName | ||
| $? | Should -BeTrue | ||
|
|
||
| $extension = ($output | ConvertFrom-Json) | ||
| $isAutoUpgradeMinorVersion = $extension.autoUpgradeMinorVersion | ||
| $isAutoUpgradeMinorVersion.ToString() -eq "True" | Should -BeTrue | ||
|
|
||
| # Verify high scale mode configuration | ||
| $settings = $extension.configurationSettings | ||
| $settings.'amalogs.enableHighLogScaleMode' | Should -Be "true" | ||
|
|
||
| # Loop and retry until the extension installs | ||
| $n = 0 | ||
| do | ||
| { | ||
| if (Has-ExtensionData $extensionName) { | ||
| break | ||
| } | ||
| Start-Sleep -Seconds 10 | ||
| $n += 1 | ||
| } while ($n -le $MAX_RETRY_ATTEMPTS) | ||
| $n | Should -BeLessOrEqual $MAX_RETRY_ATTEMPTS | ||
| } | ||
|
|
||
| It "Performs a show on the extension" { | ||
| $output = az $Env:K8sExtensionName show -c $($ENVCONFIG.arcClusterName) -g $($ENVCONFIG.resourceGroup) --cluster-type connectedClusters -n $extensionName | ||
| $? | Should -BeTrue | ||
| $output | Should -Not -BeNullOrEmpty | ||
| } | ||
|
|
||
| It "Lists the extensions on the cluster" { | ||
| $output = az $Env:K8sExtensionName list -c $($ENVCONFIG.arcClusterName) -g $($ENVCONFIG.resourceGroup) --cluster-type connectedClusters | ||
| $? | Should -BeTrue | ||
|
|
||
| $output | Should -Not -BeNullOrEmpty | ||
| $extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionType } | ||
| $extensionExists | Should -Not -BeNullOrEmpty | ||
| } | ||
|
|
||
| It "Deletes the extension from the cluster" { | ||
| $output = az $Env:K8sExtensionName delete -c $($ENVCONFIG.arcClusterName) -g $($ENVCONFIG.resourceGroup) --cluster-type connectedClusters -n $extensionName --force | ||
| $? | Should -BeTrue | ||
|
|
||
| # Extension should not be found on the cluster | ||
| $output = az $Env:K8sExtensionName show -c $($ENVCONFIG.arcClusterName) -g $($ENVCONFIG.resourceGroup) --cluster-type connectedClusters -n $extensionName | ||
| $? | Should -BeFalse | ||
| $output | Should -BeNullOrEmpty | ||
| } | ||
|
|
||
| It "Performs another list after the delete" { | ||
| $output = az $Env:K8sExtensionName list -c $($ENVCONFIG.arcClusterName) -g $($ENVCONFIG.resourceGroup) --cluster-type connectedClusters | ||
| $? | Should -BeTrue | ||
| $output | Should -Not -BeNullOrEmpty | ||
|
|
||
| $extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName } | ||
| $extensionExists | Should -BeNullOrEmpty | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.