From 29a27ff845c02806da275a128b8b884a00164fa4 Mon Sep 17 00:00:00 2001 From: Mark Stansberry Date: Tue, 1 Sep 2020 14:15:44 -0400 Subject: [PATCH] Add support for JFrog Container Registry (#44) --- collector/collector.go | 2 +- collector/system.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/collector/collector.go b/collector/collector.go index bee40a5..c9653c0 100755 --- a/collector/collector.go +++ b/collector/collector.go @@ -119,7 +119,7 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) (up float64) { } licenseType = strings.ToLower(license.Type) // Some API endpoints are not available in OSS - if licenseType != "oss" { + if licenseType != "oss" && licenseType != "jcr edition" { for metricName, metric := range securityMetrics { switch metricName { case "users": diff --git a/collector/system.go b/collector/system.go index 10f7086..45e195a 100644 --- a/collector/system.go +++ b/collector/system.go @@ -34,7 +34,7 @@ func (e *Exporter) exportSystem(license artifactory.LicenseInfo, ch chan<- prome var validThrough float64 timeNow := float64(time.Now().Unix()) switch licenseType { - case "oss": + case "oss", "jcr edition": validThrough = timeNow default: if validThroughTime, err := time.Parse("Jan 2, 2006", license.ValidThrough); err != nil {