1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00

created bucket if not exists during restore sequence (#6614)

This commit is contained in:
Prabhat Khera 2022-03-03 09:10:26 +13:00 committed by GitHub
parent a3b1466b96
commit eb6cdf1229
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -419,9 +419,9 @@ func (connection *DbConnection) RestoreMetadata(s map[string]interface{}) error
}
err = connection.Batch(func(tx *bolt.Tx) error {
bucket := tx.Bucket([]byte(bucketName))
if bucket == nil {
return nil
bucket, err := tx.CreateBucketIfNotExists([]byte(bucketName))
if err != nil {
return err
}
return bucket.SetSequence(uint64(id))
})