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

Vdc update #275

Merged
merged 17 commits into from
Jul 4, 2019
Merged

Vdc update #275

merged 17 commits into from
Jul 4, 2019

Conversation

vbauzys
Copy link
Contributor

@vbauzys vbauzys commented Jul 2, 2019

Ref:
https://github.com/terraform-providers/terraform-provider-vcd/issues/222
https://github.com/terraform-providers/terraform-provider-vcd/issues/239
https://github.com/terraform-providers/terraform-provider-vcd/issues/237
https://github.com/terraform-providers/terraform-provider-vcd/issues/265

These changes fix bug where resources guarantee were ignored on serializing, allows Org VDC update to be udpated and read fills and refresh all data in state file, state ID changed from name to vCD resource ID.

vbauzys added 3 commits July 2, 2019 14:47
Signed-off-by: Vaidotas Bauzys <[email protected]>
Fix ignoring reservations guarantee values

Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Copy link
Collaborator

@Didainius Didainius left a comment

Choose a reason for hiding this comment

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

Great to see covering that many issues.
First round from me.

vcd/resource_vcd_org_vdc_test.go Show resolved Hide resolved
vcd/resource_vcd_org_vdc.go Outdated Show resolved Hide resolved
vcd/resource_vcd_org_vdc.go Outdated Show resolved Hide resolved
website/docs/r/org_vdc.html.markdown Show resolved Hide resolved
vbauzys added 2 commits July 2, 2019 17:24
Signed-off-by: Vaidotas Bauzys <[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.

Some initial comments for now.
More review coming

CHANGELOG.md Outdated Show resolved Hide resolved
vcd/resource_vcd_org_vdc.go Outdated Show resolved Hide resolved
Optional: true,
ForceNew: true,
Description: "Percentage of allocated memory resources guaranteed to vApps deployed in this VDC. For example, if this value is 0.75, then 75% of allocated resources are guaranteed. Required when AllocationModel is AllocationVApp or AllocationPool. Value defaults to 1.0 if the element is empty.",
Type: schema.TypeString,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we changing the type from Float to String?

This change breaks compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please read explanation I did for Dainius above.

Copy link
Contributor

Choose a reason for hiding this comment

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

The explanation above is about the .ID field.
I am talking about changing the type of a field that will break existing Terraform scripts.

Copy link
Contributor Author

@vbauzys vbauzys Jul 3, 2019

Choose a reason for hiding this comment

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

Copying here:

in terraform file nothing changed: memory_guaranteed = 0.5 you still can write like this.
This change is must cause d.GetOk for empty value return 0 and d.Get for type float64 return false. And value can be not provided, 0 or other value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one changed

vcd/resource_vcd_org_vdc.go Show resolved Hide resolved
vcd/resource_vcd_org_vdc.go Show resolved Hide resolved

adminVdc, err := adminOrg.GetAdminVdcByName(vdcName)
if err != nil || adminVdc == (govcd.AdminVdc{}) {
log.Printf("[DEBUG] Unable to find vDC.")
Copy link
Contributor

Choose a reason for hiding this comment

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

"vDC" -> "VDC" (also in the rest of the PR)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed through file

vbauzys added 6 commits July 3, 2019 10:27
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Copy link
Collaborator

@Didainius Didainius left a comment

Choose a reason for hiding this comment

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

My minor comment about adding a note about ID to changelog. Other than that I'm good. Test suite passes.
Thanks for sorting out the Float thing.

Signed-off-by: Vaidotas Bauzys <[email protected]>
CHANGELOG.md Outdated

IMPROVEMENTS:
* Fix ignoring of resource guarantee values in `vcd_org_vdc` [GH-265]
* **Resource:** Org VDC `vcd_org_vdc` ID changed from name to vCD ID - [GH-275]
Copy link
Collaborator

Choose a reason for hiding this comment

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

**Resource:** highlight shouldn't be needed here. Unless I missed it, in guidelines there's no emphasis on improvements. They suggest using a form like this instead:

IMPROVEMENTS:

* resource/load_balancer: Add `ATTRIBUTE` argument (support X new functionality) [GH-12]
* resource/subnet: Now better [GH-22, GH-32]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Signed-off-by: Vaidotas Bauzys <[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

Signed-off-by: Vaidotas Bauzys <[email protected]>
vbauzys added 2 commits July 4, 2019 15:06
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[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 now!

@vbauzys vbauzys merged commit 7eb23de into vmware:master Jul 4, 2019
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