Skip to content

Commit

Permalink
refactor(client)!: support new server resources format (#1825)
Browse files Browse the repository at this point in the history
* Support the new response format for the server resources returned by the `GET /servers` API

BREAKING CHANGE: requires renku-notebooks >= v1.8.0

fix #1791
  • Loading branch information
lorenzo-cavazzi authored Jun 13, 2022
1 parent b6ee7c5 commit acb5c16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions client/src/notebooks/Notebooks.present.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function SessionInformation(props) {

const annotations = NotebooksHelper.cleanAnnotations(notebook.data.annotations, "renku.io");
const url = notebook.data.url;
const resources = formatResources(notebook.data.resources);
const resources = formatResources(notebook.data.resources?.requests);

const repositoryLinks = {
branch: `${annotations["repository"]}/tree/${annotations["branch"]}`,
Expand Down Expand Up @@ -504,7 +504,7 @@ class NotebookServersList extends Component {
const validAnnotations = Object.keys(this.props.servers[k].annotations)
.filter(key => key.startsWith("renku.io"))
.reduce((obj, key) => { obj[key] = this.props.servers[k].annotations[key]; return obj; }, {});
const resources = this.props.servers[k].resources;
const resources = this.props.servers[k].resources?.requests;
const startTime = Time.toIsoTimezoneString(this.props.servers[k].started, "datetime-short");

return (<NotebookServerRow
Expand Down
9 changes: 6 additions & 3 deletions e2e/cypress/fixtures/sessions/sessions.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
"image":"registry.dev.renku.ch/e2e/local-test-project:172a784",
"name":"e2e-40renk-local-2dtest-2dproject-84756d7d",
"resources":{
"cpu":"0.5",
"memory":"1G",
"storage":"1G"
"requests": {
"cpu":"0.5",
"memory":"1G",
"storage":"1G"
},
"usage": {}
},
"started":"2022-02-28T14:15:59+00:00",
"state":{
Expand Down

0 comments on commit acb5c16

Please sign in to comment.