You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently to add a custom reason using assertion helper methods an implementation might look like this.
# Synopsis: AKS agent pools should run the same Kubernetes version as the cluster
Rule 'Azure.AKS.PoolVersion' {
$clusterVersion=$TargetObject.Properties.kubernetesVersionforeach ($poolin$TargetObject.Properties.agentPoolProfiles) {
$result=$Assert.HasDefaultValue($pool,'orchestratorVersion',$clusterVersion);
$result.AddReason(($LocalizedData.AKSNodePoolVersion-f$pool.name,$pool.orchestratorVersion));
$result;
}
}
This can be simplified with a fluent method like:
# Synopsis: AKS agent pools should run the same Kubernetes version as the cluster
Rule 'Azure.AKS.PoolVersion' {
$clusterVersion=$TargetObject.Properties.kubernetesVersionforeach ($poolin$TargetObject.Properties.agentPoolProfiles) {
$Assert.
HasDefaultValue($pool,'orchestratorVersion',$clusterVersion).
WithReason(($LocalizedData.AKSNodePoolVersion-f$pool.name,$pool.orchestratorVersion));
}
}
Additionally replacement of reasons is more involved.
The text was updated successfully, but these errors were encountered:
Currently to add a custom reason using assertion helper methods an implementation might look like this.
This can be simplified with a fluent method like:
Additionally replacement of reasons is more involved.
The text was updated successfully, but these errors were encountered: