From 0d5512da125cc1dcc80860444c3d9f0d0d2e5005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Wei=C3=9Fe?= Date: Thu, 27 Jun 2024 16:11:48 +0200 Subject: [PATCH] generate: check for existing public key in manifest --- cli/cmd/generate.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/cmd/generate.go b/cli/cmd/generate.go index dbbd05dcbf..f702e3d5ef 100644 --- a/cli/cmd/generate.go +++ b/cli/cmd/generate.go @@ -429,7 +429,9 @@ func addSeedshareOwnerKeyToManifest(manifst *manifest.Manifest, keyPath string) default: return fmt.Errorf("unsupported PEM block type: %s", block.Type) } - manifst.SeedshareOwnerPubKeys = append(manifst.SeedshareOwnerPubKeys, publicKey) + if !slices.Contains(manifst.SeedshareOwnerPubKeys, publicKey) { + manifst.SeedshareOwnerPubKeys = append(manifst.SeedshareOwnerPubKeys, publicKey) + } return nil }