-
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
Hack 'n Hustle: command line tool to update a DevWorkspace #990
Comments
@l0rd I wanted to clarify about gotcha #2
Should only the attribute be kept? Or the entire component? For example, do we want the following behaviour? Given this devworkspace: Kind: Devworkspace
Spec:
Template:
Components:
- name: componentA
attributes:
controller.devfile.io/merge-contribution: true
- name: componentB
attributes:
controller.devfile.io/merge-contribution: true And this devfile: Kind: Devfile
Spec:
Components:
- name: ComponentB The resulting devworkspace: Kind: Devworkspace
Spec:
Template:
Components:
- name: componentB
attributes:
controller.devfile.io/merge-contribution: true Or do we want this behaviour: Given this devworkspace: Kind: Devworkspace
Spec:
Template:
Components:
- name: componentA
attributes:
controller.devfile.io/merge-contribution: true
- name: componentB
attributes:
controller.devfile.io/merge-contribution: true And this devfile: Kind: Devfile
Spec:
Components:
- name: ComponentB The resulting devworkspace ( Kind: Devworkspace
Spec:
Template:
Components:
- name: componentA
attributes:
controller.devfile.io/merge-contribution: true
- name: componentB
attributes:
controller.devfile.io/merge-contribution: true |
You should support DevWorkspaces with only one attribute |
@AObuchow I have updated the description: as we discussed |
Added in the description the reference to 2 issues that will simplify the devworkspace update: |
For future reference, this is the repo that came out of this task: https://github.com/AObuchow/DW-update |
Closing this issue as I was able to create a POC, and ultimately the devworkspace-generator was created for this purpose. |
The goal is to create a small command line utility that takes as input the path to a devfile.yaml file and the path to a devworkspace.yaml file. As a result it prints to stdout a DevWorkspace object, identical to the original one, but with the template replaced by the Devfile content (with a few gotchas).
$ dw-update --help Takes as input the path to a devfile.yaml file and the path to a devworkspace.yaml file and prints to stdout a DevWorkspace object, identical to the original one, but with the template replaced by the Devfile content (with a few gotchas). Usage: dw-update [options] Options: -d, --devfile=[]: The file that contains the new devfile that is going to be applied. -w, --devworkspace=[]: The file that contains the original DevWorksapce object, in YAML format.
The gotchas:
spec.template.projects
is not replaced (needed until Addproject
in DevWorkspace CRD spec and deprecateprojects
from the devfile spec eclipse-che/che#21188)controller.devfile.io/merge-contribution: true
attribute in the original DevWorkspacespec.template.components
should be kept even if not present in the devfile (needed until Implicitly setmerge-contribution:true
on first template component #993).The text was updated successfully, but these errors were encountered: