mirror of
https://github.com/hanzozt/zt.git
synced 2026-10-30 15:04:55 +00:00
Global rebrand of all OpenZiti references to Hanzo ZT: - Go module paths: github.com/openziti/* → github.com/hanzozt/* - Docker images: openziti/* → hanzozt/* - Java packages: org.openziti.* → org.hanzozt.* - Brand: OpenZiti → Hanzo ZT - URLs: openziti.io → hanzozt.dev
30 lines
904 B
Go
30 lines
904 B
Go
package db
|
|
|
|
import (
|
|
"github.com/hanzozt/storage/boltz"
|
|
)
|
|
|
|
func (stores *stores) migrateTerminatorIdentityFields(step *boltz.MigrationStep) {
|
|
terminatorIds, _, err := stores.terminator.QueryIds(step.Ctx.Tx(), "true")
|
|
step.SetError(err)
|
|
|
|
fieldIdentity := "identity"
|
|
fieldIdentitySecret := "identitySecret"
|
|
|
|
for _, terminatorId := range terminatorIds {
|
|
bucket := stores.terminator.GetEntityBucket(step.Ctx.Tx(), []byte(terminatorId))
|
|
|
|
if instanceId := bucket.GetString(fieldIdentity); instanceId != nil {
|
|
bucket.SetString(FieldTerminatorInstanceId, *instanceId, nil)
|
|
}
|
|
|
|
if instanceSecret := bucket.Get([]byte(fieldIdentitySecret)); instanceSecret != nil {
|
|
bucket.PutValue([]byte(FieldTerminatorInstanceSecret), instanceSecret)
|
|
}
|
|
|
|
step.SetError(bucket.Delete([]byte(fieldIdentity)))
|
|
step.SetError(bucket.Delete([]byte(fieldIdentitySecret)))
|
|
step.SetError(bucket.GetError())
|
|
}
|
|
}
|