-
Notifications
You must be signed in to change notification settings - Fork 1.4k
improvement(offering): make network mode mandatory when creating vpc … #13622
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
Open
Chinmay048
wants to merge
3
commits into
apache:main
Choose a base branch
from
Chinmay048:fix/13607-validate-network-mode-offerings
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
2cfc768
improvement(offering): make network mode mandatory when creating vpc …
Chinmay048 c1e4dc5
Restore API parameter descriptions and add mandatory networkMode vali…
Chinmay048 a5783ae
Restore API parameter descriptions and add mandatory networkMode vali…
Chinmay048 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,11 +153,8 @@ public abstract class NetworkOfferingBaseCmd extends BaseCmd { | |
| since = "4.20.0") | ||
| private Boolean nsxSupportsInternalLbService; | ||
|
|
||
| @Parameter(name = ApiConstants.NETWORK_MODE, | ||
| type = CommandType.STRING, | ||
| description = "Indicates the mode with which the network will operate. Valid option: NATTED or ROUTED", | ||
| since = "4.20.0") | ||
| private String networkMode; | ||
| @Parameter(name = ApiConstants.NETWORK_MODE, type = CommandType.STRING, required = true, description = "the network mode for the network offering") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here you should also put back the possible values and in addition to that the |
||
| private String networkMode; | ||
|
Comment on lines
+156
to
+157
|
||
|
|
||
| @Parameter(name = ApiConstants.FOR_TUNGSTEN, | ||
| type = CommandType.BOOLEAN, | ||
|
|
||
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
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.
Next make sure all annotations in have a
sinceparameter in ``CreateNetworkOffering` containing "4.24.0” , the expected version to add this PR to.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.
Actually, having a second look at this change I am not so sure about it anymore.
CC/can you have a look @weizhouapache @vishesh92 ?
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.
Do not make API changes !!!
Uh oh!
There was an error while loading. Please reload this page.
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.
@weizhouapache @DaanHoogland Understood! I realize that adding required = true to existing @ Parameter annotations breaks backward compatibility for external scripts and API clients.
I will immediately revert the required = true changes in both CreateVPCOfferingCmd and CreateNetworkOfferingCmd so the external API contract remains untouched. To enforce the required network mode behavior safely, I will move the validation and exception handling strictly into the backend service/manager layer instead. I'll push the updated approach shortly!