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 support for Service Engine Group assignment to NSX-T Edge Gateway #738

Merged
merged 20 commits into from
Nov 19, 2021

Conversation

Didainius
Copy link
Collaborator

@Didainius Didainius commented Nov 5, 2021

This PR adds resource and datasource to manage NSX-T ALB Service Engine Group assignment to Edge Gateways. It is named quite lengthy vcd_nsxt_alb_edgegateway_service_engine_group, but should reflect that this resource handle Service Engine Group assignments to Edge gateways as opposed to resource vcd_nsxt_alb_service_engine_group defining Service Engine Groups for provider in general.

Note. This is the last "setup" resource that requires System user. The next resources should be manageable by Org users and allow instantiate load balancers based on this setup.

Also:

  • updates Code Owners to GitHub configuration so that automatic code reviews are requested.
  • Adds a missing resource link to vcd_library_certificate in vcd.erb.
  • Cleans up main page shown in GitHub repo homepage README.md - changed old links to new ones, fixed broken logo link and rebranded remaining "vCloud Director" names to "VMware Cloud Director"
  • Improves make test-binary-validate so that it tests out terraform fmt -check on binary test files (moved out to separate PR due to many fixes Fix 'make test-binary-validate' command and all HCL errors #746)

Acceptance and binary tests passed on 10.2 and 10.3

@Didainius Didainius force-pushed the alb_seg-pr branch 3 times, most recently from 07c7fce to f0c559c Compare November 9, 2021 07:28
Signed-off-by: Dainius Serplis <[email protected]>
Signed-off-by: Dainius Serplis <[email protected]>
Signed-off-by: Dainius Serplis <[email protected]>
Signed-off-by: Dainius Serplis <[email protected]>
@Didainius Didainius changed the title Add support for Service Engine Groupp assignment to NSX-T Edge Gateway Add support for Service Engine Group assignment to NSX-T Edge Gateway Nov 9, 2021
@Didainius Didainius marked this pull request as ready for review November 9, 2021 10:17
@Didainius Didainius requested a review from vbauzys November 9, 2021 10:17
Signed-off-by: Dainius Serplis <[email protected]>
Signed-off-by: Dainius Serplis <[email protected]>
Copy link
Contributor

@dataclouder dataclouder left a comment

Choose a reason for hiding this comment

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

LGTM, with some minor formatting issues

`

const testAccVcdNsxtAlbEdgeGatewayServiceEngineGroupDedicatedDS = testAccVcdNsxtAlbEdgeGatewayServiceEngineGroupDedicated + `
data "vcd_nsxt_alb_edgegateway_service_engine_group" "test" {
Copy link
Contributor

Choose a reason for hiding this comment

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

This script is not formatted.
OT: It seems that make test-binary-validate doesn't check formatting. Needs to be updated

Copy link
Collaborator Author

@Didainius Didainius Nov 17, 2021

Choose a reason for hiding this comment

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

Fixed and updated make test-binary-validate (HCL validator fixes went to separate PR #746)

}

const testAccVcdNsxtAlbEdgeGatewayServiceEngineGroupShared = testAccVcdNsxtAlbGeneralSettings + `
resource "vcd_nsxt_alb_edgegateway_service_engine_group" "test" {
Copy link
Contributor

Choose a reason for hiding this comment

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

This script is not formatted

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed and updated make test-binary-validate (HCL validator fixes went to separate PR #746)

`

const testAccVcdNsxtAlbEdgeServiceEngineGroupSharedDS = testAccVcdNsxtAlbEdgeGatewayServiceEngineGroupDedicated + `
data "vcd_nsxt_alb_edgegateway_service_engine_group" "test" {
Copy link
Contributor

Choose a reason for hiding this comment

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

This script is not formatted

Copy link
Collaborator Author

@Didainius Didainius Nov 17, 2021

Choose a reason for hiding this comment

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

Fixed and updated make test-binary-validate (HCL validator fixes went to separate PR #746)

`

const testAccVcdNsxtAlbEdgeGatewayServiceEngineGroupSharedStep3 = testAccVcdNsxtAlbGeneralSettings + `
resource "vcd_nsxt_alb_edgegateway_service_engine_group" "test" {
Copy link
Contributor

Choose a reason for hiding this comment

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

This script is not formatted

Copy link
Collaborator Author

@Didainius Didainius Nov 17, 2021

Choose a reason for hiding this comment

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

Fixed and updated make test-binary-validate (HCL validator fixes went to separate PR #746)

return diag.Errorf("error reading ALB Service Engine Group assignment to Edge Gateway: %s", err)
}
edgeAlbServiceEngineGroupAssignmentConfig := getAlbServiceEngineGroupAssignmentType(d)
// Inject correct ID for update
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Inject correct ID for update
// Add correct ID for update

Maybe just Add is enough to avoid to much geekness :))))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed

}

return edgeAlbServiceEngineAssigmentConfig
}
Copy link
Contributor

@vbauzys vbauzys Nov 16, 2021

Choose a reason for hiding this comment

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

It's just me a little lost. Is AlbServiceEngineGroup or AlbServiceEngineGroupAssigment. In govcd I see AlbServiceEngineGroupAssigment in terraform I see both things. Are they different or the same thing with two names?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The Assignment word in govcd comes from API (loadBalancer/serviceEngineGroups/assignments/) however VCD UI does not use the term Assignment. The idea is that govcd follows API, while in Terraform we follow UI naming. In this case this was a leftover variable name from initial coding. I have removed the 'assignment' word.


const testAccVcdNsxtAlbEdgeGatewayServiceEngineGroupDedicated = testAccVcdNsxtAlbGeneralSettings + `
resource "vcd_nsxt_alb_edgegateway_service_engine_group" "test" {
edge_gateway_id = data.vcd_nsxt_edgegateway.existing.id
Copy link
Contributor

Choose a reason for hiding this comment

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

script not formatted

Copy link
Collaborator Author

@Didainius Didainius Nov 17, 2021

Choose a reason for hiding this comment

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

Fixed and updated make test-binary-validate (HCL validator fixes went to separate PR #746)

[docs-import]: https://www.terraform.io/docs/import/

```
terraform import vcd_nsxt_alb_settings.imported my-org.my-vdc.my-nsxt-edge-gateway-name.service-engine-group-name
Copy link
Contributor

Choose a reason for hiding this comment

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

Is service-engine-group-name is unique?

Copy link
Collaborator Author

@Didainius Didainius Nov 17, 2021

Choose a reason for hiding this comment

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

It is an interesting story, because this name comes exactly as in the nsxt_alb_service_engine_group resource. It can't be specified and comes in Unique from a layer above.

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.

Very clean, just one nit pick :)

name = "first-se"
}


Copy link
Collaborator

Choose a reason for hiding this comment

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

Extra new line. BTW, could we capture such double new lines with the script? It's a rather common slip :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed this one. Will try to do an automated check.

Signed-off-by: Dainius Serplis <[email protected]>
Signed-off-by: Dainius Serplis <[email protected]>
@Didainius Didainius merged commit 72cb07a into vmware:master Nov 19, 2021
@Didainius Didainius deleted the alb_seg-pr branch November 19, 2021 13:12
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.

4 participants