-
Notifications
You must be signed in to change notification settings - Fork 63
Add support for contributions through .spec.contributions
field in DevWorkspace
#939
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
Merged
amisevsk
merged 5 commits into
devfile:main
from
amisevsk:container-contributions-field
Oct 18, 2022
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0ae6ec5
Update devfile/api dependency to fe7c10e
amisevsk 80f5324
Regenerate bundle and deployment files to pull in new devfile/api dep…
amisevsk 0a88af7
Add support for .spec.contributions field in DevWorkspace
amisevsk bb56ba5
Add tests for .spec.contributions field in DevWorkspace
amisevsk 9dc8ca3
Add sample that uses .spec.contributions instead of plugins
amisevsk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
582 changes: 582 additions & 0 deletions
582
deploy/bundle/manifests/workspace.devfile.io_devworkspaces.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
851 changes: 851 additions & 0 deletions
851
...yment/kubernetes/objects/devworkspaces.workspace.devfile.io.CustomResourceDefinition.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
851 changes: 851 additions & 0 deletions
851
...oyment/openshift/objects/devworkspaces.workspace.devfile.io.CustomResourceDefinition.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
pkg/library/flatten/testdata/spec-contributions/adds-resources.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "Adds attributes from contribution" | ||
|
||
input: | ||
devworkspace: | ||
components: | ||
- name: test-component | ||
attributes: | ||
controller.devfile.io/merge-contribution: true | ||
container: | ||
image: test-image | ||
memoryLimit: 1Gi | ||
memoryRequest: 1000Mi | ||
cpuLimit: 1500m | ||
cpuRequest: "1" | ||
contributions: | ||
- name: test-contribution | ||
uri: test-contribution.yaml | ||
|
||
devfileResources: | ||
test-contribution.yaml: | ||
schemaVersion: 2.1.0 | ||
metadata: | ||
name: test-contribution | ||
components: | ||
- name: test-contribution | ||
attributes: | ||
controller.devfile.io/container-contribution: true | ||
container: | ||
image: contribution-image | ||
memoryLimit: 512Mi | ||
memoryRequest: 1.5G | ||
cpuLimit: "0.5" | ||
cpuRequest: 500m | ||
|
||
output: | ||
devworkspace: | ||
components: | ||
- name: test-component | ||
attributes: | ||
controller.devfile.io/merged-contributions: "test-contribution" | ||
container: | ||
image: test-image | ||
memoryLimit: 1536Mi | ||
memoryRequest: "2548576000" # 1.5G + 1000Mi = 1.5*1000^3 + 1000*1024^2 | ||
cpuLimit: "2" | ||
cpuRequest: 1500m |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't know the best practice for Go, but a small optional suggestion to put the initialization for
resolvedParent
andresolvedContent
here, so that it looks like: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.
Makes sense, thanks. Squashed change into earlier commit.