Ejemplo n.º 1
0
// stateStepsFor126 returns upgrade steps for Juju 1.26 that manipulate state directly.
func stateStepsFor126() []Step {
	return []Step{
		&upgradeStep{
			description: "add the version field to all settings docs",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.MigrateSettingsSchema(context.State())
			},
		},
		&upgradeStep{
			description: "add status to filesystem",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddFilesystemStatus(context.State())
			},
		},
		&upgradeStep{
			description: "upgrade environment config",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				// TODO(axw) updateEnvironConfig should be
				// called for all upgrades, to decouple this
				// package from provider-specific upgrades.
				st := context.State()
				return upgradeEnvironConfig(st, st, environs.GlobalProviderRegistry())
			},
		},
	}
}
Ejemplo n.º 2
0
// stateStepsFor126 returns upgrade steps for Juju 1.26 that manipulate state directly.
func stateStepsFor126() []Step {
	return []Step{
		&upgradeStep{
			description: "add the version field to all settings docs",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.MigrateSettingsSchema(context.State())
			},
		},
		&upgradeStep{
			description: "add status to filesystem",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddFilesystemStatus(context.State())
			},
		},
		&upgradeStep{
			description: "upgrade model config",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				// TODO(axw) updateModelConfig should be
				// called for all upgrades, to decouple this
				// package from provider-specific upgrades.
				st := context.State()
				return upgradeModelConfig(st, st, environs.GlobalProviderRegistry())
			},
		},
		//TODO(perrito666) make this an unconditional upgrade step.
		// it would be ideal not to have to modify this package whenever we add provider upgrade steps.
		&upgradeStep{
			description: "provider side upgrades",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				st := context.State()
				env, err := utils.GetEnviron(st)
				if err != nil {
					return errors.Annotate(err, "getting provider for upgrade")
				}
				return upgradeProviderChanges(env, st, version.Number{Major: 1, Minor: 26})
			},
		},
		&upgradeStep{
			description: "update machine preferred addresses",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddPreferredAddressesToMachines(context.State())
			},
		},
		&upgradeStep{
			description: "add default endpoint bindings to services",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddDefaultEndpointBindingsToServices(context.State())
			},
		},
	}
}
Ejemplo n.º 3
0
// stateStepsFor126 returns upgrade steps for Juju 1.26 that manipulate state directly.
func stateStepsFor126() []Step {
	return []Step{
		&upgradeStep{
			description: "add status to filesystem",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddFilesystemStatus(context.State())
			}},
	}
}