feat: custom resources must explicity set their helm hooks OR opt out#66
Merged
ayuskauskas merged 2 commits intomainfrom Feb 5, 2026
Merged
feat: custom resources must explicity set their helm hooks OR opt out#66ayuskauskas merged 2 commits intomainfrom
ayuskauskas merged 2 commits intomainfrom
Conversation
Tests will check if helm.sh/hook is on custom resources. If not it will error with suggested fix. The fix is to either add them or add a skip annotation if the user knows it isn't needed. The logic behind this is that the developer of the manifest knows best if the resource needs additions hooks or not. Attempting to detect and add automatically can have unintended behaviour. By being declarative and checking we get the best of both worlds: known state and avoiding un-intentional issues.
Coverage Report ✅
Coverage BadgeMerging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. |
…validation Add a --wait --timeout 10m to the example helm install command. fix(skyhook-customizations/h100-eks-ubuntu-training): replace _ with - to conform to name validation
3 tasks
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.
Summary
Tests will check if helm.sh/hook is on custom resources. If not it will error with suggested fix. The fix is to either add them or add a skip annotation if the user knows it isn't needed.
Motivation / Context
The logic behind this is that the developer of the manifest knows best if the resource needs additions hooks or not. Attempting to detect and add automatically can have unintended behaviour. By being declarative and checking we get the best of both worlds: known state and avoiding un-intentional issues.
Fixes: Issue with Skyhook-customizations needing to be after operator installs
Related:
Type of Change
Component(s) Affected
cmd/eidos,pkg/cli)cmd/eidosd,pkg/api,pkg/server)pkg/recipe)pkg/bundler,pkg/component/*)pkg/collector,pkg/snapshotter)pkg/validator)pkg/errors,pkg/k8s)docs/,examples/)Implementation Notes
Problem
The automatic detection of CRD-dependent resources fails because manifest files contain embedded Helm templates (e.g.,
{{ .Release.Service }}) that break YAML parsing. Instead of trying to reliably strip Helm syntax, we shift responsibility to manifest authors.Solution
make testto catch violations earlyImplementation
1. Update the Skyhook manifest to include Helm hooks
File:
pkg/recipe/data/components/skyhook-customizations/manifests/h100-eks-ubuntu-training.yamlAdd annotations after
metadata::2. Add validation test
File:
pkg/recipe/yaml_test.go(new test function)Standard K8s APIs (no hooks needed):
v1,apps/v1,batch/v1,networking.k8s.io/*,rbac.authorization.k8s.io/*, etc.3. Simplify the bundler code
File:
pkg/bundler/deployer/helm/helm.goisCRDDependentResource()function (unreliable)addHelmHookAnnotation()function (no longer needed)generateTemplates()to just copy manifest content as-is4. Error message format
When a manifest fails validation:
Testing
# Commands run (prefer `make qualify` for non-trivial changes) make qualifyRisk Assessment
Rollout notes:
Checklist
make testwith-race)make lint)git commit -s) — DCO info