From b1c546028223efde48e22494d0f6ef759df7c1ea Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 27 Jul 2022 19:23:08 -0500 Subject: [PATCH] Check keyset existence before attempting to distrust --- cmd/kops/distrust_keypair.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/kops/distrust_keypair.go b/cmd/kops/distrust_keypair.go index 9091083eff..7606e78355 100644 --- a/cmd/kops/distrust_keypair.go +++ b/cmd/kops/distrust_keypair.go @@ -148,6 +148,8 @@ func distrustKeypair(out io.Writer, name string, keypairIDs []string, keyStore f keyset, err := keyStore.FindKeyset(name) if err != nil { return err + } else if keyset == nil { + return fmt.Errorf("keyset not found") } if len(keypairIDs) == 0 {