improvement(offering): make network mode mandatory when creating vpc …#13622
Open
Chinmay048 wants to merge 1 commit into
Open
improvement(offering): make network mode mandatory when creating vpc …#13622Chinmay048 wants to merge 1 commit into
Chinmay048 wants to merge 1 commit into
Conversation
…and network offerings (apache#13607)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to eliminate ambiguous VPC/Network Offering configurations by making networkmode (ROUTED vs NATTED) mandatory at both the UI form-validation layer and the Java API parameter layer.
Changes:
- Added Ant Design Vue form rules to require
networkmodeselection in the VPC Offering and Network Offering creation UIs. - Marked
networkmodeasrequired = truein the Java API command parameter annotations for VPC and Network offering creation flows.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| ui/src/views/offering/AddVpcOffering.vue | Adds a required validation rule for networkmode in the VPC offering creation form. |
| ui/src/views/offering/AddNetworkOffering.vue | Adds a required validation rule for networkmode in the network offering creation form. |
| api/src/main/java/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java | Sets networkmode as required in the API command parameter definition for VPC offering creation (currently impacts clone as well via inheritance). |
| api/src/main/java/org/apache/cloudstack/api/command/admin/network/NetworkOfferingBaseCmd.java | Sets networkmode as required in the shared base command for network offering create/clone (currently impacts clone as well via inheritance). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+369
to
+370
| // ADD THIS LINE: | ||
| networkmode: [{ required: true, message: this.$t('message.error.select') }], |
Comment on lines
+714
to
+715
| // ADD THIS LINE: | ||
| networkmode: [{ required: true, message: this.$t('message.error.select') }], |
Comment on lines
+147
to
148
| @Parameter(name = ApiConstants.NETWORK_MODE, type = CommandType.STRING, required = true, description = "the network mode for the VPC offering") | ||
| private String networkMode; |
Comment on lines
+156
to
+157
| @Parameter(name = ApiConstants.NETWORK_MODE, type = CommandType.STRING, required = true, description = "the network mode for the network offering") | ||
| private String networkMode; |
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.
Description
This PR resolves an issue where the
networkmodeparameter (ROUTED vs NATTED) was treated as optional during the creation of VPC and Network Offerings, leading to ambiguous network configurations.Full-Stack Boundary Enforcement:
required: true) inAddVpcOffering.vueandAddNetworkOffering.vueto give administrators immediate visual feedback and prevent form submission if a network mode is not selected.required = trueto the@Parameterannotation inCreateVPCOfferingCmd.javaandNetworkOfferingBaseCmd.java(which governs creation and cloning operations without impacting updates).Types of changes
Checklist: