Skip to content

Commit

Permalink
Add work with Artifactory Community Edition for C/C++ (#91)
Browse files Browse the repository at this point in the history
* Add license type for Artifactory CE

* fix case with OSS license
  • Loading branch information
den-patrakeev committed Dec 30, 2022
1 parent e2fa887 commit 0f7b777
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,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" && licenseType != "jcr edition" {
if licenseType != "oss" && licenseType != "jcr edition" && licenseType != "community edition for c/c++" {
for metricName, metric := range securityMetrics {
switch metricName {
case "users":
Expand Down
2 changes: 1 addition & 1 deletion collector/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -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", "jcr edition":
case "oss", "jcr edition", "community edition for c/c++":
validThrough = timeNow
default:
if validThroughTime, err := time.Parse("Jan 2, 2006", license.ValidThrough); err != nil {
Expand Down

0 comments on commit 0f7b777

Please sign in to comment.