-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(operator): stage DGD admission path migration #11129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
sttts
wants to merge
2
commits into
ai-dynamo:release/1.3.0
from
sttts:sttts-admission-graceful-path-change-1.3
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
45 changes: 45 additions & 0 deletions
45
deploy/operator/internal/webhook/dynamographdeployment_conversion.go
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package webhook | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
| nvidiacomv1alpha1 "github.com/ai-dynamo/dynamo/deploy/operator/api/v1alpha1" | ||
| nvidiacomv1beta1 "github.com/ai-dynamo/dynamo/deploy/operator/api/v1beta1" | ||
| ) | ||
|
|
||
| // ConvertDynamoGraphDeploymentToV1Beta1 converts an admission object from the | ||
| // v1alpha1 spoke to the v1beta1 hub used by the DGD admission logic. | ||
| func ConvertDynamoGraphDeploymentToV1Beta1(src *nvidiacomv1alpha1.DynamoGraphDeployment) (*nvidiacomv1beta1.DynamoGraphDeployment, error) { | ||
| dst := &nvidiacomv1beta1.DynamoGraphDeployment{} | ||
| if err := src.ConvertTo(dst); err != nil { | ||
| return nil, fmt.Errorf("convert v1alpha1 DynamoGraphDeployment to v1beta1: %w", err) | ||
| } | ||
| return dst, nil | ||
| } | ||
|
|
||
| // ConvertDynamoGraphDeploymentToV1Alpha1 converts a v1beta1 hub object to the | ||
| // v1alpha1 spoke expected by the legacy mutation endpoint. | ||
| func ConvertDynamoGraphDeploymentToV1Alpha1(src *nvidiacomv1beta1.DynamoGraphDeployment) (*nvidiacomv1alpha1.DynamoGraphDeployment, error) { | ||
| dst := &nvidiacomv1alpha1.DynamoGraphDeployment{} | ||
| if err := dst.ConvertFrom(src); err != nil { | ||
| return nil, fmt.Errorf("convert v1beta1 DynamoGraphDeployment to v1alpha1: %w", err) | ||
| } | ||
| return dst, nil | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚩 Helm webhook apiVersion downgrade leaves v1beta1 requests unvalidated
The Helm chart changes the webhook rules from
apiVersions: v1beta1toapiVersions: v1alpha1for both the validating and mutating DynamoGraphDeployment webhooks (webhook-configuration.yaml:98andwebhook-configuration.yaml:256). While the operator binary serves both v1alpha1 and v1beta1 endpoints (dynamographdeployment_handler.go:140-149for defaulting,dynamographdeployment_handler.go:197-215for validation), the Kubernetes API server only dispatches admission requests matching the registered rules. Any direct v1beta1 DynamoGraphDeployment CREATE/UPDATE requests will bypass both validation and defaulting entirely during the 1.3 release window. The TODO comments indicate this is intentional for the migration, but the reviewer should confirm that v1beta1 is not yet served by the CRD or that bypassing validation is acceptable during this period.Was this helpful? React with 👍 or 👎 to provide feedback.