feat: add downgrade target for 2.1 (#23029)
parent
c889d0f22b
commit
4f74049a52
|
@ -30,8 +30,11 @@ type migrationTarget struct {
|
||||||
kvMigration, sqlMigration int
|
kvMigration, sqlMigration int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// migrationTarget int values mean "migrate to this migration number". For example, kvMigration of 15 will result in the
|
||||||
|
// downgraded database including migration 15, but migration 15 will not be undone.
|
||||||
var downgradeMigrationTargets = map[string]migrationTarget{
|
var downgradeMigrationTargets = map[string]migrationTarget{
|
||||||
"2.0": {kvMigration: 15, sqlMigration: 0},
|
"2.0": {kvMigration: 15, sqlMigration: 0},
|
||||||
|
"2.1": {kvMigration: 18, sqlMigration: 3},
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCommand(ctx context.Context, v *viper.Viper) (*cobra.Command, error) {
|
func NewCommand(ctx context.Context, v *viper.Viper) (*cobra.Command, error) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -exo pipefail
|
set -exo pipefail
|
||||||
|
|
||||||
declare -a DOWNGRADE_TARGETS=('2.0')
|
declare -a DOWNGRADE_TARGETS=('2.0' '2.1')
|
||||||
|
|
||||||
declare -r TEST_ORG=testorg
|
declare -r TEST_ORG=testorg
|
||||||
declare -r TEST_TOKEN=supersecretfaketoken
|
declare -r TEST_TOKEN=supersecretfaketoken
|
||||||
|
@ -17,6 +17,10 @@ function download_older_binary () {
|
||||||
dl_url=https://dl.influxdata.com/influxdb/releases/influxdb2-2.0.9-linux-amd64.tar.gz
|
dl_url=https://dl.influxdata.com/influxdb/releases/influxdb2-2.0.9-linux-amd64.tar.gz
|
||||||
dl_sha=64b9cfea1b5ca07479a16332056f9e7f806ad71df9c6cc0ec70c4333372b9d26
|
dl_sha=64b9cfea1b5ca07479a16332056f9e7f806ad71df9c6cc0ec70c4333372b9d26
|
||||||
;;
|
;;
|
||||||
|
2.1)
|
||||||
|
dl_url=https://dl.influxdata.com/influxdb/releases/influxdb2-2.1.1-linux-amd64.tar.gz
|
||||||
|
dl_sha=1688e3afa7f875d472768e4f4f5a909b357287a45a8f28287021e4184a185927
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
>&2 echo Error: Unknown downgrade target "'$target_version'"
|
>&2 echo Error: Unknown downgrade target "'$target_version'"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in New Issue