Skip to content

Commit

Permalink
fixup! DRA: new API for 1.31
Browse files Browse the repository at this point in the history
Capacity is now a map from string to resource.Quantity.
  • Loading branch information
pohly committed Jul 8, 2024
1 parent cc07aa2 commit d273800
Show file tree
Hide file tree
Showing 17 changed files with 199 additions and 594 deletions.
12 changes: 1 addition & 11 deletions api/openapi-spec/swagger.json

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

21 changes: 1 addition & 20 deletions api/openapi-spec/v3/apis__resource.k8s.io__v1alpha3_openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,7 @@
},
"capacity": {
"additionalProperties": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.resource.v1alpha3.DeviceCapacity"
}
],
"default": {}
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"
},
"description": "Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.",
"type": "object"
Expand Down Expand Up @@ -265,20 +260,6 @@
},
"type": "object"
},
"io.k8s.api.resource.v1alpha3.DeviceCapacity": {
"description": "DeviceCapacity must have exactly one field set.",
"properties": {
"quantity": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.api.resource.Quantity"
}
],
"description": "Quantity determines the size of the capacity."
}
},
"type": "object"
},
"io.k8s.api.resource.v1alpha3.DeviceClaim": {
"description": "DeviceClaim defines how to request devices with a ResourceClaim.",
"properties": {
Expand Down
10 changes: 1 addition & 9 deletions pkg/apis/resource/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ type Device struct {
// The maximum number of attributes and capacities combined is 32.
//
// +optional
Capacity map[QualifiedName]DeviceCapacity
Capacity map[QualifiedName]resource.Quantity
}

// Limit for the sum of the number of entries in both ResourceSlices.
Expand Down Expand Up @@ -255,14 +255,6 @@ type DeviceAttribute struct {
VersionValue *string
}

// DeviceCapacity must have exactly one field set.
type DeviceCapacity struct {
// Quantity determines the size of the capacity.
//
// +optional
Quantity *resource.Quantity
}

// DeviceAttributeMaxValueLength is the maximum length of a string or version attribute value.
const DeviceAttributeMaxValueLength = 64

Expand Down
34 changes: 2 additions & 32 deletions pkg/apis/resource/v1alpha3/zz_generated.conversion.go

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

26 changes: 3 additions & 23 deletions pkg/apis/resource/zz_generated.deepcopy.go

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

27 changes: 2 additions & 25 deletions pkg/generated/openapi/zz_generated.openapi.go

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

Loading

0 comments on commit d273800

Please sign in to comment.