-
Notifications
You must be signed in to change notification settings - Fork 55
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
configurable default Workspace Spec Template #867
Conversation
Currently, |
The fuzzer seems to be panicking on |
pkg/library/workspace/helper.go
Outdated
// limitations under the License. | ||
// | ||
|
||
package workspace |
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.
I'm not really sure about this package name or file name...
We already have /pkg/controllers/workspace
and there's also another file called helper.go
for the flatten package.
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.
Why not name the package e.g. defaults or workspacedefaults
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.
I went with defaults as it seems more generic/could potentially be reused more easily in the future. However, I'm not yet sure about the filename helper.go
, maybe it should just be called workspace.go
?
This was fixed with |
c42f8e5
to
d6f87b6
Compare
pkg/library/workspace/helper.go
Outdated
// limitations under the License. | ||
// | ||
|
||
package workspace |
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.
Why not name the package e.g. defaults or workspacedefaults
d6f87b6
to
2439266
Compare
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.
LGTM, still need to test it (tomorrow)
2439266
to
630ef81
Compare
Sounds good :) I just rebased the PR |
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.
Tested on OpenShift and it works like a charm 👍
Well done!
Don't forget to squash the commits down to something tidy and make sure all commits have signoff -- tests will need to be re-run once this is done. /ok-to-test |
Fix devfile#853 Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
Part of devfile#853 Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
630ef81
to
41c8db7
Compare
@@ -80,6 +80,1278 @@ spec: | |||
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ | |||
x-kubernetes-int-or-string: true | |||
type: object | |||
defaultTemplate: |
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.
@AObuchow could you please clarify if the spec for defaultTemplate
was created from scratch?
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 was automatically created with make generate manifests fmt generate_default_deployment generate_olm_bundle_yaml
. The reason it is so large is because of all the fields contained within the DevWorkspaceTemplateSpecContent
struct
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.
great job 👍
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amisevsk, AObuchow, ibuziuk The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR adds a new CRD configuration option
defaultTemplate
to DWO. The configuration option takes in aDevWorkspaceTemplateSpecContent
which gets applied to the workspace's devfile if the devfile does not define any components. Currently, theDevWorkspaceTemplateSpecContent
will overwrite the devfile's existing template spec but keep the existing projects (if they were defined).What issues does this PR fix or reference?
Fix #853
Is it tested? How?
kubectl edit dwoc -n $NAMESPACE
defaultTemplate
to the workspace attribute:The resulting DWO configuration should ressemble something like the following:
kubectl apply -f minimal_devfile.yaml -n $NAMESPACE
$: kubectl get devworkspace -n $NAMESPACE NAME DEVWORKSPACE ID PHASE INFO minimal workspace7dab320bcbd64672 Running https://workspace7dab320bcbd64672-theia-3100.192.168.39.217.nip.io/
web-nodejs-sample
projectPR Checklist
/test v8-devworkspace-operator-e2e, v8-che-happy-path
to trigger)v8-devworkspace-operator-e2e
: DevWorkspace e2e testv8-che-happy-path
: Happy path for verification integration with Che