Skip to content

Commit

Permalink
Add Microsoft.PolicyInsights extension for public preview (#83)
Browse files Browse the repository at this point in the history
* Add Azure Policy

* Remove custom configuration and update tests
  • Loading branch information
nreisch authored Oct 27, 2021
1 parent b4b0b0e commit d545111
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/k8s-extension/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

1.0.1
++++++++++++++++++
* Enable Microsoft.PolicyInsights extension type

1.0.0
++++++++++++++++++
* Switch to GA api-version of Extensions (2021-09-01)
Expand Down
2 changes: 1 addition & 1 deletion src/k8s-extension/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# TODO: Add any additional SDK dependencies here
DEPENDENCIES = []

VERSION = "1.0.0"
VERSION = "1.0.1"

with open('README.rst', 'r', encoding='utf-8') as f:
README = f.read()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@ Describe 'Azure Policy Testing' {
$isAutoUpgradeMinorVersion = ($output | ConvertFrom-Json).autoUpgradeMinorVersion
$isAutoUpgradeMinorVersion.ToString() -eq "True" | Should -BeTrue

# Check that we get the principal id back for the created identity
$principalId = ($output | ConvertFrom-Json).identity.principalId
$principalId | Should -Not -BeNullOrEmpty

# Loop and retry until the extension installs
$n = 0
do
{
if (Get-ExtensionStatus $extensionName -eq $SUCCESS_MESSAGE) {
if (Get-PodStatus $extensionAgentName -Namespace $extensionAgentNamespace -eq $POD_RUNNING) {
break
}
# Only check the extension config, not the pod since this doesn't bring up pods
$output = Invoke-Expression "az $Env:K8sExtensionName show -c $($ENVCONFIG.arcClusterName) -g $($ENVCONFIG.resourceGroup) --cluster-type connectedClusters -n $extensionName" -ErrorVariable badOut
$provisioningState = ($output | ConvertFrom-Json).provisioningState
Write-Host "Got ProvisioningState: $provisioningState for the extension"
if ((Has-ExtensionData $extensionName) -And ($provisioningState -eq "Succeeded")) {
break
}
Start-Sleep -Seconds 10
$n += 1
Expand Down

0 comments on commit d545111

Please sign in to comment.