environs/config/config.go doesn't use its own default values
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Low
|
Unassigned |
Bug Description
environs/
// AgentMetadataURL returns the URL that locates the agent tarballs and metadata,
// and whether it has been set.
func (c *Config) AgentMetadataURL() (string, bool) {
if url, ok := c.defined[
return url.(string), true
}
return "", false
}
I would expect that this (and other methods) to defer to the defaults provided earlier, rather than duplicating them with hard coded values. The relevant change to this method would be the following:
// AgentMetadataURL returns the URL that locates the agent tarballs and metadata,
// and whether it has been set.
func (c *Config) AgentMetadataURL() (string, bool) {
if url, ok := c.defined[
return url.(string), true
}
return defaultConfigVa
}
Reducing default duplicates will lead to code that's easier to maintain as updates will only need to occur in a single place.
[1]: https:/
[2]: https:/
This bug has not been updated in 2 years, so we're marking it Low importance. If you believe this is incorrect, please update the importance.