fix(operator): stage DGD admission path migration - #11117
Conversation
Signed-off-by: Dr. Stefan Schimanski <sschimanski@nvidia.com>
|
👋 Hi sttts! Thank you for contributing to ai-dynamo/dynamo. Just a reminder: The 🚀 |
This comment has been minimized.
This comment has been minimized.
WalkthroughAdds v1alpha1 compatibility endpoints for DynamoGraphDeployment admission webhooks (defaulting and validation) alongside existing v1beta1 endpoints, introducing conversion helpers between the two API versions, dual webhook registration, updated Helm webhook configuration paths/apiVersions, and corresponding tests. Changesv1alpha1 webhook dual-registration
Estimated code review effort: 4 (Complex) | ~55 minutes Related Issues: None referenced. Related PRs: None referenced. Suggested labels: operator, webhook, api-versioning Suggested reviewers: None specified. Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@deploy/operator/internal/webhook/validation/dynamographdeployment_handler.go`:
- Around line 236-242: Map validation errors back to v1alpha1 field names in the
legacy webhook handler. The ValidateCreate and ValidateUpdate paths in the
dynamoGraphDeploymentV1Alpha1Handler currently pass through validator errors
from the hub conversion unchanged, so legacy clients see v1beta1-style paths
such as spec.components instead of the submitted v1alpha1 paths like
spec.services. Update the v1alpha1 wrapper to translate the returned validation
error field paths/messages back to the v1alpha1 schema before returning, using
the handler methods that invoke validateCreate/validateUpdate and any existing
error-mapping helpers in this package.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: daa77a04-bc90-44f2-a200-8ab32d9d4bd5
📒 Files selected for processing (6)
deploy/helm/charts/platform/components/operator/templates/webhook-configuration.yamldeploy/operator/internal/webhook/defaulting/dynamographdeployment_handler.godeploy/operator/internal/webhook/defaulting/dynamographdeployment_handler_test.godeploy/operator/internal/webhook/dynamographdeployment_conversion.godeploy/operator/internal/webhook/validation/dynamographdeployment_handler.godeploy/operator/internal/webhook/validation/dynamographdeployment_handler_test.go
Signed-off-by: Dr. Stefan Schimanski <sschimanski@nvidia.com>
|
/ok to test 8c1dc85 |
Summary
Validation
GOCACHE=/private/tmp/dynamo-go-cache go test ./internal/webhook/...helm lint .helm template dynamo-operator . --namespace dynamo-system --set discoveryBackend=kubernetesSummary by CodeRabbit
New Features
DynamoGraphDeploymentadmission webhooks across both the older and newer API versions.Bug Fixes