-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
do not timeout on provisioning for cluster reassignment
- Loading branch information
1 parent
7282818
commit 4eec3d1
Showing
5 changed files
with
60 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...nal/dinosaur/pkg/migrations/20241022160000_add_entered_provisioning_to_central_request.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package migrations | ||
|
||
// Migrations should NEVER use types from other packages. Types can change | ||
// and then migrations run on a _new_ database will fail or behave unexpectedly. | ||
// Instead of importing types, always re-create the type in the migration, as | ||
// is done here, even though the same type is defined in pkg/api | ||
|
||
import ( | ||
"database/sql" | ||
|
||
"github.com/go-gormigrate/gormigrate/v2" | ||
"github.com/pkg/errors" | ||
"github.com/stackrox/acs-fleet-manager/pkg/db" | ||
"gorm.io/gorm" | ||
) | ||
|
||
func addEnteredProvisioningToCentralRequest() *gormigrate.Migration { | ||
type CentralRequest struct { | ||
db.Model | ||
EnteredProvisioning sql.NullTime `json:"entered_provisioning"` | ||
} | ||
migrationID := "20240703120000" | ||
|
||
return &gormigrate.Migration{ | ||
ID: migrationID, | ||
Migrate: func(tx *gorm.DB) error { | ||
return addColumnIfNotExists(tx, &CentralRequest{}, "entered_provisioning") | ||
}, | ||
Rollback: func(tx *gorm.DB) error { | ||
return errors.Wrap( | ||
tx.Migrator().DropColumn(&CentralRequest{}, "entered_provisioning"), | ||
"failed to drop entered_provisioning column", | ||
) | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters