-
Notifications
You must be signed in to change notification settings - Fork 37
feat: includeTopologies #254
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,15 +133,21 @@ components: | |
| example: [email protected] | ||
| Topology: | ||
| type: object | ||
| required: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to require one of nodes or includeTopologies? |
||
| - nodes | ||
| properties: | ||
| nodes: | ||
| type: array | ||
| items: | ||
| oneOf: | ||
| - $ref: '#/components/schemas/minimega_node' | ||
| - $ref: '#/components/schemas/external_node' | ||
| includeTopologies: | ||
| type: array | ||
| items: | ||
| type: string | ||
| description: Array of topology file paths or store names to include | ||
| example: | ||
| - /phenix/topologies/base-topology.yml | ||
| - common-nodes | ||
| Scenario: | ||
| type: object | ||
| required: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,8 @@ import ( | |
| ) | ||
|
|
||
| type TopologySpec struct { | ||
| NodesF []*Node `json:"nodes" yaml:"nodes" structs:"nodes" mapstructure:"nodes"` | ||
| NodesF []*Node `json:"nodes" yaml:"nodes" structs:"nodes" mapstructure:"nodes"` | ||
| IncludeTopologiesF []string `json:"includeTopologies,omitempty" yaml:"includeTopologies,omitempty" structs:"includeTopologies,omitempty" mapstructure:"includeTopologies"` | ||
| } | ||
|
|
||
| func (this *TopologySpec) Nodes() []ifaces.NodeSpec { | ||
|
|
@@ -25,6 +26,14 @@ func (this *TopologySpec) Nodes() []ifaces.NodeSpec { | |
| return nodes | ||
| } | ||
|
|
||
| func (this *TopologySpec) IncludeTopologies() []string { | ||
| if this == nil { | ||
| return nil | ||
| } | ||
|
|
||
| return this.IncludeTopologiesF | ||
| } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure if this function is useful. Should I add it to the interface (and return nil for v0 topology) ? |
||
|
|
||
| func (this *TopologySpec) BootableNodes() []ifaces.NodeSpec { | ||
| if this == nil { | ||
| return nil | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,15 +134,21 @@ components: | |
| example: [email protected] | ||
| Topology: | ||
| type: object | ||
| required: | ||
| - nodes | ||
| properties: | ||
| nodes: | ||
| type: array | ||
| items: | ||
| oneOf: | ||
| - $ref: '#/components/schemas/minimega_node' | ||
| - $ref: '#/components/schemas/external_node' | ||
| includeTopologies: | ||
| type: array | ||
| items: | ||
| type: string | ||
| description: Array of topology file paths or store names to include | ||
| example: | ||
| - /phenix/topologies/base-topology.yml | ||
| - common-nodes | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. have to add this to the v2 spec, even though there is no v2 topology. |
||
| Scenario: | ||
| type: object | ||
| nullable: true | ||
|
|
||
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.
unsure if doing this here is the right way to do it