joe-elliott / cert-exporter

A Prometheus exporter that publishes cert expirations on disk and in Kubernetes secrets
Apache License 2.0
317 stars 87 forks source link

Label annotation selector optional #28

Closed jenting closed 4 years ago

jenting commented 4 years ago

The user might create a TLS secret manually, and by default, the secret won't have a label or annotation on it but the user still want to monitor the TLS secret certificates.

Therefore, it would be good to change the secret behavior that must provides flag -secrets-include-glob and make flags -secrets-label-selector and -secrets-annotation-selector be optional.

joe-elliott commented 4 years ago

I like this idea generally, but I don't like that it breaks backwards compatibility.

Is there a reason not to do just this:

if len(secretsLabelSelector) > 0 || len(secretsAnnotationSelector) > 0 || len(includeSecretsDataGlobs) > 0 {
jenting commented 4 years ago

Is there a reason not to do just this:

if len(secretsLabelSelector) > 0 || len(secretsAnnotationSelector) > 0 || len(includeSecretsDataGlobs) > 0 {

@joe-elliott Thanks for the hint, I did not think this before.

joe-elliott commented 4 years ago

Thank you for the contribution!