@@ -82,7 +82,7 @@ func TestApplyGMSAConfig(t *testing.T) {
82
82
defer setRandomReader (randomBytes )()
83
83
84
84
createConfig := & dockertypes.ContainerCreateConfig {}
85
- cleanupInfo := & containerCreationCleanupInfo {}
85
+ cleanupInfo := & containerCleanupInfo {}
86
86
err := applyGMSAConfig (containerConfigWithGMSAAnnotation , createConfig , cleanupInfo )
87
87
88
88
assert .Nil (t , err )
@@ -105,7 +105,7 @@ func TestApplyGMSAConfig(t *testing.T) {
105
105
defer setRegistryCreateKeyFunc (t , & dummyRegistryKey {})()
106
106
107
107
createConfig := & dockertypes.ContainerCreateConfig {}
108
- cleanupInfo := & containerCreationCleanupInfo {}
108
+ cleanupInfo := & containerCleanupInfo {}
109
109
err := applyGMSAConfig (containerConfigWithGMSAAnnotation , createConfig , cleanupInfo )
110
110
111
111
assert .Nil (t , err )
@@ -127,15 +127,15 @@ func TestApplyGMSAConfig(t *testing.T) {
127
127
t .Run ("when there's an error generating the random value name" , func (t * testing.T ) {
128
128
defer setRandomReader ([]byte {})()
129
129
130
- err := applyGMSAConfig (containerConfigWithGMSAAnnotation , & dockertypes.ContainerCreateConfig {}, & containerCreationCleanupInfo {})
130
+ err := applyGMSAConfig (containerConfigWithGMSAAnnotation , & dockertypes.ContainerCreateConfig {}, & containerCleanupInfo {})
131
131
132
132
require .NotNil (t , err )
133
133
assert .Contains (t , err .Error (), "error when generating gMSA registry value name: unable to generate random string" )
134
134
})
135
135
t .Run ("if there's an error opening the registry key" , func (t * testing.T ) {
136
136
defer setRegistryCreateKeyFunc (t , & dummyRegistryKey {}, fmt .Errorf ("dummy error" ))()
137
137
138
- err := applyGMSAConfig (containerConfigWithGMSAAnnotation , & dockertypes.ContainerCreateConfig {}, & containerCreationCleanupInfo {})
138
+ err := applyGMSAConfig (containerConfigWithGMSAAnnotation , & dockertypes.ContainerCreateConfig {}, & containerCleanupInfo {})
139
139
140
140
require .NotNil (t , err )
141
141
assert .Contains (t , err .Error (), "unable to open registry key" )
@@ -145,7 +145,7 @@ func TestApplyGMSAConfig(t *testing.T) {
145
145
key .setStringValueError = fmt .Errorf ("dummy error" )
146
146
defer setRegistryCreateKeyFunc (t , key )()
147
147
148
- err := applyGMSAConfig (containerConfigWithGMSAAnnotation , & dockertypes.ContainerCreateConfig {}, & containerCreationCleanupInfo {})
148
+ err := applyGMSAConfig (containerConfigWithGMSAAnnotation , & dockertypes.ContainerCreateConfig {}, & containerCleanupInfo {})
149
149
150
150
if assert .NotNil (t , err ) {
151
151
assert .Contains (t , err .Error (), "unable to write into registry value" )
@@ -155,7 +155,7 @@ func TestApplyGMSAConfig(t *testing.T) {
155
155
t .Run ("if there is no GMSA annotation" , func (t * testing.T ) {
156
156
createConfig := & dockertypes.ContainerCreateConfig {}
157
157
158
- err := applyGMSAConfig (& runtimeapi.ContainerConfig {}, createConfig , & containerCreationCleanupInfo {})
158
+ err := applyGMSAConfig (& runtimeapi.ContainerConfig {}, createConfig , & containerCleanupInfo {})
159
159
160
160
assert .Nil (t , err )
161
161
assert .Nil (t , createConfig .HostConfig )
@@ -164,7 +164,7 @@ func TestApplyGMSAConfig(t *testing.T) {
164
164
165
165
func TestRemoveGMSARegistryValue (t * testing.T ) {
166
166
valueName := "k8s-cred-spec-1900254518529e2a3dedb85cdec03ce270559647459ab531f07af5eb1c5495fda709435ce82ab89c"
167
- cleanupInfoWithValue := & containerCreationCleanupInfo {gMSARegistryValueName : valueName }
167
+ cleanupInfoWithValue := & containerCleanupInfo {gMSARegistryValueName : valueName }
168
168
169
169
t .Run ("it does remove the registry value" , func (t * testing.T ) {
170
170
key := & dummyRegistryKey {}
@@ -204,7 +204,7 @@ func TestRemoveGMSARegistryValue(t *testing.T) {
204
204
key := & dummyRegistryKey {}
205
205
defer setRegistryCreateKeyFunc (t , key )()
206
206
207
- err := removeGMSARegistryValue (& containerCreationCleanupInfo {})
207
+ err := removeGMSARegistryValue (& containerCleanupInfo {})
208
208
209
209
assert .Nil (t , err )
210
210
assert .Equal (t , 0 , len (key .deleteValueArgs ))
0 commit comments