Skip to content

Commit

Permalink
[ui] Create/Delete volumes (#7029)
Browse files Browse the repository at this point in the history
* [api/devstate] Add volumes to Devfile content

* Add Volume related endpoints to API

* Create/Delete volumes from the Volumes Tab

* Update UI static files

* API Devstate returns VolumeMounts

* Display volume mounts in containers

* [api] Add VolumeMounts to containers

* [ui] Define container's volume mounts

* [ui] e2e  tests

* Update UI static files

* [ui] create volumes from container / exec command creation

* Update UI static files

* Update container display

* Update UI static files

* Regenerate UI static files
  • Loading branch information
feloy authored Aug 21, 2023
1 parent fcc1cd8 commit edf0bf3
Show file tree
Hide file tree
Showing 54 changed files with 1,596 additions and 152 deletions.
131 changes: 131 additions & 0 deletions ododevapispec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,11 @@ paths:
cpuLimit:
description: CPU limit for the deployed container
type: string
volumeMounts:
description: Volume to mount into the container filesystem
type: array
items:
$ref: '#/components/schemas/VolumeMount'
responses:
'200':
description: container was successfully added to the devfile
Expand Down Expand Up @@ -813,6 +818,101 @@ paths:
example:
message: "Error deleting the resource"

/devstate/volume:
post:
tags:
- devstate
description: Add a new Volume to the Devfile
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
description: Name of the volume
type: string
size:
description: Minimal size of the volume
type: string
ephemeral:
description: True if the Volume is Ephemeral
type: boolean
responses:
'200':
description: volume was successfully added to the devfile
content:
application/json:
schema:
$ref: '#/components/schemas/DevfileContent'
example:
{
"content": "schemaVersion: 2.2.0\n",
"commands": [],
"containers": [],
"images": [],
"resources": [],
"events": {
"preStart": null,
"postStart": null,
"preStop": null,
"postStop": null
},
"metadata": {
"name": "",
"version": "",
"displayName": "",
description": "",
"tags": "",
"architectures": "",
"icon": "",
"globalMemoryLimit": "",
"projectType": "",
"language": "",
"website": "",
"provider": "",
"supportUrl": ""
}
}
'500':
description: Error adding the volume
content:
application/json:
schema:
$ref: '#/components/schemas/GeneralError'
example:
message: "Error adding the volume"

/devstate/volume/{volumeName}:
delete:
tags:
- devstate
description: "Delete a volume from the Devfile"
parameters:
- name: volumeName
in: path
description: Volume name to delete
required: true
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/GeneralSuccess'
example:
message: "Volume has been deleted"
description: "Volume has been deleted"
'500':
description: Error deleting the volume
content:
application/json:
schema:
$ref: '#/components/schemas/GeneralError'
example:
message: "Error deleting the volume"

/devstate/applyCommand:
post:
tags:
Expand Down Expand Up @@ -1315,6 +1415,7 @@ components:
- containers
- images
- resources
- volumes
- events
- metadata
properties:
Expand All @@ -1336,6 +1437,10 @@ components:
type: array
items:
$ref: '#/components/schemas/Resource'
volumes:
type: array
items:
$ref: '#/components/schemas/Volume'
events:
$ref: '#/components/schemas/Events'
metadata:
Expand Down Expand Up @@ -1416,6 +1521,7 @@ components:
- memoryLimit
- cpuRequest
- cpuLimit
- volumeMounts
properties:
name:
type: string
Expand All @@ -1437,6 +1543,20 @@ components:
type: string
cpuLimit:
type: string
volumeMounts:
type: array
items:
$ref: '#/components/schemas/VolumeMount'
VolumeMount:
type: object
required:
- name
- path
properties:
name:
type: string
path:
type: string
Image:
type: object
required:
Expand Down Expand Up @@ -1472,6 +1592,17 @@ components:
type: string
uri:
type: string
Volume:
type: object
required:
- name
properties:
name:
type: string
ephemeral:
type: boolean
size:
type: string
Events:
type: object
properties:
Expand Down
3 changes: 3 additions & 0 deletions pkg/apiserver-gen/.openapi-generator/FILES

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

4 changes: 4 additions & 0 deletions pkg/apiserver-gen/go/api.go

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

51 changes: 51 additions & 0 deletions pkg/apiserver-gen/go/api_devstate.go

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

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

39 changes: 39 additions & 0 deletions pkg/apiserver-gen/go/model__devstate_volume_post_request.go

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

8 changes: 8 additions & 0 deletions pkg/apiserver-gen/go/model_container.go

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

8 changes: 8 additions & 0 deletions pkg/apiserver-gen/go/model_devfile_content.go

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

Loading

0 comments on commit edf0bf3

Please sign in to comment.