diff --git a/cmd/kops/distrust_keypair.go b/cmd/kops/distrust_keypair.go index f14b7b3430589..5b1091972345b 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 {