Skip to content

Commit

Permalink
Use charm-base as the repository for charm oci base images.
Browse files Browse the repository at this point in the history
  • Loading branch information
hpidcock committed Mar 25, 2021
1 parent 10b55c3 commit b33b30d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cloudconfig/podcfg/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ func ImageForBase(imageRepo string, base systems.Base) (string, error) {
if len(base.Channel.Track) == 0 || len(base.Channel.Risk) == 0 {
return "", errors.NotValidf("channel %q", base.Channel)
}
tag := base.Channel.Track
tag := fmt.Sprintf("%s-%s", base.Name, base.Channel.Track)
if base.Channel.Risk != channel.Stable {
tag = fmt.Sprintf("%s-%s", tag, base.Channel.Risk)
}
image := fmt.Sprintf("%s/%s:%s", imageRepo, base.Name, tag)
image := fmt.Sprintf("%s/charm-base:%s", imageRepo, tag)
return image, nil
}
4 changes: 2 additions & 2 deletions cloudconfig/podcfg/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ func (*imageSuite) TestImageForBase(c *gc.C) {
Track: "20.04", Risk: channel.Stable,
}})
c.Assert(err, jc.ErrorIsNil)
c.Assert(path, gc.DeepEquals, `jujusolutions/ubuntu:20.04`)
c.Assert(path, gc.DeepEquals, `jujusolutions/charm-base:ubuntu-20.04`)

path, err = podcfg.ImageForBase("", systems.Base{Name: "ubuntu", Channel: channel.Channel{
Track: "20.04", Risk: channel.Edge,
}})
c.Assert(err, jc.ErrorIsNil)
c.Assert(path, gc.DeepEquals, `jujusolutions/ubuntu:20.04-edge`)
c.Assert(path, gc.DeepEquals, `jujusolutions/charm-base:ubuntu-20.04-edge`)
}
2 changes: 1 addition & 1 deletion worker/caasapplicationprovisioner/application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (s *ApplicationWorkerSuite) TestWorker(c *gc.C) {
mc.AddExpr(`_.Charm`, gc.NotNil)
c.Check(config, mc, caas.ApplicationConfig{
CharmBaseImage: resources.DockerImageDetails{
RegistryPath: "jujusolutions/ubuntu:20.04",
RegistryPath: "jujusolutions/charm-base:ubuntu-20.04",
},
Containers: map[string]caas.ContainerConfig{
"test": {
Expand Down

0 comments on commit b33b30d

Please sign in to comment.