fabric8-services / che-tenant-maintainer Goto Github PK
View Code? Open in Web Editor NEWTool and associated rest endpoint to migrate Che workspace metadata from single-tenant to multi-tenant server
License: Apache License 2.0
Tool and associated rest endpoint to migrate Che workspace metadata from single-tenant to multi-tenant server
License: Apache License 2.0
Need to add endpoint for cleanup workspaces that have been running for more than fixed period of time. Basically, endpoint should be able to get all the running workspace pods in the user namespace and delete all openshift resources related to the workspace (oc delete all -l che.workspace_id
) if workspace pod is running for more than fixed period of time (by default 1 day, but it would be great to make it configurable via parameter). The only obligatory parameter would be identity_id
passed via X-Identity-Id
header. oso-proxy
is going to be used as masterUrl
and with Che SA Token [1] for all openshift related operations.
1 - Create a new space in OSIO prod-preview
1a - choose create new codebase,
1b - select sprint boot, REST API, select build pipeline
1c- once create go to open workspace to make sure the workspace is correctly initialized.
2 - Following instructions given by David @davidfestal in as per HK issue to clean workspace, the steps as followed:
2a - login to prod-preview with:
oc login https://api.dsaas-stg.openshift.com —token=XXX
2b - Get pod name for che-tenant-maintainer from dssas preview and port forward:
oc port-forward che-tenant-maintainer-3-ldkgn 8080
2c - Call the API with OSIO prod-preview token of the user to delete + username in headers:
curl -X POST -d "@curl_clean_workspaces.txt" http://localhost:8080/cleanWorkspaces -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" -H "X-User-Namespace: ckrych-preview-che" -verbose
{"code":0,"message":"","details":"should remove workspace7bx5hsjf2wybyr9k\nshould remove workspacels2b15013jxefd2b\n”}
with curl_clean_workspaces.txt:
{
"delete-all-workspaces": "true",
"debug-logs": "true"
}
got a 200 with this error:
{"code":1,"message":"Failure during cleaning of workspace files: Command failed with the following code: 1 and termination message: rm: cannot remove '/pvroot/workspacemynwdmj476xfysuh/projects': Permission denied\nrm: cannot remove '/pvroot/workspacemynwdmj476xfysuh/che-logs/dev-machine': Permission denied\n","details":"removing workspacemynwdmj476xfysuh\n"}
when looking at https://che.prod-preview.openshift.io/dashboard/#/workspaces no workspace is displayed (it looks like it was deleted).
Expected: No error displayed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.