Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/praefect/subcmd_remove_repository.go')
-rw-r--r--cmd/praefect/subcmd_remove_repository.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/cmd/praefect/subcmd_remove_repository.go b/cmd/praefect/subcmd_remove_repository.go
index f6ee01358..49b049615 100644
--- a/cmd/praefect/subcmd_remove_repository.go
+++ b/cmd/praefect/subcmd_remove_repository.go
@@ -241,11 +241,7 @@ func (cmd *removeRepository) removeRepository(ctx context.Context, repo *gitalyp
ctx = metadata.AppendToOutgoingContext(ctx, "client_name", removeRepositoryCmdName)
repositoryClient := gitalypb.NewRepositoryServiceClient(conn)
if _, err := repositoryClient.RemoveRepository(ctx, &gitalypb.RemoveRepositoryRequest{Repository: repo}); err != nil {
- s, ok := status.FromError(err)
- if !ok {
- return false, fmt.Errorf("RemoveRepository: %w", err)
- }
- if !strings.Contains(s.Message(), fmt.Sprintf("get primary: repository %q/%q not found", cmd.virtualStorage, cmd.relativePath)) {
+ if _, ok := status.FromError(err); !ok {
return false, fmt.Errorf("RemoveRepository: %w", err)
}
return false, nil
@@ -312,8 +308,9 @@ func (cmd *removeRepository) removeNode(
} else {
if removed {
fmt.Fprintf(cmd.w, "Successfully removed %s from %s\n", cmd.relativePath, node.Storage)
+ } else {
+ fmt.Fprintf(cmd.w, "Did not remove %s from %s\n", cmd.relativePath, node.Storage)
}
- fmt.Fprintf(cmd.w, "Did not remove %s from %s\n", cmd.relativePath, node.Storage)
}
logger.Debugf("repository removal call to gitaly %q completed", node.Storage)
}