Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions cmd/scaffold-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ func main() {
}

if len(fields.RequiredCreateDependencies) == 0 {
answer := getUserInput("Does this resource have required dependencies upon creation? "+
"List all the resources it must depend on. "+
"Provide this as a comma-separated list, for example: Subnet, Port, Project", interactive)
answer := getUserInput("Does this resource have **required** dependencies upon creation? "+
"List all the resources it **must** depend on, if any. "+
"Provide this as a comma-separated list or omit if there are no dependencies. "+
"For example: Subnet, Port, Project", interactive)
dependencies := strings.Split(answer, ",")
for _, dep := range dependencies {
trimmedDep := strings.TrimSpace(dep)
Expand All @@ -153,9 +154,10 @@ func main() {
}

if len(fields.OptionalCreateDependencies) == 0 {
answer := getUserInput("Does this resource have optional dependencies upon creation? "+
"List all the resources it optionally depend on. "+
"Provide this as a comma-separated list, for example: Subnet, Port, Project", interactive)
answer := getUserInput("Does this resource have **optional** dependencies upon creation? "+
"List all the resources it **optionally** depends on, if any. "+
"Provide this as a comma-separated list or omit if there are no dependencies. "+
"For example: Subnet, Port, Project", interactive)
dependencies := strings.Split(answer, ",")
for _, dep := range dependencies {
trimmedDep := strings.TrimSpace(dep)
Expand All @@ -168,7 +170,8 @@ func main() {
if len(fields.ImportDependencies) == 0 {
answer := getUserInput("Does this resource have dependencies upon import? "+
"List all the resources it can depend on. "+
"Provide this as a comma-separated list, for example: Subnet, Port, Project", interactive)
"Provide this as a comma-separated list or omit if there are no dependencies. "+
"For example: Subnet, Port, Project", interactive)
dependencies := strings.Split(answer, ",")
for _, dep := range dependencies {
trimmedDep := strings.TrimSpace(dep)
Expand Down
6 changes: 1 addition & 5 deletions website/docs/development/controller-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ Dependencies are at the core of what ORC does. At the lowest level ORC performs
* As soon as possible
* In parallel if possible

It achieves this through dependency management.

!!! note

ORC dependencies can *only* be expressed between ORC objects. Therefore if one OpenStack resource depends on another, that relationship can only be expressed in ORC if both resources have corresponding ORC objects. Resoruces which a user may depend on but cannot create, like a flavor or a provider network, can be expressed by importing an existing resource.
ORC achieves this through dependency management. OpenStack doesn't have the concept of resource dependencies natively, so ORC expresses dependencies through ORC objects, not their underlying OpenStack resources. Resources that a user can create and may be depended on, like a server group or image, are expressed as *create dependencies*, while resources that the user cannot create but may be depended on, like a flavor or provider network, are expressed *import dependencies*.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unfortunately, I don't think the proposed change brings clarity. I agree the doc needed a rewrite, but the modification makes it more confusing to me.

This paragraph aim to say that resources must be known to ORC if you want to express dependency. The way you have your openstack resource known to ORC is either via:

  • a managed resource, where ORC has ownership over its lifecycle. The object will have managementPolicy: managed and a resource spec.
  • an unmanaged resource, that ORC has read only access to. The object will have managementPolicy: unmanaged and an import filter. This is to import existing resources into ORC.

They both have can have create dependencies (i.e. upon object creation), and they behave exactly the same, meaning that the resource won't be created or imported until the dependency is satisfied: when the referenced ORC object exists and is considered available. The only difference is that one will have the dependency expressed in the resource spec, while the other one will have the dependency expressed in the import filter.


A dependency is used anywhere that the controller must reference another object to complete an action. The dependency has features that enable us to:

Expand Down