Add client side for includes in bundles #7821

Merged
merged 2 commits into from Sep 4, 2017

Conversation

Projects
None yet
3 participants
Owner

howbazaar commented Sep 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.

babbageclunk approved these changes Sep 4, 2017 edited

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

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?

Owner

howbazaar commented Sep 4, 2017

$$merge$$

Contributor

jujubot commented Sep 4, 2017

Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju

Contributor

jujubot commented Sep 4, 2017

Build failed: Tests failed
build url: http://ci.jujucharms.com/job/github-merge-juju/216

Owner

howbazaar commented Sep 4, 2017

$$try-again$$ timeout getting gpg key

Contributor

jujubot commented Sep 4, 2017

Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju

@jujubot jujubot merged commit ec584b1 into juju:2.2 Sep 4, 2017

1 check passed

continuous-integration/jenkins/pr-merge This commit looks good
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment