Support application config #8212

Merged
merged 6 commits into from Dec 13, 2017

Conversation

Projects
None yet
3 participants
Owner

wallyworld commented Dec 13, 2017

Description of change

Add support for managing distinct application config separate from charm config.
Broken up into a few commits:

  • Add schema for application config values
  • Additional config for k8s provisioning of various resources
  • Add support for storing application config in state database
  • Add api facade methods for new application config APIs
  • Add support for juju config and deploy to support application config

Next PRs will wire up the k8s provisioning side of things and use the proper config schema.

QA steps

bootstrap
juju deploy mysql --config juju-external-hostname=exthost --config vip=foo
juju config mysql
-> check that output has application config and charm config correctly set

juju config --reset vip,juju-external-hostname
-> check that values are reset

juju config juju-external-hostname=foo
-> check value is set

axw approved these changes Dec 13, 2017

api/application/client.go
@@ -188,14 +188,18 @@ func (c *Client) GetConfig(appNames ...string) ([]map[string]interface{}, error)
return allSettings, nil
}
+ apiName := "GetCharmConfig"
@axw

axw Dec 13, 2017

Member

if you're adding a new method, "CharmConfig" would be more idiomatic

@@ -730,3 +734,41 @@ func (c *Client) Consume(arg crossmodel.ConsumeApplicationArgs) (string, error)
}
return localName, nil
}
+
+// SetApplicationConfig sets configuration options on an application.
+func (c *Client) SetApplicationConfig(application string, config map[string]string) error {
@axw

axw Dec 13, 2017

Member

"UpdateApplicationConfig" taking a map of attributes to update, and a set of of attributes to reset, would (a) keep the surface area smaller, and (b) allow for atomic changes like removing one key and setting another

core/application/config.go
+)
+
+const (
+ // JujuExternalHostNameKey specifies the hostname of a CAAS application.
@axw

axw Dec 13, 2017

Member

I'm not sure what to do about it at the moment, but both of these things are CAAS-specific, and so I don't think we should allow them to be set for non-CAAS applications.

@wallyworld

wallyworld Dec 13, 2017

Owner

yeah, i'll add a todo

Owner

wallyworld commented Dec 13, 2017

$$merge$$

Contributor

jujubot commented Dec 13, 2017

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

@jujubot jujubot merged commit 11aa983 into juju:develop Dec 13, 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