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 to the Runtime Defined Entities (RDE) framework with Defined Interfaces (1/3) #527

Merged
merged 22 commits into from
Feb 23, 2023

Conversation

adambarreiro
Copy link
Collaborator

@adambarreiro adambarreiro commented Nov 29, 2022

Overview

This PR implements the foundations to onboard the RDE framework to the Terraform VCD Provider, by adding CRUD capabilities of Defined Interfaces.

Detailed description

This PR adds the following features:

  • Adds the following new methods to the generic VCDClient:
    • CreateDefinedInterface to create a Defined Interface.
    • GetAllDefinedInterfaces to get all Defined Interfaces, supports parameters like filtering.
    • GetDefinedInterface gets a Defined Interface with its vendor+nss+version combination which is unique.
    • GetDefinedInterfaceById gets a Defined Interface with its URN, which is a combination of its vendor+nss+version underneath.
  • Adds the following methods to the new DefinedInterface type:
    • Update updates a Defined Interface with the given input. At the moment, only the name can be updated. If other parameters are set, they are simply ignored.
    • Update deletes a Defined Interface. The interface can't be deleted if it's referenced by some RDE type.

Tests

The test in defined_interface_test.go checks the behaviour for both a System administrator and a tenant user.
While System admins have access to all CRUD methods, tenant users can only read Defined Interfaces. This characteristic is tested.

Found quirks

  • Added the function amendDefinedInterfaceError to amend a bug in VCD ≤ v10.3.0 that causes GET calls to return a 400 instead of a 403 when the Defined Entity does not exist. This bug seems fixed in versions higher than 10.3.0. For example, in VCD 10.3.1 I cannot reproduce it even if the request is done with v36.0.

@adambarreiro adambarreiro changed the title Add support to Runtime Defined Entities (RDE) with CRUD methods Add support to the Runtime Defined Entities (RDE) framework Jan 12, 2023
@adambarreiro adambarreiro changed the title Add support to the Runtime Defined Entities (RDE) framework Add support to the Runtime Defined Entities (RDE) framework with Defined Interfaces (1/3) Jan 25, 2023
@adambarreiro adambarreiro self-assigned this Jan 25, 2023
abarreiro added 3 commits January 25, 2023 10:22
#
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
abarreiro added 4 commits January 25, 2023 10:50
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
@adambarreiro adambarreiro marked this pull request as ready for review January 26, 2023 14:41
@adambarreiro adambarreiro requested a review from adezxc January 26, 2023 14:42
abarreiro added 4 commits January 26, 2023 15:46
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[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.

A few tiny ones. And just a check on API elevation makes any sense. I am good in general. Will approve both after checking out in Terraform PR

Signed-off-by: abarreiro <[email protected]>
abarreiro added 7 commits January 31, 2023 12:30
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
@adambarreiro adambarreiro merged commit 687a663 into vmware:main Feb 23, 2023
@adambarreiro adambarreiro deleted the add-rde-support branch February 23, 2023 08:34
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.

6 participants