Skip to content

Commit

Permalink
Change TTL to 1 hour
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin D <[email protected]>
  • Loading branch information
kevdowney committed Jun 9, 2021
1 parent 1bf9266 commit 58ba0ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controllers/addon_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import (
)

// addon ttl time
const TTL int64 = int64((time.Duration(1) * time.Hour) / time.Millisecond) // 1 hour
const TTL = time.Duration(1) * time.Hour // 1 hour

// Watched resources
var (
Expand Down Expand Up @@ -241,8 +241,8 @@ func (r *AddonReconciler) processAddon(ctx context.Context, req reconcile.Reques
}

// Check if addon installation expired.
if instance.Status.Lifecycle.Installed == addonmgrv1alpha1.Pending && common.IsExpired(instance.Status.StartTime, TTL) {
reason := fmt.Sprintf("Addon %s/%s ttl expired, starttime was %d", instance.Namespace, instance.Name, instance.Status.StartTime)
if instance.Status.Lifecycle.Installed == addonmgrv1alpha1.Pending && common.IsExpired(instance.Status.StartTime, TTL.Milliseconds()) {
reason := fmt.Sprintf("Addon %s/%s ttl expired, starttime exceeded %s", instance.Namespace, instance.Name, TTL.String())
r.recorder.Event(instance, "Warning", "Failed", reason)
err := fmt.Errorf(reason)
log.Error(err, reason)
Expand Down

0 comments on commit 58ba0ce

Please sign in to comment.