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

Add NSX-T ALB provider configuration support #398

Merged
merged 6 commits into from
Sep 14, 2021

Conversation

Didainius
Copy link
Collaborator

@Didainius Didainius commented Sep 6, 2021

This PR adds support for Provider part of NSX-T ALB configuration functions. These are required to configure VCD for usage of AVI load balancer (NSX-T ALB)

Functionality includes 5 entities in total. 3 of them have CRUD functionality (some still do not support Update in VCD) and 2 Read-only entities used only for lookup of AVI Controller components for mapping in VCD.

Note. This functionality requires VCD >= 10.2

Testing configuration adds 4 new config parameters

NsxtAlbControllerUrl      string `yaml:"nsxtAlbControllerUrl"`
NsxtAlbControllerUser     string `yaml:"nsxtAlbControllerUser"`
NsxtAlbControllerPassword string `yaml:"nsxtAlbControllerPassword"`
NsxtAlbImportableCloud    string `yaml:"nsxtAlbImportableCloud"`

Signed-off-by: Dainius Serplis <[email protected]>
@@ -494,7 +494,7 @@ func (client *Client) OpenApiDeleteItem(apiVersion string, urlRef *url.URL, para
// OpenApiPostItemAsync, OpenApiPostItem, OpenApiPutItemSync, OpenApiPutItemAsync, OpenApiPutItem
func (client *Client) openApiPerformPostPut(httpMethod string, apiVersion string, urlRef *url.URL, params url.Values, payload interface{}, additionalHeader map[string]string) (*http.Response, error) {
// Marshal payload if we have one
var body *bytes.Buffer
body := new(bytes.Buffer)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This change is required so that ==nil evaluation works well when an empty body is being sent.
var body *bytes.buffer (!= nil)
new(bytes.Buffer) == nil

Signed-off-by: Dainius Serplis <[email protected]>
@Didainius Didainius marked this pull request as ready for review September 8, 2021 06:16
Signed-off-by: Dainius Serplis <[email protected]>
Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

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

LGTM!

Signed-off-by: Dainius Serplis <[email protected]>
@Didainius Didainius merged commit dd8f46a into vmware:master Sep 14, 2021
@Didainius Didainius deleted the nsxt_alb_clouds-pr branch September 14, 2021 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants