-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ws): update JSON payload for listing workspaces #134
base: notebooks-v2
Are you sure you want to change the base?
Conversation
Signed-off-by: mohamedch7 <121046693+mohamedch7@users.noreply.github.com>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@mohamedch7 thank you so much for the contribution! I'll look it before end of the week. |
@mohamedch7 once we merge #137 (hopefully tomorrow) please rebase this PR so you get the new linting (and make sure your PR passes a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mohamedch7 thank you so much for the PR. I left some required changes for your PR.
Could you review all the fields according to:
https://github.com/thesuperzapper/kubeflow-notebooks-v2-design/blob/main/crds/workspace-kind.yaml
and https://github.com/thesuperzapper/kubeflow-notebooks-v2-design/blob/main/crds/workspace.yaml
Namespace: item.Namespace, | ||
WorkspaceKind: WorkspaceKind{ | ||
Name: item.Spec.Kind, | ||
Type: item.Spec.PodTemplate.Options.ImageConfig, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be POD_TEMPLATE.
https://github.com/thesuperzapper/kubeflow-notebooks-v2-design/blob/main/crds/workspace-kind.yaml#L51
StateMessage: item.Status.StateMessage, | ||
PodTemplate: PodTemplate{ | ||
PodMetadata: &PodMetadata{ | ||
Labels: item.Spec.PodTemplate.PodMetadata.Labels, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid nulls on those fields.
PodTemplate: PodTemplate{ | ||
PodMetadata: &PodMetadata{ | ||
Labels: item.Spec.PodTemplate.PodMetadata.Labels, | ||
Annotations: item.Spec.PodTemplate.PodMetadata.Annotations, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"labels": null,
"annotations": null
}, | ||
Volumes: &Volumes{ | ||
Home: &DataVolumeModel{ | ||
PvcName: item.Spec.PodTemplate.Volumes.Data[0].PVCName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Home is not Volumes.Data[0], but instead defined by kind:
the mount path is defined in the WorkspaceKind under
## spec.podTemplate.volumeMounts.home
MountPath: item.Spec.PodTemplate.Volumes.Data[0].MountPath, | ||
ReadOnly: *item.Spec.PodTemplate.Volumes.Data[0].ReadOnly, | ||
}, | ||
Data: dataVolumes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to don't list 'home' here.
}, | ||
PodConfig: &PodConfig{ | ||
Current: item.Spec.PodTemplate.Options.PodConfig, | ||
Desired: item.Spec.PodTemplate.Options.PodConfig, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be:
Pod Template Options:
Image Config:
Desired: jupyterlab_scipy_190
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(on status)
Also, make sure to rebase it to include the new linting etc. |
@mohamedch7 you should be able to rebase it to head of |
Fix: Update Workspace Model and JSON Payload Structure
This PR addresses issue #127 by refactoring the workspace model and adjusting the JSON payload structure to align with the updated API requirements.
Changes Made
Workspace Model Updates:
WorkspaceKind
,PodTemplate
,Activity
, andVolumes
.PodMetadata
,ImageConfig
,PodConfig
) for improved modularity.Handler Updates:
workspaces_handler_test.go
to validate the new model and payload structure.Repository Adjustments:
CreateWorkspace
method inworkspaces.go
to reflect the new model structure.Payload Adjustments:
Impact
Testing
workspaces_handler_test.go
updated to include new cases.