-
Notifications
You must be signed in to change notification settings - Fork 111
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
Make compatible with pack 0.3.0 #154
Conversation
c3fe218
to
160af39
Compare
6e07d44
to
58b8064
Compare
ea67f9e
to
9b65887
Compare
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.
Approved with some minor suggestions.
@@ -43,9 +44,16 @@ func main() { | |||
} | |||
|
|||
func detect() error { | |||
order, err := lifecycle.ReadOrder(orderPath) | |||
order, err := compat.ReadOrder(orderPath, buildpacksDir) |
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: should we read the new order format first and then fall back to the old format if the length is 0? It seems like that would be more in keeping with an "ident the error handling" philosophy
return order, nil | ||
} | ||
|
||
type buildpackTOML struct { |
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.
Do we need a compat definition of buildpackToml
and buildpack
, it looks like the differences between the definitions and the ones in lifecycle.go
and these are purely additive
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 am gonna assume this is for the sake of isolating the compat work in a package and avoiding import cycles.
} | ||
|
||
if len(matchVersions) > 1 { | ||
return "", errors.Errorf("too many buildpacks with matching ID '%s'", bpRef.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.
I think we should something specific about "latest" in this error message. Given that there is no requirement that only one version of a buildpack can exist on a builder and in contexts like --buildpack <id>
it might not be obvious what the issue is.
58b8064
to
a13fe0a
Compare
Signed-off-by: Andrew Meyer <ameyer@pivotal.io> Signed-off-by: Javier Romero <jromero@pivotal.io>
9b65887
to
ccb05b2
Compare
Signed-off-by: Andrew Meyer ameyer@pivotal.io
Added
compat
package that's pretty self-contained and can be easily removed when we no longer want this functionality.