Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

environs/bootstrap: remove patching of version.Current.Arch #3103

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions environs/bootstrap/tools.go
Expand Up @@ -119,8 +119,12 @@ func locallyBuildableTools() (buildable coretools.List) {
if os, err := version.GetOSFromSeries(series); err != nil || os != version.Current.OS {
continue
}
binary := version.Current
binary.Series = series
binary := version.Binary {
Number: version.Current.Number,
Series: series,
Arch: arch.HostArch(),
OS: version.Current.OS,
}
// Increment the build number so we know it's a development build.
binary.Build++
buildable = append(buildable, &coretools.Tools{Version: binary})
Expand Down
9 changes: 6 additions & 3 deletions environs/bootstrap/tools_test.go
Expand Up @@ -224,7 +224,6 @@ func (s *toolsSuite) TestFindAvailableToolsSpecificVersion(c *gc.C) {
}

func (s *toolsSuite) TestFindAvailableToolsAutoUpload(c *gc.C) {
s.PatchValue(&version.Current.Arch, arch.AMD64)
s.PatchValue(&arch.HostArch, func() string { return arch.AMD64 })
trustyTools := &tools.Tools{
Version: version.MustParseBinary("1.2.3-trusty-amd64"),
Expand Down Expand Up @@ -259,8 +258,12 @@ func (s *toolsSuite) TestFindAvailableToolsCompleteNoValidate(c *gc.C) {

var allTools tools.List
for _, series := range version.SupportedSeries() {
binary := version.Current
binary.Series = series
binary := version.Binary {
Number: version.Current.Number,
Series: series,
Arch: arch.HostArch(),
OS: version.Current.OS,
}
allTools = append(allTools, &tools.Tools{
Version: binary,
URL: "http://testing.invalid/tools.tar.gz",
Expand Down