Skip to content

Commit

Permalink
fix(datastore): oldest run update panic
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan-pad committed Apr 26, 2024
1 parent 286e6e9 commit cb65e5d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/controllers/terraformlayer/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/padok-team/burrito/internal/lock"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/tools/record"
Expand Down Expand Up @@ -145,7 +146,9 @@ func getRun(run configv1alpha1.TerraformRun) configv1alpha1.TerraformLayerRun {
}

func updateLatestRuns(runs []configv1alpha1.TerraformLayerRun, run configv1alpha1.TerraformRun) []configv1alpha1.TerraformLayerRun {
var oldestRun *configv1alpha1.TerraformLayerRun
oldestRun := &configv1alpha1.TerraformLayerRun{
Date: metav1.NewTime(time.Now()),
}
var oldestRunIndex int
newRun := getRun(run)
for i, r := range runs {
Expand Down

0 comments on commit cb65e5d

Please sign in to comment.