Skip to content

Commit

Permalink
pr review
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Bacher <[email protected]>
  • Loading branch information
bacherfl committed Oct 20, 2022
1 parent 2f29775 commit a47d0a3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 19 deletions.
4 changes: 1 addition & 3 deletions operator/controllers/keptnappversion/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ func (r *KeptnAppVersionReconciler) Reconcile(ctx context.Context, req ctrl.Requ
return reconcile.Result{}, fmt.Errorf("could not fetch KeptnappVersion: %+v", err)
}

if !appVersion.IsStartTimeSet() {
appVersion.SetStartTime()
}
appVersion.SetStartTime()

traceContextCarrier := propagation.MapCarrier(appVersion.Annotations)
ctx = otel.GetTextMapPropagator().Extract(ctx, traceContextCarrier)
Expand Down
8 changes: 2 additions & 6 deletions operator/controllers/keptnevaluation/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ func (r *KeptnEvaluationReconciler) Reconcile(ctx context.Context, req ctrl.Requ

semconv.AddAttributeFromEvaluation(span, *evaluation)

if !evaluation.IsStartTimeSet() {
evaluation.SetStartTime()
}
evaluation.SetStartTime()

if evaluation.Status.RetryCount >= evaluation.Spec.Retries {
r.recordEvent("Warning", evaluation, "ReconcileTimeOut", "retryCount exceeded")
Expand Down Expand Up @@ -180,9 +178,7 @@ func (r *KeptnEvaluationReconciler) Reconcile(ctx context.Context, req ctrl.Requ
func (r *KeptnEvaluationReconciler) updateFinishedEvaluationMetrics(ctx context.Context, evaluation *klcv1alpha1.KeptnEvaluation, span trace.Span) error {
r.recordEvent("Normal", evaluation, string(evaluation.Status.OverallStatus), "the evaluation has "+string(evaluation.Status.OverallStatus))

if !evaluation.IsEndTimeSet() {
evaluation.SetEndTime()
}
evaluation.SetEndTime()

err := r.Client.Status().Update(ctx, evaluation)
if err != nil {
Expand Down
9 changes: 2 additions & 7 deletions operator/controllers/keptntask/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ func (r *KeptnTaskReconciler) Reconcile(ctx context.Context, req ctrl.Request) (

semconv.AddAttributeFromTask(span, *task)

if !task.IsStartTimeSet() {
task.SetStartTime()
}
task.SetStartTime()

err := r.Client.Status().Update(ctx, task)
if err != nil {
Expand Down Expand Up @@ -115,10 +113,7 @@ func (r *KeptnTaskReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
r.Log.Info("Finished Reconciling KeptnTask")

// Task is completed at this place

if !task.IsEndTimeSet() {
task.SetEndTime()
}
task.SetEndTime()

err = r.Client.Status().Update(ctx, task)
if err != nil {
Expand Down
4 changes: 1 addition & 3 deletions operator/controllers/keptnworkloadinstance/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ func (r *KeptnWorkloadInstanceReconciler) Reconcile(ctx context.Context, req ctr

semconv.AddAttributeFromWorkloadInstance(span, *workloadInstance)

if !workloadInstance.IsStartTimeSet() {
workloadInstance.SetStartTime()
}
workloadInstance.SetStartTime()

//Wait for pre-evaluation checks of App
phase := common.PhaseAppPreEvaluation
Expand Down

0 comments on commit a47d0a3

Please sign in to comment.