@@ -83,8 +83,8 @@ type Options struct {
83
83
WriteKeypair WriteKeypairFunc
84
84
ReadyToRequest ReadyToRequestFunc
85
85
86
- // BackoffConfig configures the exponential backoff applied to certificate renewal failures.
87
- BackoffConfig * wait.Backoff
86
+ // RenewalBackoffConfig configures the exponential backoff applied to certificate renewal failures.
87
+ RenewalBackoffConfig * wait.Backoff
88
88
}
89
89
90
90
// NewManager constructs a new manager used to manage volumes containing
@@ -103,8 +103,8 @@ func NewManager(opts Options) (*Manager, error) {
103
103
if opts .Clock == nil {
104
104
opts .Clock = clock.RealClock {}
105
105
}
106
- if opts .BackoffConfig == nil {
107
- opts .BackoffConfig = & wait.Backoff {
106
+ if opts .RenewalBackoffConfig == nil {
107
+ opts .RenewalBackoffConfig = & wait.Backoff {
108
108
// the 'base' amount of time for the backoff
109
109
Duration : time .Second * 30 ,
110
110
// We multiply the 'duration' by 2.0 if the attempt fails/errors
@@ -186,7 +186,7 @@ func NewManager(opts Options) (*Manager, error) {
186
186
187
187
maxRequestsPerVolume : opts .MaxRequestsPerVolume ,
188
188
nodeNameHash : nodeNameHash ,
189
- backoffConfig : * opts .BackoffConfig ,
189
+ backoffConfig : * opts .RenewalBackoffConfig ,
190
190
}
191
191
192
192
vols , err := opts .MetadataReader .ListVolumes ()
@@ -522,7 +522,8 @@ func (m *Manager) submitRequest(ctx context.Context, meta metadata.Metadata, csr
522
522
}
523
523
524
524
// ManageVolumeImmediate will register a volume for management and immediately attempt a single issuance.
525
- // This
525
+ // If issuing the initial certificate succeeds, the background renewal routine will be started similar to Manage().
526
+ // Upon failure, it is the caller's responsibility to explicitly call `UnmanageVolume`.
526
527
func (m * Manager ) ManageVolumeImmediate (ctx context.Context , volumeID string ) (managed bool , err error ) {
527
528
if ! m .manageVolumeIfNotManaged (volumeID ) {
528
529
return false , nil
@@ -633,7 +634,10 @@ func (m *Manager) startRenewalRoutine(volumeID string) (started bool) {
633
634
return true
634
635
}
635
636
636
- // ManageVolume will initiate management of data for the given volumeID.
637
+ // ManageVolume will initiate management of data for the given volumeID. It will not wait for an initial certificate
638
+ // to be issued and instead rely on the renewal handling loop to issue the initial certificate.
639
+ // Callers can use `IsVolumeReady` to determine if a certificate has been successfully issued or not.
640
+ // Upon failure, it is the callers responsibility to call `UnmanageVolume`.
637
641
func (m * Manager ) ManageVolume (volumeID string ) (managed bool ) {
638
642
log := m .log .WithValues ("volume_id" , volumeID )
639
643
if managed := m .manageVolumeIfNotManaged (volumeID ); ! managed {
0 commit comments