You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2021/03/12 15:39:39 UTC

[camel-k] 08/10: chore: Round condition time as Time fields are marshalled in RFC3339 format

This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit eac4a58ab3a6e0d33695f8059013c0bfe598abca
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Fri Mar 12 12:22:34 2021 +0100

    chore: Round condition time as Time fields are marshalled in RFC3339 format
---
 pkg/apis/camel/v1/integration_types_support.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pkg/apis/camel/v1/integration_types_support.go b/pkg/apis/camel/v1/integration_types_support.go
index 34d973b..ec7334d 100644
--- a/pkg/apis/camel/v1/integration_types_support.go
+++ b/pkg/apis/camel/v1/integration_types_support.go
@@ -20,6 +20,7 @@ package v1
 import (
 	"fmt"
 	"strings"
+	"time"
 
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -333,7 +334,8 @@ func (in *IntegrationStatus) SetErrorCondition(condType IntegrationConditionType
 // If a condition that we are about to add already exists and has the same status and
 // reason then we are not going to update.
 func (in *IntegrationStatus) SetConditions(conditions ...IntegrationCondition) {
-	now := metav1.Now()
+	// Round to second precision, as meta.Time fields are marshalled in RFC3339 format
+	now := metav1.NewTime(time.Now().Round(time.Second))
 	for _, condition := range conditions {
 		currentCond := in.GetCondition(condition.Type)