-
Notifications
You must be signed in to change notification settings - Fork 112
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 Behavior support to RDE Interfaces and RDE Types #1074
Conversation
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>
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>
Signed-off-by: abarreiro <abarreiro@vmware.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😵💫
At first sight I don't have much to complain, but this is so meta that I will make another review attempt later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome PR! Only few suggestions for docs.
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, as Dainius said this is very meta, we might need a refresher on RDEs once again :D
Signed-off-by: abarreiro <abarreiro@vmware.com>
Overview
This PR complements #965, #973 and #977 as it adds support to create, read, update and delete Behaviors, both in RDE Interfaces and Types.
This PR requires vmware/go-vcloud-director#584.
Context
Behaviors are explained here, but in simplified words, they're "procedures" that belong to RDE Interfaces, are inherited by the RDE Types that use those Interfaces and are invoked on the RDEs that instantiate those types.
Also, Behaviors can be overridden at the RDE Type level. For example, if you use a RDE Interface with behavior "A", you can override what it does in a Type that uses it.
Last but not least, RDE Type Behaviors have "Access Levels", which can define what operations can be done in that behavior.
Description
This PR adds 3 new resources and 3 new data sources:
vcd_rde_interface_behavior
resource to manage RDE Interface Behaviors, which can be invoked by RDEs and overridden by RDE Types.vcd_rde_interface_behavior
data source to read RDE Interface Behaviors, so they can be usedin RDE Type Behavior overrides.
vcd_rde_type_behavior
resource to manage Behaviors in RDE Types, which can override those definedin RDE Interfaces.
vcd_rde_type_behavior
data source to read RDE Type Behaviors.vcd_rde_type_behavior_acl
resource to manage the access to Behaviors in RDE Types and RDE Interfacesvcd_rde_type_behavior_acl
data source to read Access Levels from Behaviors of RDE Types and RDE InterfacesCaveats
Behaviors of a RDE Interface must be created before any RDE Type that uses that Interface is created. For that reason, if one uses
vcd_rde_interface_behavior
, she must be sure that thevcd_rde_type
resources wait for the behaviors to be created with adepends_on
. This is explained invcd_rde_type
resource andvcd_rde_interface_behavior
resource documentation.vcd_rde_type_behavior_acl
could have been a Set insidevcd_rde_type_behavior
but it has some peculiar features that made it not possible:This PR does not implement RDE Type
Hooks
. As one Hook is a map of keysPostCreate
,PostUpdate
,PreDelete
andPostDelete
and values , I believe the best option is yet another resource, otherwise we'd have a circular dependency RDE Type (needs behavior IDs) <-> RDE Type Behavior (needs RDE Type IDs). Probably I'll do in a separate PR