Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pkg/service-reservations/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ type ServiceReservation interface {

InitInstance(stateManagerServer string, reservationPath string, defaultTermMinutes int, logger *logrus.Logger, svcName string)

//Initialize with a custom http client (for example with OAuth2 transport)
InitWithHTTPClient(stateManagerServer string, reservationPath string, defaultTermMinutes int, logger *logrus.Logger, svcName string, httpClient *retryablehttp.Client)

//Try to aquire locks for a list of xnames, renewing them within 30 seconds of expiration.
Aquire(xnames []string) error

Expand Down Expand Up @@ -179,6 +182,12 @@ func (i *Production) InitInstance(stateManagerServer string, reservationPath str
i.Init(stateManagerServer, reservationPath, defaultTermMinutes, logger)
}

// Initialize with a custom http client (for example with OAuth2 transport)
func (i *Production) InitWithHTTPClient(stateManagerServer string, reservationPath string, defaultTermMinutes int, logger *logrus.Logger, svcName string, httpClient *retryablehttp.Client) {
i.InitInstance(stateManagerServer, reservationPath, defaultTermMinutes, logger, svcName)
i.httpClient = httpClient
}

// Lets make this really simple; Im going to wake up and see what expires in the next 30 seconds;
// then I will renew those things
func (i *Production) doRenewal() {
Expand Down
Loading