Skip to content

Commit

Permalink
Changed function name
Browse files Browse the repository at this point in the history
  • Loading branch information
mazin-s committed Nov 13, 2023
1 parent df01872 commit 1e6b37d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ndb_api/time_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ import (
ctrllog "sigs.k8s.io/controller-runtime/pkg/log"
)

// Takes a snapshot for a time machine
// Creates a snapshot for a time machine
// Returns the task info summary response for the operation TODO
func TakeSnapshotForTM(
func CreateSnapshotForTM(
ctx context.Context,
ndbClient *ndb_client.NDBClient,
tmName string,
snapshotName string,
expiryDateTimezone string,
ExpireInDays string) (snapshotRequest SnapshotRequest, err error) {
ExpireInDays string) (task TaskInfoSummaryResponse, err error) {

log := ctrllog.FromContext(ctx)
log.Info("Entered ndb_api.TakeSnapshotForTM")
log.Info("Entered ndb_api.CreateSnapshotForTM")
if ndbClient == nil {
err = errors.New("nil reference")
log.Error(err, "Received nil ndbClient reference")
Expand Down Expand Up @@ -69,15 +69,15 @@ func TakeSnapshotForTM(
body, err := io.ReadAll(res.Body)
defer res.Body.Close()
if err != nil {
log.Error(err, "Error occurred reading response.Body in TakeSnapshotForTM")
log.Error(err, "Error occurred reading response.Body in CreateSnapshotForTM")
return
}
err = json.Unmarshal(body, &task)
if err != nil {
log.Error(err, "Error occurred trying to unmarshal.")
return
}
log.Info("Returning from ndb_api.TakeSnapshotForTM")
log.Info("Returning from ndb_api.CreateSnapshotForTM")
return
}

Expand Down

0 comments on commit 1e6b37d

Please sign in to comment.