Skip to content

Commit 39db779

Browse files
committed
Exclude build number from reported current version if wanted version is official
1 parent b4eda94 commit 39db779

File tree

21 files changed

+107
-147
lines changed

21 files changed

+107
-147
lines changed

agent/tools/tools_test.go

Lines changed: 38 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -208,90 +208,53 @@ func (t *ToolsSuite) TestReadGUIArchiveSuccess(c *gc.C) {
208208
}
209209

210210
func (t *ToolsSuite) TestChangeAgentTools(c *gc.C) {
211-
tests := []struct {
212-
version1 version.Binary
213-
version2 version.Binary
214-
dir1 string
215-
dir2 string
216-
}{
217-
{
218-
version.MustParseBinary("1.2.3-quantal-amd64"),
219-
version.MustParseBinary("1.2.4-quantal-amd64"),
220-
"1.2.3-quantal-amd64", "1.2.4-quantal-amd64",
221-
},
222-
{
223-
version.MustParseBinary("1.2-beta1.3-quantal-amd64"),
224-
version.MustParseBinary("1.2.4-quantal-amd64"),
225-
"1.2-beta1-quantal-amd64", "1.2.4-quantal-amd64",
226-
},
227-
{
228-
version.MustParseBinary("1.2-beta1.3-quantal-amd64"),
229-
version.MustParseBinary("1.2-beta2.4-quantal-amd64"),
230-
"1.2-beta1-quantal-amd64", "1.2-beta2-quantal-amd64",
231-
},
211+
files := []*testing.TarFile{
212+
testing.NewTarFile("jujuc", agenttools.DirPerm, "juju executable"),
213+
testing.NewTarFile("jujud", agenttools.DirPerm, "jujuc executable"),
232214
}
233-
for k, v := range tests {
234-
if k != 0 {
235-
t.dataDir = c.MkDir()
236-
}
237-
files := []*testing.TarFile{
238-
testing.NewTarFile("jujuc", agenttools.DirPerm, "juju executable"),
239-
testing.NewTarFile("jujud", agenttools.DirPerm, "jujuc executable"),
240-
}
241-
data, checksum := testing.TarGz(files...)
242-
testTools := &coretest.Tools{
243-
URL: "http://foo/bar1",
244-
Version: v.version1,
245-
Size: int64(len(data)),
246-
SHA256: checksum,
247-
}
248-
err := agenttools.UnpackTools(t.dataDir, testTools, bytes.NewReader(data))
249-
c.Assert(err, jc.ErrorIsNil)
215+
data, checksum := testing.TarGz(files...)
216+
testTools := &coretest.Tools{
217+
URL: "http://foo/bar1",
218+
Version: version.MustParseBinary("1.2.3-quantal-amd64"),
219+
Size: int64(len(data)),
220+
SHA256: checksum,
221+
}
222+
err := agenttools.UnpackTools(t.dataDir, testTools, bytes.NewReader(data))
223+
c.Assert(err, jc.ErrorIsNil)
250224

251-
gotTools, err := agenttools.ChangeAgentTools(t.dataDir, "testagent", testTools.Version)
252-
c.Assert(err, jc.ErrorIsNil)
253-
c.Assert(*gotTools, gc.Equals, *testTools)
225+
gotTools, err := agenttools.ChangeAgentTools(t.dataDir, "testagent", testTools.Version)
226+
c.Assert(err, jc.ErrorIsNil)
227+
c.Assert(*gotTools, gc.Equals, *testTools)
254228

255-
assertDirNames(c, t.toolsDir(), []string{v.dir1, "testagent"})
256-
assertDirNames(c, agenttools.ToolsDir(t.dataDir, "testagent"), []string{"jujuc", "jujud", agenttools.ToolsFile})
229+
assertDirNames(c, t.toolsDir(), []string{"1.2.3-quantal-amd64", "testagent"})
230+
assertDirNames(c, agenttools.ToolsDir(t.dataDir, "testagent"), []string{"jujuc", "jujud", agenttools.ToolsFile})
257231

258-
// Upgrade again to check that the link replacement logic works ok.
259-
files2 := []*testing.TarFile{
260-
testing.NewTarFile("quantal", agenttools.DirPerm, "foo content"),
261-
testing.NewTarFile("amd64", agenttools.DirPerm, "bar content"),
262-
}
263-
data2, checksum2 := testing.TarGz(files2...)
264-
tools2 := &coretest.Tools{
265-
URL: "http://foo/bar2",
266-
Version: v.version2,
267-
Size: int64(len(data2)),
268-
SHA256: checksum2,
269-
}
270-
err = agenttools.UnpackTools(t.dataDir, tools2, bytes.NewReader(data2))
271-
c.Assert(err, jc.ErrorIsNil)
232+
// Upgrade again to check that the link replacement logic works ok.
233+
files2 := []*testing.TarFile{
234+
testing.NewTarFile("quantal", agenttools.DirPerm, "foo content"),
235+
testing.NewTarFile("amd64", agenttools.DirPerm, "bar content"),
236+
}
237+
data2, checksum2 := testing.TarGz(files2...)
238+
tools2 := &coretest.Tools{
239+
URL: "http://foo/bar2",
240+
Version: version.MustParseBinary("1.2.4-quantal-amd64"),
241+
Size: int64(len(data2)),
242+
SHA256: checksum2,
243+
}
244+
err = agenttools.UnpackTools(t.dataDir, tools2, bytes.NewReader(data2))
245+
c.Assert(err, jc.ErrorIsNil)
272246

273-
gotTools, err = agenttools.ChangeAgentTools(t.dataDir, "testagent", tools2.Version)
274-
c.Assert(err, jc.ErrorIsNil)
275-
c.Assert(*gotTools, gc.Equals, *tools2)
247+
gotTools, err = agenttools.ChangeAgentTools(t.dataDir, "testagent", tools2.Version)
248+
c.Assert(err, jc.ErrorIsNil)
249+
c.Assert(*gotTools, gc.Equals, *tools2)
276250

277-
assertDirNames(c, t.toolsDir(), []string{v.dir1, v.dir2, "testagent"})
278-
assertDirNames(c, agenttools.ToolsDir(t.dataDir, "testagent"), []string{"quantal", "amd64", agenttools.ToolsFile})
279-
}
251+
assertDirNames(c, t.toolsDir(), []string{"1.2.3-quantal-amd64", "1.2.4-quantal-amd64", "testagent"})
252+
assertDirNames(c, agenttools.ToolsDir(t.dataDir, "testagent"), []string{"quantal", "amd64", agenttools.ToolsFile})
280253
}
281254

282255
func (t *ToolsSuite) TestSharedToolsDir(c *gc.C) {
283-
tests := []struct {
284-
dataDir string
285-
version version.Binary
286-
out string
287-
}{
288-
{"/var/lib/juju", version.MustParseBinary("1.2.3-precise-amd64"), "/var/lib/juju/tools/1.2.3-precise-amd64"},
289-
{"/var/lib/juju", version.MustParseBinary("1.2-beta1.3-precise-amd64"), "/var/lib/juju/tools/1.2-beta1-precise-amd64"},
290-
}
291-
for _, v := range tests {
292-
dir := agenttools.SharedToolsDir(v.dataDir, v.version)
293-
c.Assert(dir, gc.Equals, v.out)
294-
}
256+
dir := agenttools.SharedToolsDir("/var/lib/juju", version.MustParseBinary("1.2.3-precise-amd64"))
257+
c.Assert(dir, gc.Equals, "/var/lib/juju/tools/1.2.3-precise-amd64")
295258
}
296259

297260
func (t *ToolsSuite) TestSharedGUIDir(c *gc.C) {

agent/tools/toolsdir.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ const (
3333
// store binaries for the given version of the juju tools
3434
// within the dataDir directory.
3535
func SharedToolsDir(dataDir string, vers version.Binary) string {
36-
vers.Number = vers.Number.ToPatch()
3736
return path.Join(dataDir, "tools", vers.String())
3837
}
3938

apiserver/facades/controller/caasoperatorprovisioner/provisioner.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/juju/juju/state/watcher"
2424
"github.com/juju/juju/storage"
2525
"github.com/juju/juju/storage/poolmanager"
26+
"github.com/juju/juju/version"
2627
)
2728

2829
type API struct {
@@ -113,7 +114,7 @@ func (a *API) OperatorProvisioningInfo() (params.OperatorProvisioningInfo, error
113114
)
114115
}
115116

116-
imagePath := podcfg.GetJujuOCIImagePath(cfg, vers)
117+
imagePath := podcfg.GetJujuOCIImagePath(cfg, vers.ToPatch(), version.OfficialBuild)
117118
storageClassName, _ := modelConfig.AllAttrs()[provider.OperatorStorageKey].(string)
118119
if storageClassName == "" {
119120
return params.OperatorProvisioningInfo{}, errors.New("no operator storage class defined")

apiserver/facades/controller/caasoperatorprovisioner/provisioner_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"github.com/juju/juju/core/life"
2525
"github.com/juju/juju/state"
2626
coretesting "github.com/juju/juju/testing"
27+
jujuversion "github.com/juju/juju/version"
2728
)
2829

2930
var _ = gc.Suite(&CAASProvisionerSuite{})
@@ -44,6 +45,7 @@ func (s *CAASProvisionerSuite) SetUpTest(c *gc.C) {
4445

4546
s.resources = common.NewResources()
4647
s.AddCleanup(func(_ *gc.C) { s.resources.StopAll() })
48+
s.PatchValue(&jujuversion.OfficialBuild, 666)
4749

4850
s.authorizer = &apiservertesting.FakeAuthorizer{
4951
Tag: names.NewMachineTag("0"),
@@ -131,7 +133,7 @@ func (s *CAASProvisionerSuite) TestOperatorProvisioningInfoDefault(c *gc.C) {
131133
result, err := s.api.OperatorProvisioningInfo()
132134
c.Assert(err, jc.ErrorIsNil)
133135
c.Assert(result, jc.DeepEquals, params.OperatorProvisioningInfo{
134-
ImagePath: "jujusolutions/jujud-operator:2.6-beta3",
136+
ImagePath: "jujusolutions/jujud-operator:2.6-beta3.666",
135137
Version: version.MustParse("2.6-beta3"),
136138
APIAddresses: []string{"10.0.0.1:1"},
137139
Tags: map[string]string{
@@ -157,7 +159,7 @@ func (s *CAASProvisionerSuite) TestOperatorProvisioningInfo(c *gc.C) {
157159
result, err := s.api.OperatorProvisioningInfo()
158160
c.Assert(err, jc.ErrorIsNil)
159161
c.Assert(result, jc.DeepEquals, params.OperatorProvisioningInfo{
160-
ImagePath: s.st.operatorRepo + "/jujud-operator:" + "2.6-beta3",
162+
ImagePath: s.st.operatorRepo + "/jujud-operator:" + "2.6-beta3.666",
161163
Version: version.MustParse("2.6-beta3"),
162164
APIAddresses: []string{"10.0.0.1:1"},
163165
Tags: map[string]string{
@@ -184,7 +186,7 @@ func (s *CAASProvisionerSuite) TestOperatorProvisioningInfoNoStoragePool(c *gc.C
184186
result, err := s.api.OperatorProvisioningInfo()
185187
c.Assert(err, jc.ErrorIsNil)
186188
c.Assert(result, jc.DeepEquals, params.OperatorProvisioningInfo{
187-
ImagePath: s.st.operatorRepo + "/jujud-operator:" + "2.6-beta3",
189+
ImagePath: s.st.operatorRepo + "/jujud-operator:" + "2.6-beta3.666",
188190
Version: version.MustParse("2.6-beta3"),
189191
APIAddresses: []string{"10.0.0.1:1"},
190192
Tags: map[string]string{

apiserver/facades/controller/caasunitprovisioner/provisioner.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
"github.com/juju/juju/state/watcher"
3232
"github.com/juju/juju/storage"
3333
"github.com/juju/juju/storage/poolmanager"
34+
"github.com/juju/juju/version"
3435
)
3536

3637
var logger = loggo.GetLogger("juju.apiserver.controller.caasunitprovisioner")
@@ -276,7 +277,7 @@ func (f *Facade) provisioningInfo(model Model, tagString string) (*params.Kubern
276277
fmt.Sprintf("agent version is missing in model config %q", modelConfig.Name()),
277278
)
278279
}
279-
operatorImagePath := podcfg.GetJujuOCIImagePath(controllerCfg, vers)
280+
operatorImagePath := podcfg.GetJujuOCIImagePath(controllerCfg, vers.ToPatch(), version.OfficialBuild)
280281

281282
filesystemParams, err := f.applicationFilesystemParams(app, controllerCfg, modelConfig)
282283
if err != nil {

apiserver/facades/controller/caasunitprovisioner/provisioner_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ func (s *CAASProvisionerSuite) SetUpTest(c *gc.C) {
9090
Controller: true,
9191
}
9292
s.clock = testclock.NewClock(time.Now())
93+
s.PatchValue(&jujuversion.OfficialBuild, 666)
9394

9495
facade, err := caasunitprovisioner.NewFacade(
9596
s.resources, s.authorizer, s.st, s.storage, s.devices, s.storagePoolManager, s.registry, s.clock)
@@ -201,7 +202,7 @@ func (s *CAASProvisionerSuite) TestProvisioningInfo(c *gc.C) {
201202
DeploymentType: "stateful",
202203
ServiceType: "loadbalancer",
203204
},
204-
OperatorImagePath: fmt.Sprintf("jujusolutions/jujud-operator:%s", jujuversion.Current.String()),
205+
OperatorImagePath: fmt.Sprintf("jujusolutions/jujud-operator:%s", jujuversion.Current.String()+".666"),
205206
Devices: []params.KubernetesDeviceParams{
206207
{
207208
Type: "nvidia.com/gpu",

caas/kubernetes/provider/bootstrap_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ func (s *bootstrapSuite) SetUpTest(c *gc.C) {
6565
c.Assert(err, jc.ErrorIsNil)
6666

6767
pcfg.JujuVersion = jujuversion.Current
68+
pcfg.OfficialBuild = 666
6869
pcfg.APIInfo = &api.Info{
6970
Password: "password",
7071
CACert: testing.CACert,
@@ -559,7 +560,7 @@ func (s *bootstrapSuite) TestBootstrap(c *gc.C) {
559560
{
560561
Name: "api-server",
561562
ImagePullPolicy: core.PullIfNotPresent,
562-
Image: "jujusolutions/jujud-operator:" + jujuversion.Current.String(),
563+
Image: "jujusolutions/jujud-operator:" + jujuversion.Current.String() + ".666",
563564
Command: []string{
564565
"/bin/sh",
565566
},

cloudconfig/podcfg/image.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const (
2020

2121
// GetControllerImagePath returns oci image path of jujud for a controller.
2222
func (cfg *ControllerPodConfig) GetControllerImagePath() string {
23-
return GetJujuOCIImagePath(cfg.Controller.Config, cfg.JujuVersion)
23+
return GetJujuOCIImagePath(cfg.Controller.Config, cfg.JujuVersion, cfg.OfficialBuild)
2424
}
2525

2626
// GetJujuDbOCIImagePath returns the juju-db oci image path.
@@ -39,8 +39,9 @@ func IsJujuOCIImage(imagePath string) bool {
3939
}
4040

4141
// GetJujuOCIImagePath returns the jujud oci image path.
42-
func GetJujuOCIImagePath(controllerCfg controller.Config, ver version.Number) string {
42+
func GetJujuOCIImagePath(controllerCfg controller.Config, ver version.Number, build int) string {
4343
// First check the deprecated "caas-operator-image-path" config.
44+
ver.Build = build
4445
imagePath := RebuildOldOperatorImagePath(
4546
controllerCfg.CAASOperatorImagePath(), ver,
4647
)

cloudconfig/podcfg/image_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ func (*imageSuite) TestGetJujuOCIImagePath(c *gc.C) {
2424

2525
cfg[controller.CAASImageRepo] = "testing-repo"
2626
ver := version.MustParse("2.6-beta3")
27-
path := podcfg.GetJujuOCIImagePath(cfg, ver)
28-
c.Assert(path, jc.DeepEquals, "testing-repo/jujud-operator:2.6-beta3")
27+
path := podcfg.GetJujuOCIImagePath(cfg, ver, 666)
28+
c.Assert(path, jc.DeepEquals, "testing-repo/jujud-operator:2.6-beta3.666")
2929

3030
cfg[controller.CAASOperatorImagePath] = "testing-old-repo/jujud-old-operator:1.6"
31-
path = podcfg.GetJujuOCIImagePath(cfg, ver)
31+
path = podcfg.GetJujuOCIImagePath(cfg, ver, 0)
3232
c.Assert(path, jc.DeepEquals, "testing-old-repo/jujud-old-operator:2.6-beta3")
3333
}

cloudconfig/podcfg/podcfg.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ type ControllerPodConfig struct {
6060
// JujuVersion is the juju version.
6161
JujuVersion version.Number
6262

63+
// OfficialBuild is the build number to use when pulling the juju oci image.
64+
OfficialBuild int
65+
6366
// DataDir holds the directory that juju state will be put in the new
6467
// instance.
6568
DataDir string

cloudconfig/podcfg/podcfg_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ func (*podcfgSuite) TestOperatorImagesDefaultRepo(c *gc.C) {
6565
)
6666
c.Assert(err, jc.ErrorIsNil)
6767
podConfig.JujuVersion = version.MustParse("6.6.6")
68-
c.Assert(podConfig.GetControllerImagePath(), gc.Equals, "jujusolutions/jujud-operator:6.6.6")
68+
podConfig.OfficialBuild = 666
69+
c.Assert(podConfig.GetControllerImagePath(), gc.Equals, "jujusolutions/jujud-operator:6.6.6.666")
6970
c.Assert(podConfig.GetJujuDbOCIImagePath(), gc.Equals, "jujusolutions/juju-db:4.0")
7071
}
7172

@@ -80,7 +81,8 @@ func (*podcfgSuite) TestOperatorImagesCustomRepo(c *gc.C) {
8081
)
8182
c.Assert(err, jc.ErrorIsNil)
8283
podConfig.JujuVersion = version.MustParse("6.6.6")
83-
c.Assert(podConfig.GetControllerImagePath(), gc.Equals, "path/to/my/repo/jujud-operator:6.6.6")
84+
podConfig.OfficialBuild = 666
85+
c.Assert(podConfig.GetControllerImagePath(), gc.Equals, "path/to/my/repo/jujud-operator:6.6.6.666")
8486
c.Assert(podConfig.GetJujuDbOCIImagePath(), gc.Equals, "path/to/my/repo/juju-db:4.0")
8587
}
8688

cloudconfig/userdatacfg.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,11 @@ func (c *baseConfigure) toolsSymlinkCommand(toolsDir string) string {
189189
c.icfg.AgentVersion(),
190190
)
191191
default:
192-
ver := c.icfg.AgentVersion()
193-
ver.Number = ver.ToPatch()
194192
// TODO(dfc) ln -nfs, so it doesn't fail if for some reason that
195193
// the target already exists.
196194
return fmt.Sprintf(
197195
"ln -s %v %s",
198-
ver.String(),
196+
c.icfg.AgentVersion(),
199197
shquote(toolsDir),
200198
)
201199
}

cloudconfig/userdatacfg_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ mkdir -p /var/lib/juju/locks
392392
\(id ubuntu &> /dev/null\) && chown ubuntu:ubuntu /var/lib/juju/locks
393393
mkdir -p /var/log/juju
394394
chown syslog:adm /var/log/juju
395-
bin='/var/lib/juju/tools/1\.2\.3-precise-amd64'
395+
bin='/var/lib/juju/tools/1\.2\.3\.123-precise-amd64'
396396
mkdir -p \$bin
397397
echo 'Fetching Juju agent version.*
398398
curl .* '.*' --retry 10 -o \$bin/tools\.tar\.gz 'http://foo\.com/tools/released/juju1\.2\.3\.123-precise-amd64\.tgz'
@@ -406,10 +406,10 @@ chmod 0600 '/var/lib/juju/agents/machine-0/agent\.conf'
406406
install -D -m 600 /dev/null '/var/lib/juju/bootstrap-params'
407407
printf '%s\\n' '.*' > '/var/lib/juju/bootstrap-params'
408408
echo 'Installing Juju machine agent'.*
409-
/var/lib/juju/tools/1\.2\.3-precise-amd64/jujud bootstrap-state --timeout 10m0s --data-dir '/var/lib/juju' --debug '/var/lib/juju/bootstrap-params'
409+
/var/lib/juju/tools/1\.2\.3\.123-precise-amd64/jujud bootstrap-state --timeout 10m0s --data-dir '/var/lib/juju' --debug '/var/lib/juju/bootstrap-params'
410410
install -D -m 755 /dev/null '/sbin/remove-juju-services'
411411
printf '%s\\n' '.*' > '/sbin/remove-juju-services'
412-
ln -s 1\.2\.3-precise-amd64 '/var/lib/juju/tools/machine-0'
412+
ln -s 1\.2\.3\.123-precise-amd64 '/var/lib/juju/tools/machine-0'
413413
echo 'Starting Juju machine agent \(service jujud-machine-0\)'.*
414414
cat > /etc/init/jujud-machine-0\.conf << 'EOF'\\ndescription "juju agent for machine-0"\\nauthor "Juju Team <juju@lists\.ubuntu\.com>"\\nstart on runlevel \[2345\]\\nstop on runlevel \[!2345\]\\nrespawn\\nnormal exit 0\\n\\nlimit .*\\n\\nscript\\n\\n\\n # Ensure log files are properly protected\\n touch /var/log/juju/machine-0\.log\\n chown syslog:adm /var/log/juju/machine-0\.log\\n chmod 0640 /var/log/juju/machine-0\.log\\n\\n exec '/var/lib/juju/tools/machine-0/jujud' machine --data-dir '/var/lib/juju' --machine-id 0 --debug >> /var/log/juju/machine-0\.log 2>&1\\nend script\\nEOF\\n
415415
start jujud-machine-0

cmd/juju/commands/upgradecontroller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func initCAASVersions(
241241
filterVersion.Major--
242242
}
243243
logger.Debugf("searching for agent images with major: %d", filterVersion.Major)
244-
imagePath := podcfg.GetJujuOCIImagePath(controllerCfg, version.Zero)
244+
imagePath := podcfg.GetJujuOCIImagePath(controllerCfg, version.Zero, 0)
245245
availableTags, err := docker.ListOperatorImages(imagePath)
246246
if err != nil {
247247
return nil, err

cmd/supercommand.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ type versionDetail struct {
4242
GitTreeState string `json:"git-tree-state,omitempty" yaml:"git-tree-state,omitempty"`
4343
// Compiler reported by runtime.Compiler
4444
Compiler string `json:"compiler" yaml:"compiler"`
45-
// Build is a monotonic integer set by Jenkins.
46-
Build int `json:"build,omitempty" yaml:"build,omitempty"`
45+
// OfficialBuild is a monotonic integer set by Jenkins.
46+
OfficialBuild int `json:"official-build,omitempty" yaml:"official-build,omitempty"`
4747
}
4848

4949
// NewSuperCommand is like cmd.NewSuperCommand but
@@ -62,11 +62,11 @@ func NewSuperCommand(p cmd.SuperCommandParams) *cmd.SuperCommand {
6262
Series: series.MustHostSeries(),
6363
}
6464
detail := versionDetail{
65-
Version: current.String(),
66-
GitCommit: jujuversion.GitCommit,
67-
GitTreeState: jujuversion.GitTreeState,
68-
Compiler: jujuversion.Compiler,
69-
Build: jujuversion.Build,
65+
Version: current.String(),
66+
GitCommit: jujuversion.GitCommit,
67+
GitTreeState: jujuversion.GitTreeState,
68+
Compiler: jujuversion.Compiler,
69+
OfficialBuild: jujuversion.OfficialBuild,
7070
}
7171

7272
// p.Version should be a version.Binary, but juju/cmd does not
@@ -80,7 +80,7 @@ func NewSuperCommand(p cmd.SuperCommandParams) *cmd.SuperCommand {
8080
}
8181

8282
func runNotifier(name string) {
83-
logger.Infof("running %s [%s %s %s %s]", name, jujuversion.Current, jujuversion.GitCommit, runtime.Compiler, runtime.Version())
83+
logger.Infof("running %s [%s %d %s %s %s]", name, jujuversion.Current, jujuversion.OfficialBuild, jujuversion.GitCommit, runtime.Compiler, runtime.Version())
8484
logger.Debugf(" args: %#v", os.Args)
8585
}
8686

0 commit comments

Comments
 (0)