Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghaoran1988 committed Feb 5, 2019
1 parent 88a6f21 commit 0997048
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/collector/csr.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ func addCSRConditionMetrics(cs certv1beta1.CertificateSigningRequestStatus) []*m
}
}
}
//"approved" if a certificate request has the
// "Approved" condition and no "Denied" conditions; false otherwise.
approved = approved && !denied

return []*metric.Metric{
&metric.Metric{
LabelValues: []string{"issued"},
Expand All @@ -130,7 +134,7 @@ func addCSRConditionMetrics(cs certv1beta1.CertificateSigningRequestStatus) []*m
},
&metric.Metric{
LabelValues: []string{"pending"},
Value: boolFloat64(len(cs.Certificate) == 0),
Value: boolFloat64(!(approved || denied)),
LabelKeys: []string{"csr_condition"},
},
&metric.Metric{
Expand All @@ -140,7 +144,7 @@ func addCSRConditionMetrics(cs certv1beta1.CertificateSigningRequestStatus) []*m
},
&metric.Metric{
LabelValues: []string{"denied"},
Value: boolFloat64(denied),
Value: boolFloat64(!approved),
LabelKeys: []string{"csr_condition"},
},
}
Expand Down

0 comments on commit 0997048

Please sign in to comment.