mirror of
https://github.com/getsops/sops.git
synced 2026-02-05 21:45:26 +01:00
Remove unnecessary nil checks.
Signed-off-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@@ -79,7 +79,7 @@ func NewMasterKeyFromURL(url string) (*MasterKey, error) {
|
||||
url = strings.TrimSpace(url)
|
||||
re := regexp.MustCompile("^(https://[^/]+)/keys/([^/]+)/([^/]+)$")
|
||||
parts := re.FindStringSubmatch(url)
|
||||
if parts == nil || len(parts) < 3 {
|
||||
if len(parts) < 3 {
|
||||
return nil, fmt.Errorf("could not parse %q into a valid Azure Key Vault MasterKey", url)
|
||||
}
|
||||
return NewMasterKey(parts[1], parts[2], parts[3]), nil
|
||||
|
||||
@@ -222,7 +222,7 @@ func GetKMSKeyWithEncryptionCtx(tree *sops.Tree) (keyGroupIndex int, keyIndex in
|
||||
for n, k := range kg {
|
||||
kmsKey, ok := k.(*kms.MasterKey)
|
||||
if ok {
|
||||
if kmsKey.EncryptionContext != nil && len(kmsKey.EncryptionContext) >= 2 {
|
||||
if len(kmsKey.EncryptionContext) >= 2 {
|
||||
duplicateValues := map[string]int{}
|
||||
for _, v := range kmsKey.EncryptionContext {
|
||||
duplicateValues[*v] = duplicateValues[*v] + 1
|
||||
|
||||
Reference in New Issue
Block a user