Summary
There's a debug message Failed to apply normalization which is unhelpful and confusing
Motivation
#2933, #8113, #11088
I'm running a debug v2.8-ish build w/ debug logging enabled and I get a lot of:
Failed to apply normalization: error in remove for path: '/status': Unable to remove nonexistent key: status: missing value
Failed to apply normalization: error in remove for path: '/spec/preserveUnknownFields': Unable to remove nonexistent key: preserveUnknownFields: missing value
Proposal
The message should provide enough information to be actionable.
- If it's purely informational, it shouldn't say
Failed, that's too scary.
- It should hint at where the thing came from and why it was trying to remove something.
Offhand this appears to be from:
https://github.com/argoproj/argo-cd/blob/4ca903bf38e06407a7c139e6f7c1abb6c7ef8ad7/util/settings/settings.go#LL848C1-L849C1
|
crdGK := "apiextensions.k8s.io/CustomResourceDefinition" |
|
crdPrsvUnkn := "/spec/preserveUnknownFields" |
|
|
|
switch diffOptions.IgnoreResourceStatusField { |
|
case "", "crd": |
|
addStatusOverrideToGK(resourceOverrides, crdGK) |
|
addIgnoreDiffItemOverrideToGK(resourceOverrides, crdGK, crdPrsvUnkn) |
And reported here:
|
log.Debugf("Failed to apply normalization: %v", err) |
Since this is apparently a very expected thing because it's forced by the code as-is, it shouldn't present itself as it does.
I have no idea what it's doing, since apparently it's trying to remove /status from something but it doesn't tell me what the something it's operating on -- generally speaking that's an important detail.
Effectively, some portion of docData needs to be provided in the warning.
Summary
There's a debug message
Failed to apply normalizationwhich is unhelpful and confusingMotivation
#2933, #8113, #11088
I'm running a debug v2.8-ish build w/ debug logging enabled and I get a lot of:
Proposal
The message should provide enough information to be actionable.
Failed, that's too scary.Offhand this appears to be from:
https://github.com/argoproj/argo-cd/blob/4ca903bf38e06407a7c139e6f7c1abb6c7ef8ad7/util/settings/settings.go#LL848C1-L849C1
argo-cd/util/settings/settings.go
Lines 824 to 830 in 4ca903b
And reported here:
argo-cd/util/argo/normalizers/diff_normalizer.go
Line 182 in 4ca903b
Since this is apparently a very expected thing because it's forced by the code as-is, it shouldn't present itself as it does.
I have no idea what it's doing, since apparently it's trying to remove
/statusfrom something but it doesn't tell me what the something it's operating on -- generally speaking that's an important detail.Effectively, some portion of
docDataneeds to be provided in the warning.