Skip to content
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

Fix policydefinition and policysetdefinition removal of 'empty' conditional logic #811

Merged
merged 3 commits into from
Jul 3, 2023

Conversation

Jefajers
Copy link
Member

Overview/Summary

This PR fixes #810 by changing the Jq filtering logic during template removal composition of policydefinition and policysetdefinition resources.

Current logic produces a clean output by removing all empty values. This has negative impact on policyDefinitions with conditional logic that might use empty values. The logic change in this PR ensures that empty vaules belonging to keys matching Azure Policy conditions are excluded from removal.

This is a regression oversight introduced with version AzOps 2.0.0 due to overhaul of filters.

This PR also contains a bump in module dependency version PSFramework 1.8.289.

This PR fixes/adds/changes/removes

  1. Changes AzOps.psd1
  2. Changes policyDefinitions.jq
  3. Changes policySetDefinitions.jq
  4. Changes template.parameters.jq

Breaking Changes

N/A

Testing Evidence

Manual tests have been performed without issues and here is a jq snippet of a policy definition with empty description field and empty conditions like notEquals example.

As part of this Pull Request I have

  • Checked for duplicate Pull Requests
  • Associated it with relevant issues, for tracking and closure.
  • Ensured my code/branch is up-to-date with the latest changes in the main branch
  • Performed testing and provided evidence.
  • Updated relevant and associated documentation.

@Jefajers Jefajers added the bug Something isn't working label Jun 30, 2023
@Jefajers Jefajers added this to the Release - v2.2.1 milestone Jun 30, 2023
@Jefajers Jefajers requested a review from a team as a code owner June 30, 2023 12:03
@Jefajers Jefajers requested a review from a team as a code owner June 30, 2023 12:03
@Jefajers Jefajers temporarily deployed to test June 30, 2023 21:38 — with GitHub Actions Inactive
@Jefajers Jefajers temporarily deployed to test July 1, 2023 00:27 — with GitHub Actions Inactive
Copy link
Contributor

@daltondhcp daltondhcp left a comment

Choose a reason for hiding this comment

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

👍🏻

@daltondhcp daltondhcp merged commit 582b0c1 into Azure:main Jul 3, 2023
4 checks passed
@daltondhcp daltondhcp deleted the nullvalues branch July 3, 2023 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Policy definition is overwritten by AzOps engine during the pull
2 participants