Skip to content
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

kiln API refactor #81

Merged
merged 2 commits into from
Jan 26, 2017
Merged

kiln API refactor #81

merged 2 commits into from
Jan 26, 2017

Conversation

noahdietz
Copy link
Contributor

Fixes #74

  • adds variable runtime selection through the parsing of a parameter into a corresponding supported base image. only node is currently supported

  • fix tests (commented out the ECS due to credential problems. will get resolved soon).

* adds support for variable base image based on runtime selection
* fixes test cases (commented out ECS tests due to credential issues)
func DetermineBaseImage(runtimeSelection string) (baseImage string, err error) {
runtimeSplit := strings.Split(runtimeSelection, ":")

switch runtimeSplit[0] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could turn this into a RuntimeMap or something where we map runtime values to a known base image?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the same idea, to use a map to store the supported runtimes, but I wasn't sure how much more effective that would be than this given we would still need to manually update the map, and also possibly concat the base image with the desired version (i.e. node:4, node:5.1.2, java:7) as is done here. It is something to explore, and if my mental model is off-base or you had another perspective, let me know.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get you. I wouldn't map each {runtime}:{version}, just each {runtime} to a base image.

Copy link
Contributor

@whitlockjc whitlockjc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. My one comment was more of an idea on how we might simplify this later.

@noahdietz noahdietz merged commit 8047b1a into master Jan 26, 2017
@noahdietz noahdietz deleted the issue-74 branch January 26, 2017 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor APIs
2 participants