Skip to content

Commit

Permalink
Merge pull request #224 from bshephar/consistent-requeue-timer
Browse files Browse the repository at this point in the history
Use consistent method for setting time.Second * n
  • Loading branch information
openshift-merge-robot authored Aug 23, 2023
2 parents db2efdd + db1057c commit 8088a88
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions controllers/heat_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func (r *HeatReconciler) reconcileNormal(ctx context.Context, instance *heatv1be
condition.SeverityInfo,
condition.RabbitMqTransportURLReadyRunningMessage))

return ctrl.Result{RequeueAfter: time.Duration(10) * time.Second}, nil
return ctrl.Result{RequeueAfter: time.Second * 10}, nil
}

//
Expand All @@ -373,7 +373,7 @@ func (r *HeatReconciler) reconcileNormal(ctx context.Context, instance *heatv1be
condition.RequestedReason,
condition.SeverityInfo,
condition.RabbitMqTransportURLReadyRunningMessage))
return ctrl.Result{RequeueAfter: time.Duration(10) * time.Second}, fmt.Errorf("TransportURL secret %s not found", instance.Status.TransportURLSecret)
return ctrl.Result{RequeueAfter: time.Second * 10}, fmt.Errorf("TransportURL secret %s not found", instance.Status.TransportURLSecret)
}
instance.Status.Conditions.Set(condition.FalseCondition(
condition.RabbitMqTransportURLReadyCondition,
Expand Down Expand Up @@ -627,7 +627,7 @@ func (r *HeatReconciler) reconcileInit(ctx context.Context,
jobDef,
heatv1beta1.DbSyncHash,
instance.Spec.PreserveJobs,
time.Duration(5)*time.Second,
time.Second * 10,
dbSyncHash,
)
ctrlResult, err = dbSyncjob.DoJob(
Expand Down
8 changes: 4 additions & 4 deletions controllers/heatapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func (r *HeatAPIReconciler) reconcileInit(
heatapi.ServiceName,
serviceLabels,
data,
time.Duration(5)*time.Second,
time.Second * 5,
)
if err != nil {
instance.Status.Conditions.Set(condition.FalseCondition(
Expand Down Expand Up @@ -331,7 +331,7 @@ func (r *HeatAPIReconciler) reconcileInit(
PasswordSelector: instance.Spec.PasswordSelectors.Service,
}

ksSvcObj := keystonev1.NewKeystoneService(ksSvcSpec, instance.Namespace, serviceLabels, time.Duration(10)*time.Second)
ksSvcObj := keystonev1.NewKeystoneService(ksSvcSpec, instance.Namespace, serviceLabels, time.Second * 10)
ctrlResult, err = ksSvcObj.CreateOrPatch(ctx, helper)
if err != nil || (ctrlResult != ctrl.Result{}) {
return ctrlResult, err
Expand All @@ -356,7 +356,7 @@ func (r *HeatAPIReconciler) reconcileInit(
instance.Namespace,
ksEndptSpec,
serviceLabels,
time.Duration(10)*time.Second)
time.Second * 10)
ctrlResult, err = ksEndpt.CreateOrPatch(ctx, helper)
if err != nil || (ctrlResult != ctrl.Result{}) {
return ctrlResult, err
Expand Down Expand Up @@ -526,7 +526,7 @@ func (r *HeatAPIReconciler) reconcileNormal(ctx context.Context, instance *heatv
// Define a new Deployment object
depl := deployment.NewDeployment(
heatapi.Deployment(instance, inputHash, serviceLabels),
time.Duration(5)*time.Second,
time.Second * 5,
)

ctrlResult, err = depl.CreateOrPatch(ctx, helper)
Expand Down
8 changes: 4 additions & 4 deletions controllers/heatcfnapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func (r *HeatCfnAPIReconciler) reconcileInit(
heatcfnapi.ServiceName,
serviceLabels,
data,
time.Duration(5)*time.Second,
time.Second * 5,
)
if err != nil {
instance.Status.Conditions.Set(condition.FalseCondition(
Expand Down Expand Up @@ -335,7 +335,7 @@ func (r *HeatCfnAPIReconciler) reconcileInit(
PasswordSelector: instance.Spec.PasswordSelectors.Service,
}

ksSvcObj := keystonev1.NewKeystoneService(ksSvcSpec, instance.Namespace, serviceLabels, time.Duration(10)*time.Second)
ksSvcObj := keystonev1.NewKeystoneService(ksSvcSpec, instance.Namespace, serviceLabels, time.Second * 10)
ctrlResult, err = ksSvcObj.CreateOrPatch(ctx, helper)
if err != nil || (ctrlResult != ctrl.Result{}) {
return ctrlResult, err
Expand All @@ -360,7 +360,7 @@ func (r *HeatCfnAPIReconciler) reconcileInit(
instance.Namespace,
ksEndptSpec,
serviceLabels,
time.Duration(10)*time.Second)
time.Second * 10)
ctrlResult, err = ksEndpt.CreateOrPatch(ctx, helper)
if err != nil || (ctrlResult != ctrl.Result{}) {
return ctrlResult, err
Expand Down Expand Up @@ -530,7 +530,7 @@ func (r *HeatCfnAPIReconciler) reconcileNormal(ctx context.Context, instance *he
// Define a new Deployment object
depl := deployment.NewDeployment(
heatcfnapi.Deployment(instance, inputHash, serviceLabels),
time.Duration(5)*time.Second,
time.Second * 10,
)

ctrlResult, err = depl.CreateOrPatch(ctx, helper)
Expand Down
2 changes: 1 addition & 1 deletion controllers/heatengine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ func (r *HeatEngineReconciler) reconcileNormal(

depl := deployment.NewDeployment(
heatengine.Deployment(instance, inputHash, serviceLabels),
time.Duration(5)*time.Second,
time.Second * 5,
)

ctrlResult, err = depl.CreateOrPatch(ctx, helper)
Expand Down

0 comments on commit 8088a88

Please sign in to comment.