Skip to content
Merged
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
20 changes: 20 additions & 0 deletions pkg/devfile/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,24 @@ type DevfileMetadata struct {
// Map of implementation-dependant free-form YAML attributes.
// +optional
Attributes attributes.Attributes `json:"attributes,omitempty"`

// Optional devfile display name
// +optional
DisplayName string `json:"displayName,omitempty"`

// Optional devfile description
// +optional
Description string `json:"description,omitempty"`

// Optional devfile tags
// +optional
Tags []string `json:"tags,omitempty"`

// Optional devfile icon
// +optional
Icon string `json:"icon,omitempty"`

// Optional devfile global memory limit
// +optional
GlobalMemoryLimit string `json:"globalMemoryLimit,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if GlobalMemoryLimit is needed (but I'm also not opposed to adding it). The story behind this field is that we needed a way to get the total memory required by a workspace, and this was hard to do from a very simple registry -- plugin memory requirements are stored in their own meta.yamls and can change arbitrarily while the devfile registry is running, and further the devfile itself can override the values set in the plugin. This field is manually set by the devfile author to smooth a use-case in Che, but the value here can drift apart from reality (if e.g. one of your plugins updates and starts using more memory).

I wonder if the new devfile registry could offer some metrics/calculation to get this number directly without user input?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for bringing that up, AFAIK currently the new devfile registry/OCI devfile registry doesn't provide a mechanism to directly get the number of global memory limit, so for the timing being, let's still add this field. Given this PR is only for purely migrating fields from meta.yaml, I think we can merge this PR for now, then open separate issue to discuss the existence of the specific field if it's needed as I think that may or may not bring more discussion and design.

}
23 changes: 23 additions & 0 deletions schemas/latest/devfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -1427,10 +1427,33 @@
"type": "object",
"additionalProperties": true
},
"description": {
"description": "Optional devfile description",
"type": "string"
},
"displayName": {
"description": "Optional devfile display name",
"type": "string"
},
"globalMemoryLimit": {
"description": "Optional devfile global memory limit",
"type": "string"
},
"icon": {
"description": "Optional devfile icon",
"type": "string"
},
"name": {
"description": "Optional devfile name",
"type": "string"
},
"tags": {
"description": "Optional devfile tags",
"type": "array",
"items": {
"type": "string"
}
},
"version": {
"description": "Optional semver-compatible version",
"type": "string",
Expand Down
28 changes: 28 additions & 0 deletions schemas/latest/ide-targeted/devfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -1580,11 +1580,39 @@
"additionalProperties": true,
"markdownDescription": "Map of implementation-dependant free-form YAML attributes."
},
"description": {
"description": "Optional devfile description",
"type": "string",
"markdownDescription": "Optional devfile description"
},
"displayName": {
"description": "Optional devfile display name",
"type": "string",
"markdownDescription": "Optional devfile display name"
},
"globalMemoryLimit": {
"description": "Optional devfile global memory limit",
"type": "string",
"markdownDescription": "Optional devfile global memory limit"
},
"icon": {
"description": "Optional devfile icon",
"type": "string",
"markdownDescription": "Optional devfile icon"
},
"name": {
"description": "Optional devfile name",
"type": "string",
"markdownDescription": "Optional devfile name"
},
"tags": {
"description": "Optional devfile tags",
"type": "array",
"items": {
"type": "string"
},
"markdownDescription": "Optional devfile tags"
},
"version": {
"description": "Optional semver-compatible version",
"type": "string",
Expand Down