@@ -187,6 +187,9 @@ func NewManager(opts Options) (*Manager, error) {
187
187
maxRequestsPerVolume : opts .MaxRequestsPerVolume ,
188
188
nodeNameHash : nodeNameHash ,
189
189
backoffConfig : * opts .RenewalBackoffConfig ,
190
+ requestNameGenerator : func () string {
191
+ return string (uuid .NewUUID ())
192
+ },
190
193
}
191
194
192
195
vols , err := opts .MetadataReader .ListVolumes ()
@@ -285,6 +288,10 @@ type Manager struct {
285
288
286
289
// backoffConfig configures the exponential backoff applied to certificate renewal failures.
287
290
backoffConfig wait.Backoff
291
+
292
+ // requestNameGenerator generates a new random name for a certificaterequest object
293
+ // Defaults to uuid.NewUUID() from k8s.io/apimachinery/pkg/util/uuid.
294
+ requestNameGenerator func () string
288
295
}
289
296
290
297
// issue will step through the entire issuance flow for a volume.
@@ -467,7 +474,7 @@ func (m *Manager) labelSelectorForVolume(volumeID string) (labels.Selector, erro
467
474
func (m * Manager ) submitRequest (ctx context.Context , meta metadata.Metadata , csrBundle * CertificateRequestBundle , csrPEM []byte ) (* cmapi.CertificateRequest , error ) {
468
475
req := & cmapi.CertificateRequest {
469
476
ObjectMeta : metav1.ObjectMeta {
470
- Name : string ( uuid . NewUUID () ),
477
+ Name : m . requestNameGenerator ( ),
471
478
Namespace : csrBundle .Namespace ,
472
479
Annotations : csrBundle .Annotations ,
473
480
Labels : map [string ]string {
0 commit comments