Repository navigation
Conversation
The admission-policy-engine-crd entry in global.enabledModules is not a proof that the SecurityPolicyException API is served: addon-operator adds <module>-crd for every enabled module that ships CRDs, so the entry is present on releases whose admission-policy-engine has no such CRD. Modules using the lib-helm SecurityPolicyException templates then fail to install with "no matches for kind SecurityPolicyException". Gate the SecurityPolicyException object and the pod label that refers to it in the CAPI, cloud controller manager, CSI controller and CSI node templates on the GVK alone through helm_lib_api_version_exists, instead of the admission-policy-engine-crd entry. The label tests asserted spec.selector.matchLabels, where the label is never set, so the negative cases passed regardless of the guard; they now check the pod template labels. Signed-off-by: v.oleynikov <vasily.oleynikov@flant.com>
duckhawk
force-pushed
the
fix/spe-requires-crd
branch
from
November 8, 2026 16:45
37eee83 to
5d5a754
Compare
This branch has not been deployed
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.
Description
Every SecurityPolicyException (and the pod label that refers to it) rendered by the CAPI controller manager, cloud controller manager, CSI controller and CSI node templates is now gated on
deckhouse.io/v1alpha1/SecurityPolicyExceptionbeing available according tohelm_lib_api_version_exists(modules' CRDs inglobal.discovery.apiVersionsor cluster discovery), together withsecurityPolicyExceptionEnabled. Theadmission-policy-engine-crdcheck inglobal.enabledModulesis removed. Unit tests are updated: the API presence alone renders the object and the label, the module entry alone does not, and the label tests now assert the pod template labels instead ofspec.selector.matchLabels, where the label is never set. The chart version is bumped to 1.72.35.Why do we need it, and what problem does it solve?
addon-operator adds
<module>-crdtoglobal.enabledModulesfor every enabled module that ships CRDs, soadmission-policy-engine-crdis present on DKP 1.73 even though that release has nodeckhouse.io/v1alpha1SecurityPolicyException CRD. A module using these templates withsecurityPolicyExceptionEnabled: truethen fails to install withno matches for kind "SecurityPolicyException" in version "deckhouse.io/v1alpha1". The CRD presence is the actual precondition for creating the object.What is the expected result?
On releases without the SecurityPolicyException API neither the SecurityPolicyException nor the
security.deckhouse.io/security-policy-exceptionpod label is rendered, and the module installs. Where the API exists, both are rendered regardless of theadmission-policy-engine-crdentry.Checklist