diff --git a/upgrades/operations.go b/upgrades/operations.go index 3d758d08abd..20f7d642fc5 100644 --- a/upgrades/operations.go +++ b/upgrades/operations.go @@ -20,6 +20,7 @@ import ( var stateUpgradeOperations = func() []Operation { steps := []Operation{ upgradeToVersion{version.MustParse("3.4.1"), stateStepsFor341()}, + upgradeToVersion{version.MustParse("3.4.3"), stateStepsFor343()}, } return steps } diff --git a/upgrades/steps_343.go b/upgrades/steps_343.go new file mode 100644 index 00000000000..0442aaa5939 --- /dev/null +++ b/upgrades/steps_343.go @@ -0,0 +1,16 @@ +// Copyright 2024 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package upgrades + +func stateStepsFor343() []Step { + return []Step{ + &upgradeStep{ + description: "assign architectures to container's instance data", + targets: []Target{DatabaseMaster}, + run: func(context Context) error { + return context.State().AssignArchToContainers() + }, + }, + } +} diff --git a/upgrades/steps_343_test.go b/upgrades/steps_343_test.go new file mode 100644 index 00000000000..f8c860bf486 --- /dev/null +++ b/upgrades/steps_343_test.go @@ -0,0 +1,26 @@ +// Copyright 2024 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package upgrades_test + +import ( + jc "github.com/juju/testing/checkers" + "github.com/juju/version/v2" + gc "gopkg.in/check.v1" + + "github.com/juju/juju/testing" + "github.com/juju/juju/upgrades" +) + +var v343 = version.MustParse("3.4.3") + +type steps342Suite struct { + testing.BaseSuite +} + +var _ = gc.Suite(&steps342Suite{}) + +func (s *steps342Suite) TestAssignArchToContainers(c *gc.C) { + step := findStateStep(c, v343, "assign architectures to container's instance data") + c.Assert(step.Targets(), jc.DeepEquals, []upgrades.Target{upgrades.DatabaseMaster}) +} diff --git a/upgrades/upgrade_test.go b/upgrades/upgrade_test.go index 52b25eaf94a..5e0059da9a7 100644 --- a/upgrades/upgrade_test.go +++ b/upgrades/upgrade_test.go @@ -598,6 +598,7 @@ func (s *upgradeSuite) TestStateUpgradeOperationsVersions(c *gc.C) { versions := extractUpgradeVersions(c, (*upgrades.StateUpgradeOperations)()) c.Assert(versions, gc.DeepEquals, []string{ "3.4.1", + "3.4.3", }) }