Skip to content
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

Adding the missing parameters for creating the next available Subnet in a Address block #6

Conversation

venkat-iblox
Copy link
Collaborator

@venkat-iblox venkat-iblox commented Nov 7, 2023

To support the creation of the Next Available Subnet in an Address Block. The added Params are sent in QueryParams and are used in the creation.

@venkat-iblox venkat-iblox changed the title Adding the missing parameters for creating the next available Subnet … Adding the missing parameters for creating the next available Subnet in a Address block Nov 7, 2023
@venkat-iblox venkat-iblox marked this pull request as ready for review November 8, 2023 18:26
@@ -7,6 +7,7 @@ package address_block

import (
"context"
"github.com/go-openapi/swag"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to follow the existing pattern and move this one to the next block.

// query param cidr
var qrCidr int32

if o.Cidr != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this if pointless? Same comment applies to all added parameters.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. But this is generated code, so I left it as is

Comment on lines +243 to +249
var qrComment string

if o.Comment != nil {
qrComment = *o.Comment
}
qComment := qrComment
if qComment != "" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need two temporary variables to handle a string?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we don't need it. But this is generated code, so I left it as is

}
}
}

if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we supposed to accumulate all the errors within res instead of bailing out on the first one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should. But this is generated code, so I left it as is

Copy link
Collaborator

@akleinib akleinib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know I was reviewing auto-generated code as the first line containing // Code generated by go-swagger; DO NOT EDIT. doesn't show up in the diff.

@venkat-iblox
Copy link
Collaborator Author

I didn't know I was reviewing auto-generated code as the first line containing // Code generated by go-swagger; DO NOT EDIT. doesn't show up in the diff.

I should have added this info

@venkat-iblox venkat-iblox merged commit 660297e into infobloxopen:inheritance_sources Nov 8, 2023
6 checks passed
@venkat-iblox venkat-iblox deleted the update-next-avaialble-subnet branch November 8, 2023 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants