-
Notifications
You must be signed in to change notification settings - Fork 18
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
Dependency mappings #4
Conversation
This allows users in an airgapped environment or an environment with restrictive firewall rules to map dependencies to new URIs that are accessible from the build environment Signed-off-by: Emily Casey <[email protected]>
Signed-off-by: Emily Casey <[email protected]>
40f62ee
to
884bb81
Compare
dependency_mapping.go
Outdated
) | ||
|
||
// MappingsFile defines dependency mappings for a set of buildpacks | ||
type MappingsFile 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.
Why not hide this implementation details?
dependency_mapping.go
Outdated
} | ||
|
||
// ReadMappingsFile read MappingsFile from path | ||
func ReadMappingsFile(path string) (MappingsFile, error) { |
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.
By returning ([]BuildpackMappings, error)
instead?
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 had that originally but I thought somebody could realistically want to use this library to write the file in the correct format
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.
happy to change it back if you think that is unrealistic
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.
Yeah, I wouldn't optimize for that right now. It's a good thought, but I'm pretty realistic that we're the only ones that are going to use this.
dependency_cache.go
Outdated
var mappings []DependencyMapping | ||
for _, bpm := range mappingsFile.BuildpackMappings { | ||
if bpm.BuildpackID == context.Buildpack.Info.ID { | ||
mappings = bpm.Mappings |
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.
There should also be a log message (not sure of how prominent we want it to be) that mentions that mappings are going to be used for this buildpack.
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.
Omitting this for now because the Logger is not injected into the constructor
* Better error messages * Handling missing mappings file * Don't export entire file schema Signed-off-by: Emily Casey <[email protected]>
9f75195
to
0f8eb47
Compare
Resolves #3