feat(tf): use flag -migrate-state by default
Some checks are pending
Dev / build-local (push) Waiting to run
Dev / migrate-boltdb (push) Blocked by required conditions
Dev / migrate-mysql (push) Blocked by required conditions
Dev / migrate-mariadb (push) Blocked by required conditions
Dev / migrate-postgres (push) Blocked by required conditions
Dev / integrate-boltdb (push) Blocked by required conditions
Dev / integrate-mysql (push) Blocked by required conditions
Dev / integrate-mariadb (push) Blocked by required conditions
Dev / integrate-postgres (push) Blocked by required conditions
Dev / deploy-server (push) Blocked by required conditions
Dev / deploy-runner (push) Blocked by required conditions

This commit is contained in:
Denis Gukov 2024-12-21 17:26:26 +05:00
parent d0f6f6557d
commit 7e1fd3ce0f
No known key found for this signature in database
GPG Key ID: 044381366A5D4731
5 changed files with 11 additions and 23 deletions

View File

@ -19,7 +19,6 @@ type TerraformTaskParams struct {
Destroy bool `json:"destroy"` Destroy bool `json:"destroy"`
AutoApprove bool `json:"auto_approve"` AutoApprove bool `json:"auto_approve"`
Upgrade bool `json:"upgrade"` Upgrade bool `json:"upgrade"`
MigrateState bool `json:"migrate_state"`
Reconfigure bool `json:"reconfigure"` Reconfigure bool `json:"reconfigure"`
} }

View File

@ -98,12 +98,10 @@ func (t *TerraformApp) init(environmentVars []string, params *db.TerraformTaskPa
args = append(args, "-upgrade") args = append(args, "-upgrade")
} }
if params.MigrateState {
args = append(args, "-migrate-state")
}
if params.Reconfigure { if params.Reconfigure {
args = append(args, "-reconfigure") args = append(args, "-reconfigure")
} else {
args = append(args, "-migrate-state")
} }
cmd := t.makeCmd(t.Name, args, environmentVars) cmd := t.makeCmd(t.Name, args, environmentVars)

1
go.mod
View File

@ -10,6 +10,7 @@ require (
github.com/go-gorp/gorp/v3 v3.1.0 github.com/go-gorp/gorp/v3 v3.1.0
github.com/go-ldap/ldap/v3 v3.4.8 github.com/go-ldap/ldap/v3 v3.4.8
github.com/go-sql-driver/mysql v1.8.1 github.com/go-sql-driver/mysql v1.8.1
github.com/golang-jwt/jwt/v4 v4.5.1
github.com/google/go-github v17.0.0+incompatible github.com/google/go-github v17.0.0+incompatible
github.com/gorilla/context v1.1.2 github.com/gorilla/context v1.1.2
github.com/gorilla/handlers v1.5.2 github.com/gorilla/handlers v1.5.2

2
go.sum
View File

@ -57,6 +57,8 @@ github.com/go-ldap/ldap/v3 v3.4.8 h1:loKJyspcRezt2Q3ZRMq2p/0v8iOurlmeXDPw6fikSvQ
github.com/go-ldap/ldap/v3 v3.4.8/go.mod h1:qS3Sjlu76eHfHGpUdWkAXQTw4beih+cHsco2jXlIXrk= github.com/go-ldap/ldap/v3 v3.4.8/go.mod h1:qS3Sjlu76eHfHGpUdWkAXQTw4beih+cHsco2jXlIXrk=
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo=
github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=

View File

@ -86,18 +86,6 @@
</v-checkbox> </v-checkbox>
</v-col> </v-col>
<v-col cols="12">
<v-checkbox
class="mt-0"
:input-value="params.migrate_state"
@change="updateValue('migrate_state', $event)"
>
<template v-slot:label>
<div class="text-no-wrap">{{ $t('Migrate state') }} <code>-migrate-state</code></div>
</template>
</v-checkbox>
</v-col>
<v-col cols="12"> <v-col cols="12">
<v-checkbox <v-checkbox
class="mt-0" class="mt-0"
@ -122,7 +110,7 @@
const APP_PARAMS = { const APP_PARAMS = {
terraform: ['plan', 'auto_approve', 'destroy', 'migrate_state'], terraform: ['plan', 'auto_approve', 'destroy', 'migrate_state'],
tofu: ['plan', 'auto_approve', 'destroy', 'migrate_state', 'reconfigure'], tofu: ['plan', 'auto_approve', 'destroy', 'reconfigure'],
ansible: ['diff', 'debug', 'dry_run'], ansible: ['diff', 'debug', 'dry_run'],
}; };