feat: add expected-resources deployment check for validating Kubernetes resources exist#149
Merged
mchmarny merged 5 commits intoNVIDIA:mainfrom Feb 19, 2026
Merged
Conversation
72f30d9 to
83e12b7
Compare
mchmarny
requested changes
Feb 19, 2026
Member
mchmarny
left a comment
There was a problem hiding this comment.
Good PR overall — follows existing check patterns, solid unit test coverage, and the metadata_store bug fix is a necessary companion change.
Key items to address:
- Timeout constants (
10sinverifyResource, phase defaults) should move topkg/defaultsper project convention Secretkind is mentioned in the PR description but not implemented in the switch — either add it or correct the description- Nil-guard removal on
recipeResultinvalidatePerformanceis a separate behavioral change worth calling out - E2e fail-case test can never actually fail due to
warn+passfallback
See inline comments for details.
|
@xdu31 this PR now has merge conflicts with |
…es resources exist
…ret kind, fix e2e fail-case assertions
8d00dd6 to
e240fd5
Compare
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
Add
expected-resourcesdeployment check that validates Kubernetes resources (Deployments, DaemonSets, StatefulSets) declared in recipecomponentRefs[].expectedResourcesactually exist in the cluster.Motivation / Context
Previously, there was no way to verify that critical resources like gpu-operator Deployments and DaemonSets were actually present in the cluster after deployment. This check closes that gap by validating expected resources exist during the deployment validation phase.
Fixes: N/A
Related: N/A
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
expected_resources_check.go: Implements the check by readingexpectedResourcesfrom recipe componentRefs and verifying each resource exists in the cluster via the Kubernetes API. Supports Deployment, DaemonSet, StatefulSet, Service, ConfigMap, and Secret kinds.phases.go: Wiresexpected-resourcesinto the deployment phase check registry and passes recipe data to the validator Job via environment variables.metadata_store.go: Bug fix —initBaseMergedSpec()was not copyingValidationconfig from the base overlay, causing generated recipes to silently dropvalidationsections.recipes/overlays/base.yaml: AddsexpectedResourceson gpu-operator (3 core resources) andvalidation.deployment.checks: [expected-resources]so all recipes inherit deployment validation.deployment: skippedtodeployment: passwithexpected-resourcescheck.tests/e2e/run.sh: Addedtest_validate_expected_resources()for live cluster testing (pass and fail scenarios).Testing
# Commands run make qualifyRisk Assessment
Rollout notes: Non-breaking. Existing recipes without
expectedResourcesorvalidationconfig are unaffected. The check only runs when both are present in the recipe.Checklist
make testwith-race)make lint)git commit -S) — GPG signing info