Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] envindexkey should add envid when the env be deleted #1476

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datasource/etcd/ms.go
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,7 @@
}

func (ds *MetadataManager) UnregisterEnvironment(ctx context.Context, request *ev.DeleteEnvironmentRequest) (err error) {
environmentId := request.EnvironmentId

Check warning on line 1864 in datasource/etcd/ms.go

View workflow job for this annotation

GitHub Actions / lint

var-naming: var environmentId should be environmentID (revive)
remoteIP := util.GetIPFromContext(ctx)
domainProject := util.ParseDomainProject(ctx)

Expand All @@ -1883,13 +1883,13 @@
environmentId, remoteIP), errors.New("this env has services"))
return pb.NewError(pb.ErrInternal, "this env has services")
}
environmentIdKey := path.GenerateEnvironmentKey(domainProject, environmentId)

Check warning on line 1886 in datasource/etcd/ms.go

View workflow job for this annotation

GitHub Actions / lint

var-naming: var environmentIdKey should be environmentIDKey (revive)
envKey := &ev.EnvironmentKey{
Tenant: domainProject,
Name: environment.Name,
}
opts := []etcdadpt.OpOptions{
etcdadpt.OpDel(etcdadpt.WithStrKey(path.GenerateEnvironmentIndexKey(envKey))),
etcdadpt.OpDel(etcdadpt.WithStrKey(util.StringJoin([]string{path.GenerateEnvironmentIndexKey(envKey), environmentId}, "/"))),
etcdadpt.OpDel(etcdadpt.WithStrKey(environmentIdKey)),
}
syncOpts, err := esync.GenDeleteOpts(ctx, datasource.ResourceEnvironment, environmentId,
Expand Down
Loading