-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added support for customer-managed encryption keys for ANF volumes.
- Loading branch information
1 parent
286f8d6
commit 59bccb7
Showing
13 changed files
with
748 additions
and
183 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,3 +160,4 @@ anfConfigurator: | |
capacityPools: [] | ||
netappAccounts: [] | ||
resourceGroups: [] | ||
customerEncryptionKeys: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
operator/controllers/configurator/storage_drivers/yaml_factory_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package storage_drivers | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestConstructEncryptionKeys(t *testing.T) { | ||
testCases := []struct { | ||
name string | ||
input map[string]string | ||
expected string | ||
}{ | ||
{ | ||
name: "Empty Map", | ||
input: map[string]string{}, | ||
expected: "", | ||
}, | ||
{ | ||
name: "Single Element Map", | ||
input: map[string]string{"key1": "value1"}, | ||
expected: "customerEncryptionKeys:\n key1: value1\n", | ||
}, | ||
} | ||
|
||
for _, tc := range testCases { | ||
t.Run(tc.name, func(t *testing.T) { | ||
result := constructEncryptionKeys(tc.input) | ||
assert.Equal(t, tc.expected, result, "Incorrect string returned") | ||
}) | ||
} | ||
} | ||
|
||
func TestConstructEncryptionKeys_MultiElementMap(t *testing.T) { | ||
input := map[string]string{"key1": "value1", "key2": "value2"} | ||
expected1 := "customerEncryptionKeys:\n key1: value1\n key2: value2\n" | ||
expected2 := "customerEncryptionKeys:\n key2: value2\n key1: value1\n" | ||
|
||
result := constructEncryptionKeys(input) | ||
assert.True(t, result == expected1 || result == expected2, "Incorrect string returned") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.