Skip to content

Commit

Permalink
apis: update Device CRD fields
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Liu <jasonliu747@gmail.com>
  • Loading branch information
jasonliu747 committed Aug 30, 2022
1 parent e3bccb0 commit 1c0c9a5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 25 deletions.
16 changes: 8 additions & 8 deletions apis/scheduling/v1alpha1/device_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
)

type DeviceSpec struct {
Devices []DeviceInfo `json:"devices"`
Devices []DeviceInfo `json:"devices,omitempty"`
}

type DeviceInfo struct {
Expand All @@ -47,19 +47,19 @@ type DeviceInfo struct {
}

type DeviceStatus struct {
Allocations []DeviceAllocation `json:"allocations"`
Allocations []DeviceAllocation `json:"allocations,omitempty"`
}

type DeviceAllocation struct {
Type DeviceType `json:"type"`
Entries []DeviceAllocationItem `json:"entries"`
Type DeviceType `json:"type,omitempty"`
Entries []DeviceAllocationItem `json:"entries,omitempty"`
}

type DeviceAllocationItem struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
UUID string `json:"uuid"`
Devices []string `json:"devices"`
Name string `json:"name,omitempty"`
Namespace string `json:"namespace,omitempty"`
UUID string `json:"uuid,omitempty"`
Minors []int32 `json:"minors,omitempty"`
}

// +genclient
Expand Down
6 changes: 3 additions & 3 deletions apis/scheduling/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 3 additions & 14 deletions config/crd/bases/scheduling.koordinator.sh_devices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ spec:
type: string
type: object
type: array
required:
- devices
type: object
status:
properties:
Expand All @@ -73,32 +71,23 @@ spec:
entries:
items:
properties:
devices:
minors:
items:
type: string
format: int32
type: integer
type: array
name:
type: string
namespace:
type: string
uuid:
type: string
required:
- devices
- name
- namespace
- uuid
type: object
type: array
type:
type: string
required:
- entries
- type
type: object
type: array
required:
- allocations
type: object
type: object
served: true
Expand Down

0 comments on commit 1c0c9a5

Please sign in to comment.