Skip to content

Commit

Permalink
Merge pull request #316 from syntasso/healthrecordlastrun
Browse files Browse the repository at this point in the history
chore: update healthRecord lastRun type to int64
  • Loading branch information
ChunyiLyu authored Jan 7, 2025
2 parents 3b513b8 + c5ce197 commit 6a2b641
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha1/healthrecord_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type HealthRecordData struct {
State string `json:"state"`

// Timestamp of the last healthcheck run
LastRun string `json:"lastRun,omitempty"`
LastRun int64 `json:"lastRun,omitempty"`

// +kubebuilder:pruning:PreserveUnknownFields
// +kubebuilder:validation:Optional
Expand Down
3 changes: 2 additions & 1 deletion config/crd/bases/platform.kratix.io_healthrecords.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ spec:
x-kubernetes-preserve-unknown-fields: true
lastRun:
description: Timestamp of the last healthcheck run
type: string
format: int64
type: integer
promiseRef:
properties:
name:
Expand Down
3 changes: 1 addition & 2 deletions controllers/healthrecord_controller_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package controllers_test

import (
"fmt"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -55,7 +54,7 @@ var _ = Describe("HealthRecordController", func() {
PromiseRef: v1alpha1.PromiseRef{Name: promise.GetName()},
ResourceRef: v1alpha1.ResourceRef{Name: resource.GetName(), Namespace: resource.GetNamespace()},
State: "healthy",
LastRun: fmt.Sprintf("%d", time.Now().Unix()),
LastRun: time.Now().Unix(),
Details: details,
},
}
Expand Down
2 changes: 1 addition & 1 deletion test/system/healthchecks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ var _ = Describe("Kratix Healthcheck", func() {
PromiseRef: v1alpha1.PromiseRef{Name: bashPromiseName},
ResourceRef: v1alpha1.ResourceRef{Name: rrName, Namespace: "default", Generation: 1},
State: "healthy",
LastRun: fmt.Sprintf("%d", time.Now().Unix()),
LastRun: time.Now().Unix(),
Details: &runtime.RawExtension{
Raw: []byte(`{"info":"message", "errors": [{"message": "error"}]}`),
},
Expand Down

0 comments on commit 6a2b641

Please sign in to comment.