Closed erikgb closed 1 week ago
I struggled to find good names for the new config props, so please let me know if you have better suggestions!
I think the current name works fine, but how about simplifying it to
excludeLabelKeys
,excludeAnnotationKeys
?
I looked in that direction, but I fear some confusion with the existing labelKeys
/annotationKeys
which denotes labels/annotations on namespaces - which is a quite different configuration. Maybe @ymmt2005 has some input here?
@erikgb @zoetrope Thank you for fixing the issue.
I agree that exclucdeLabelKeys
would be confusing, and I'm fine with Eric's suggestion.
@erikgb @ymmt2005 Alright, let's merge it as is.
This PR proposes an implementation of https://github.com/cybozu-go/accurate/issues/53. I have tried to keep changes to a minimum though it seems like the code could benefit from some simple refactorings after this change.
I struggled to find good names for the new config props, so please let me know if you have better suggestions!
The change is theoretically not 100% backwards compatible, as
strings.Contains(k, "kubernetes.io/")
will potentially exclude more thanpath.Match("*kubernetes.io/*", key)
, but IMO it should give the same results for typical labels, at least https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/.Closes https://github.com/cybozu-go/accurate/issues/53