Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Add client side for includes in bundles #7821
Conversation
babbageclunk
approved these changes
Sep 4, 2017
•
Looks good. bundleFilePath in deployBundle sounds like a file path to me, rather than a directory, but it's being passed to an arg named baseDir. Reading data.VerifyLocal it looks like it is actually a directory - maybe change the name of the variable to bundleDir to make it clearer that it isn't a file path?
| + } | ||
| + | ||
| + if !filepath.IsAbs(filename) { | ||
| + filename = filepath.Clean(filepath.Join(baseDir, filename)) |
babbageclunk
Sep 4, 2017
Member
This value is called baseDir here, but it's being passed in as bundleFilePath from deployBundle - will it be the path of the bundle file, rather than the containing directory?
|
$$merge$$ |
|
Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$try-again$$ timeout getting gpg key |
|
Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju |
howbazaar commentedSep 4, 2017
There are times when deploying a bundle where the charm config is expecting more complicated config, such as a binary certificate, or a YAML config file. To make it easer to supply this configuration local bundlers are able to specify one of two new values for either options or annotations:
include-file://filename
and
include-base64://filename
The filename can be relative or absolute. If the path is relative, it is relative to the bundle file.
The file is read and used as the value for the specified key of the option or annotation. If the underlying file is binary, then include-base64 should be used as it reads the file and base64 encodes the content.
The charms have to know that a particular value is base64 encoded content. This is one of the key missing parts that mojo adds that has been requested for default behaviour.
QA steps
Deploy a local bundle that specifies some other files to be read for values.
Documentation changes
Yes, this will need documentation additions for local bundles.