Updated docs and code for default nil behavior

Signed-off-by: Brandon Lum <lumjjb@gmail.com>
This commit is contained in:
Brandon Lum
2020-02-24 22:09:43 +00:00
parent 808ae59cf6
commit 8d5a8355d0
9 changed files with 57 additions and 31 deletions

View File

@@ -295,17 +295,17 @@ func TestEncryptedImagePullOpts(t *testing.T) {
expectedOpts int
}{
"node key model should return one unpack opt": {
keyModel: criconfig.EncryptionKeyModelNode,
keyModel: criconfig.KeyModelNode,
expectedOpts: 1,
},
"no key model selected should default to node key model": {
keyModel: "",
expectedOpts: 1,
expectedOpts: 0,
},
} {
t.Logf("TestCase %q", desc)
c := newTestCRIService()
c.config.ImageEncryption.KeyModel = test.keyModel
c.config.ImageDecryption.KeyModel = test.keyModel
got := len(c.encryptedImagesPullOpts())
assert.Equal(t, test.expectedOpts, got)
}