-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Exposes compose loader.Transform
function…
#1244
Conversation
02c234e
to
4e60601
Compare
4e60601
to
ebe2821
Compare
Codecov Report
@@ Coverage Diff @@
## master #1244 +/- ##
==========================================
- Coverage 54.23% 54.23% -0.01%
==========================================
Files 268 268
Lines 17807 17809 +2
==========================================
Hits 9658 9658
- Misses 7542 7543 +1
- Partials 607 608 +1 |
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
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, but found a typo; I'll leave it to you to decide if you want to update or merge as-is 👍
cli/compose/loader/loader.go
Outdated
@@ -265,11 +265,13 @@ func getServices(configDict map[string]interface{}) map[string]interface{} { | |||
return map[string]interface{}{} | |||
} | |||
|
|||
func transform(source map[string]interface{}, target interface{}) error { | |||
// Transform convert the source map into the target struct with compose types transformer |
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.
nit: s/convert/converts/
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'll fix 😉
This should make it easier for people to write custom composefile parser without duplicating too much code. It takes the default transformers and any additional number of transformer for any types. That way it's possible to transform a `cli/compose` map into a custom type that would use some of `cli/compose` types and its own. Signed-off-by: Vincent Demeester <[email protected]>
ebe2821
to
0246bc1
Compare
This should make it easier for people to write custom composefile
parser without duplicating too much code. It takes the default
transformers and any additional number of transformer for any
types. That way it's possible to transform a
cli/compose
map into acustom type that would use some of
cli/compose
types and its own.Really useful to remove some duplication in
docker/app
👼 🙏Signed-off-by: Vincent Demeester [email protected]