fix(azure): accept cilium as a valid AKS network_policy#8066
Open
arpitjain099 wants to merge 1 commit into
Open
fix(azure): accept cilium as a valid AKS network_policy#8066arpitjain099 wants to merge 1 commit into
arpitjain099 wants to merge 1 commit into
Conversation
azurerm_kubernetes_cluster supports 'cilium' as a network_policy value (via the Azure CNI Overlay / Cilium data plane), alongside 'azure' and 'calico'. The AKS Network Policy Misconfigured query only treated 'azure' and 'calico' as valid, so a cluster configured with network_policy = "cilium" was reported as an incorrect value (a false positive). Add 'cilium' to validPolicy, update the two keyExpectedValue messages to list it, and add a negative test case (negative3) using cilium. Signed-off-by: arpitjain099 <arpitjain099@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #7297
Problem
The
AKS Network Policy Misconfiguredquery (terraform/azure/aks_network_policy_misconfigured) only acceptsazureandcalicoas valid values fornetwork_profile.network_policy. Azure AKS also supportsciliumas a network policy (the Azure CNI powered by Cilium / Cilium data plane), so a cluster configured withnetwork_policy = "cilium"is reported as anIncorrectValueresult. That is a false positive, as raised in #7297.Fix
validPolicy("cilium") = truesociliumis no longer flagged as an incorrect value.keyExpectedValuemessages from "should be either 'azure' or 'calico'" to "should be either 'azure', 'calico' or 'cilium'" so the guidance matches what the query now accepts.negative3) totest/negative.tfusingnetwork_policy = "cilium"to lock in the expected behaviour.The existing positive samples are unchanged: an invalid value (
network_policy = "roxanne") is still flagged, and the missing-attribute / missing-network_profile cases still flag, so the only behavioural change is thatciliumstops being reported.Testing
Ran locally against
master:All pass. As a regression check I reverted only the
query.regochange while keeping the newciliumnegative sample, and the query test failed (theciliumcluster was reported asIncorrectValue), confirming the new sample actually exercises the fix.Reference
Azure docs list
ciliumas a supportednetwork_policyvalue for AKS (Azure CNI powered by Cilium): https://learn.microsoft.com/en-us/azure/aks/azure-cni-powered-by-cilium