use a utils/http client for all HTTP(S) calls across the codebase
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Fix Released
|
High
|
Ian Booth |
Bug Description
Right now we're using http.DefaultClient in some places and other parts of the code assume that (e.g. simplestreams registers a file:// handler for testing purposes, but it's inside the production code serving any file:// URL from root / - look at init() in simplestreams.go). If ssl-hostname-
2014-03-14 08:04:54 ERROR juju.cmd supercommand.go:296 cannot load state from URL "file:/
Bootstrap fails, because environs/state LoadStateFromURL() with the non-validating HTTP client does not have the file:// protocol registered. It doesn't fail with ssl-hostname-
We need to change all places in the code where we use an http client to create one from utils/http and provide a way to register a file handler (or others), as needed by the providers, on both TLS and HTTP clients. Only the manual provider uses file:// URLs for now, but due to the simplestreams testing-
It's not a regression, because it occurs only with the manual provider, the only one using file:// URLs, and it was like that since 1.16.
Related branches
- Juju Engineering: Pending requested
-
Diff: 791 lines (+138/-188)14 files modifiedcloudinit/sshinit/configure_test.go (+2/-1)
cmd/jujud/bootstrap.go (+10/-25)
cmd/jujud/bootstrap_test.go (+72/-52)
cmd/jujud/main_test.go (+1/-0)
environs/bootstrap/state.go (+0/-20)
environs/bootstrap/state_test.go (+0/-27)
environs/cloudinit.go (+1/-3)
environs/cloudinit/cloudinit.go (+20/-10)
environs/cloudinit/cloudinit_test.go (+11/-8)
environs/manual/bootstrap.go (+3/-2)
instance/instance.go (+10/-0)
provider/common/bootstrap.go (+3/-9)
provider/common/bootstrap_test.go (+3/-26)
provider/local/environ.go (+2/-5)
- Juju Engineering: Pending requested
-
Diff: 1394 lines (+224/-177)38 files modifiedcmd/cmd.go (+0/-7)
cmd/cmd_test.go (+3/-0)
cmd/plugins/juju-metadata/toolsmetadata.go (+2/-1)
cmd/plugins/juju-metadata/validateimagemetadata.go (+2/-1)
cmd/plugins/juju-metadata/validatetoolsmetadata.go (+2/-1)
downloader/downloader.go (+9/-12)
downloader/downloader_test.go (+7/-6)
environs/bootstrap/state.go (+8/-8)
environs/httpstorage/storage.go (+2/-2)
environs/imagemetadata/simplestreams_test.go (+7/-6)
environs/imagemetadata/urls.go (+5/-3)
environs/imagemetadata/validation_test.go (+3/-2)
environs/instances/image_test.go (+2/-1)
environs/jujutest/tests.go (+1/-1)
environs/simplestreams/datasource.go (+4/-21)
environs/simplestreams/datasource_test.go (+5/-4)
environs/simplestreams/simplestreams.go (+2/-12)
environs/simplestreams/simplestreams_test.go (+3/-2)
environs/simplestreams/testing/testing.go (+1/-1)
environs/sync/sync.go (+2/-3)
environs/sync/sync_test.go (+3/-2)
environs/testing/tools.go (+2/-2)
environs/tools/simplestreams_test.go (+6/-5)
environs/tools/urls.go (+5/-3)
environs/tools/validation_test.go (+5/-4)
provider/azure/environ.go (+2/-1)
provider/ec2/image_test.go (+3/-2)
provider/openstack/provider.go (+4/-4)
state/api/uniter/charm.go (+7/-2)
state/api/uniter/charm_test.go (+5/-5)
state/api/upgrader/upgrader.go (+7/-2)
state/api/upgrader/upgrader_test.go (+5/-4)
utils/http.go (+50/-13)
utils/http_test.go (+31/-13)
worker/uniter/charm/charm.go (+6/-6)
worker/upgrader/export_test.go (+3/-2)
worker/upgrader/upgrader.go (+8/-12)
worker/upgrader/upgrader_test.go (+2/-1)
Changed in juju-core: | |
status: | In Progress → Fix Committed |
Changed in juju-core: | |
milestone: | 1.18.0 → 1.17.7 |
Changed in juju-core: | |
status: | Fix Committed → Fix Released |
Why is a file:// URL being used at all? That doesn't seem right.