@@ -27,13 +27,19 @@ import (
27
27
)
28
28
29
29
const (
30
- EncryptionStart string = "start"
31
- EncryptionPrepare string = "prepare"
32
- EncryptionRotate string = "rotate"
33
- EncryptionRotateKeys string = "rotate_keys"
34
- EncryptionReencryptRequest string = "reencrypt_request"
35
- EncryptionReencryptActive string = "reencrypt_active"
36
- EncryptionReencryptFinished string = "reencrypt_finished"
30
+ EncryptionStart string = "start"
31
+ EncryptionPrepare string = "prepare"
32
+ EncryptionRotate string = "rotate"
33
+ EncryptionRotateKeys string = "rotate_keys"
34
+ EncryptionReencryptRequest string = "reencrypt_request"
35
+ EncryptionReencryptActive string = "reencrypt_active"
36
+ EncryptionReencryptFinished string = "reencrypt_finished"
37
+ SecretListPageSize int64 = 20
38
+ SecretQPS float32 = 200
39
+ SecretBurst int = 200
40
+ SecretsUpdateErrorEvent string = "SecretsUpdateError"
41
+ SecretsProgressEvent string = "SecretsProgress"
42
+ SecretsUpdateCompleteEvent string = "SecretsUpdateComplete"
37
43
)
38
44
39
45
var EncryptionHashAnnotation = version .Program + ".io/encryption-config-hash"
@@ -178,7 +184,9 @@ func BootstrapEncryptionHashAnnotation(node *corev1.Node, runtime *config.Contro
178
184
return nil
179
185
}
180
186
181
- func WriteEncryptionHashAnnotation (runtime * config.ControlRuntime , node * corev1.Node , stage string ) error {
187
+ // WriteEncryptionHashAnnotation writes the encryption hash to the node annotation and optionally to a file.
188
+ // The file is used to track the last stage of the reencryption process.
189
+ func WriteEncryptionHashAnnotation (runtime * config.ControlRuntime , node * corev1.Node , skipFile bool , stage string ) error {
182
190
encryptionConfigHash , err := GenEncryptionConfigHash (runtime )
183
191
if err != nil {
184
192
return err
@@ -192,6 +200,9 @@ func WriteEncryptionHashAnnotation(runtime *config.ControlRuntime, node *corev1.
192
200
return err
193
201
}
194
202
logrus .Debugf ("encryption hash annotation set successfully on node: %s\n " , node .ObjectMeta .Name )
203
+ if skipFile {
204
+ return nil
205
+ }
195
206
return os .WriteFile (runtime .EncryptionHash , []byte (ann ), 0600 )
196
207
}
197
208
0 commit comments