-
Notifications
You must be signed in to change notification settings - Fork 54
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
Init containers #188
Init containers #188
Conversation
f4fa29c
to
690c15b
Compare
862337e
to
f4466a3
Compare
e01b19f
to
52854ef
Compare
pkg/library/command.go
Outdated
return &command, nil | ||
} | ||
} | ||
return nil, fmt.Errorf("no command with key %s is defined", id) |
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.
In the future I assume that these rules should be implemented in the validation
package of the devfile/api
repo.
As soon as we have something working here, we should sync with other teams to move this into the common validation
code.
continue | ||
default: | ||
// How a prestart exec command should be implemented is undefined currently, so we reject it. | ||
return fmt.Errorf("only apply-type commands are supported in the prestart lifecycle binding") |
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.
In the future I assume that these rules should be implemented in the validation
package of the devfile/api
repo.
As soon as we have something working here, we should sync with other teams to move this into the common validation
code.
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
Nothing to comment apart of minor Key vs ID
or id -> ID
stuff
Here is a commit with changes you may consider to apply f985c57
I've made them just to understand code better.
f4466a3
to
fe87976
Compare
Add basic library function that will extract initContainers from a devfile based on commands and events. Signed-off-by: Angel Misevski <[email protected]>
Signed-off-by: Angel Misevski <[email protected]>
Signed-off-by: Angel Misevski <[email protected]>
52854ef
to
653fd43
Compare
@amisevsk: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
As suggested by David, do not support preStart Exec-type commands in devfiles and instead return an error. Signed-off-by: Angel Misevski <[email protected]>
Previous yaml package gopkg.in/yaml.v2 does not support json tags on fields. Switch to a yaml package that can correctly serialize/deserialize devfile/api objects. Signed-off-by: Angel Misevski <[email protected]>
653fd43
to
da49150
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amisevsk, davidfestal, JPinkney, sleshchenko 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 |
What does this PR do?
Add basic functionality for separating out initContainers from regular components in a devfile, based on the rules defined in devfile/api#32
What issues does this PR fix or reference?
Resolves #183, except code is not used anywhere yet -- it's not clear how to support this with subresources, as the process requires reading the whole devfile. Final implementation will require changing the internal API.
Is it tested? How?
Test cases are written but it is just library code for now.
Additional Info
This PR is targetting the
update-sdk-1.x
branch used in PR #187, since otherwise there will be some hassle in rebasing.