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

Fix bug that causes Compute Policies to fail on VCD 10.3.0 and 10.3.1 #911

Merged
merged 11 commits into from
Oct 5, 2022

Conversation

adambarreiro
Copy link
Collaborator

@adambarreiro adambarreiro commented Sep 26, 2022

Description

This PR amends the code added in PR #904, where the VM Placement Policies were onboarded to the Provider.

The problem that this PR fixes is that in VCD 10.3.0 and 10.3.1, vGPU Policies do not exist, hence the filter isVgpuPolicy causes an error when fetching VM Placement Policies.

To fix this situation, I added two auxiliary functions, getVgpuFilter, that returns a isVgpuPolicy filter option only if API version is greater or equal than 36.2 (VCD 10.3.2). Second function is getVgpuFilterToPrepend which is similar to the first one but it adds a ; to the right (The ; acts as a logical AND). This second one is intended to be used to prepend this vGPU filtering to an existing filter string.

RCA

The issue was identified when executing the acceptance tests in VCD 10.3.0.
PR #904 was tested with VCD 10.3.3 and 10.4.0, which already had vGPU Policy support (this was introduced in VCD 10.3.2), so this issue got undetected.

…filters

Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro self-assigned this Sep 26, 2022
#
Signed-off-by: abarreiro <abarreiro@vmware.com>
#
Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro changed the title Fixes a bug that causes Compute Policies to fail on VCD 10.3.0 Fixes a bug that causes Compute Policies to fail on VCD 10.3.0 and 10.3.1 Sep 27, 2022
#
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro marked this pull request as ready for review September 27, 2022 09:44
@adambarreiro adambarreiro changed the title Fixes a bug that causes Compute Policies to fail on VCD 10.3.0 and 10.3.1 Fix bug that causes Compute Policies to fail on VCD 10.3.0 and 10.3.1 Sep 27, 2022
…ider-vcd into fix-compute-policies

Signed-off-by: abarreiro <abarreiro@vmware.com>
Copy link
Collaborator

@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.

The tests work well, but there is something to discuss

vcd/resource_vcd_vm_placement_policy.go Show resolved Hide resolved
Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro merged commit 890bfea into vmware:main Oct 5, 2022
@adambarreiro adambarreiro deleted the fix-compute-policies branch October 5, 2022 09:21
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.

None yet

5 participants