Skip to content

Commit

Permalink
test requires as an array
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch committed May 8, 2024
1 parent b4da819 commit cadb71e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions pkg/nextgen/v1/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
"type": "object",
"required": ["type"],
"properties": {
"type": {"enum": ["node"]},
"type": {"type": "string"},
"count": {"type": "integer", "minimum": 1},
"requires": {
"type": "object",
"type": "array",
"items": {"type": "object"}
},
"attributes": {"$ref": "#/definitions/attributes"},
Expand Down
26 changes: 13 additions & 13 deletions pkg/nextgen/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ var (

// The JobSpec is what the user writes to describe their work
type Jobspec struct {
Version int `json:"version" yaml:"version"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Resources Resources `json:"resources,omitempty" yaml:"resources,omitempty"`
Tasks Tasks `json:"tasks,omitempty" yaml:"tasks,omitempty"`
Groups Groups `json:"groups,omitempty" yaml:"groups,omitempty"`
Requires map[string]Requires `json:"requires,omitempty" yaml:"requires,omitempty"`
Version int `json:"version" yaml:"version"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Resources Resources `json:"resources,omitempty" yaml:"resources,omitempty"`
Tasks Tasks `json:"tasks,omitempty" yaml:"tasks,omitempty"`
Groups Groups `json:"groups,omitempty" yaml:"groups,omitempty"`
Requires []Requires `json:"requires,omitempty" yaml:"requires,omitempty"`
}

type Environment map[string]string
type Resources map[string]Resource
type Requires map[string]map[string]string
type Requires map[string]string
type Tasks []Task
type Groups []Group

type Task struct {
Group string `json:"group,omitempty" yaml:"group,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Replicas int `json:"replicas,omitempty" yaml:"replicas,omitempty"`
Resources string `json:"resources,omitempty" yaml:"resources,omitempty"`
Command []string `json:"command,omitempty" yaml:"command,omitempty"`
Requires map[string]Requires `json:"requires,omitempty" yaml:"requires,omitempty"`
Group string `json:"group,omitempty" yaml:"group,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Replicas int `json:"replicas,omitempty" yaml:"replicas,omitempty"`
Resources string `json:"resources,omitempty" yaml:"resources,omitempty"`
Command []string `json:"command,omitempty" yaml:"command,omitempty"`
Requires []Requires `json:"requires,omitempty" yaml:"requires,omitempty"`
}

type Group struct {
Expand Down

0 comments on commit cadb71e

Please sign in to comment.