set default report time

Signed-off-by: David Wertenteil <dwertent@armosec.io>
This commit is contained in:
David Wertenteil
2023-04-09 11:15:06 +02:00
parent 875deb7ec3
commit 91c13381b2
2 changed files with 4 additions and 1 deletions
@@ -7,6 +7,7 @@ import (
"net/http"
"net/url"
"os"
"time"
"github.com/armosec/armoapi-go/apis"
logger "github.com/kubescape/go-logger"
@@ -35,6 +36,7 @@ const (
var _ reporter.IReport = &ReportEventReceiver{}
type ReportEventReceiver struct {
reportTime time.Time
httpClient *http.Client
clusterName string
customerGUID string
@@ -55,6 +57,7 @@ func NewReportEventReceiver(tenantConfig *cautils.ConfigObj, reportID string, su
customerAdminEMail: tenantConfig.CustomerAdminEMail,
reportID: reportID,
submitContext: submitContext,
reportTime: time.Now().UTC(),
}
}
@@ -37,7 +37,7 @@ func (report *ReportEventReceiver) setSubReport(opaSessionObj *cautils.OPASessio
CustomerGUID: report.customerGUID,
ClusterName: report.clusterName,
ReportID: report.reportID,
ReportGenerationTime: opaSessionObj.Report.ReportGenerationTime,
ReportGenerationTime: report.reportTime,
SummaryDetails: opaSessionObj.Report.SummaryDetails,
Attributes: opaSessionObj.Report.Attributes,
ClusterAPIServerInfo: opaSessionObj.Report.ClusterAPIServerInfo,