Example #1
0
// stateStepsFor124 returns upgrade steps for Juju 1.24 that manipulate state directly.
func stateStepsFor124() []Step {
	return []Step{
		&upgradeStep{
			description: "add block device documents for existing machines",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddDefaultBlockDevicesDocs(context.State())
			}},
		&upgradeStep{
			description: "move service.UnitSeq to sequence collection",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.MoveServiceUnitSeqToSequence(context.State())
			}},
		&upgradeStep{
			description: "add instance id field to IP addresses",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddInstanceIdFieldOfIPAddresses(context.State())
			}},
		&upgradeStep{
			description: "add UUID field to IP addresses",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddUUIDToIPAddresses(context.State())
			}},
	}
}
Example #2
0
// stateStepsFor124 returns upgrade steps for Juju 1.24 that manipulate state directly.
func stateStepsFor124() []Step {
	return []Step{
		&upgradeStep{
			description: "add block device documents for existing machines",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddDefaultBlockDevicesDocs(context.State())
			}},
		&upgradeStep{
			description: "move service.UnitSeq to sequence collection",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.MoveServiceUnitSeqToSequence(context.State())
			}},
		&upgradeStep{
			description: "add instance id field to IP addresses",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddInstanceIdFieldOfIPAddresses(context.State())
			}},
		&upgradeStep{
			description: "add UUID field to IP addresses",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddUUIDToIPAddresses(context.State())
			},
		},
		&upgradeStep{
			description: "migrate charm archives into environment storage",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return migrateCharmStorage(context.State(), context.AgentConfig())
			},
		},
		&upgradeStep{
			description: "change entityid field on status history to globalkey",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.ChangeStatusHistoryEntityId(context.State())
			},
		},
		&upgradeStep{
			description: "change updated field on statushistory from time to int",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.ChangeStatusHistoryUpdatedType(context.State())
			},
		},
		&upgradeStep{
			description: "change updated field on status from time to int",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.ChangeStatusUpdatedType(context.State())
			},
		},
	}
}
Example #3
0
// stateStepsFor123 returns upgrade steps for Juju 1.23 that manipulate state directly.
func stateStepsFor123() []Step {
	return []Step{
		&upgradeStep{
			description: "add default storage pools",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return addDefaultStoragePools(context.State())
			},
		},
		&upgradeStep{
			description: "drop old mongo indexes",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.DropOldIndexesv123(context.State())
			},
		}, &upgradeStep{
			description: "migrate envuuid to env-uuid in envUsersC",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddEnvUUIDToEnvUsersDoc(context.State())
			},
		},
		&upgradeStep{
			description: "move blocks from environment to state",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return moveBlocksFromEnvironToState(context)
			},
		}, &upgradeStep{
			description: "insert userenvnameC doc for each environment",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddUniqueOwnerEnvNameForEnvirons(context.State())
			},
		}, &upgradeStep{
			description: "add name field to users and lowercase _id field",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddNameFieldLowerCaseIdOfUsers(context.State())
			},
		}, &upgradeStep{
			description: "add life field to IP addresses",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddLifeFieldOfIPAddresses(context.State())
			},
		}, &upgradeStep{
			description: "add instance id field to IP addresses",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddInstanceIdFieldOfIPAddresses(context.State())
			},
		}, &upgradeStep{
			description: "lower case _id of envUsers",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.LowerCaseEnvUsersID(context.State())
			},
		}, &upgradeStep{
			description: "add leadership settings documents for all services",
			targets:     []Target{DatabaseMaster},
			run: func(context Context) error {
				return state.AddLeadershipSettingsDocs(context.State())
			},
		},
	}
}