mirror of https://github.com/helm/helm
Replace fragile string matching in isDuplicateKeyError with a type-based check using errors.As and *yamlv2.TypeError, combined with content checking for "already set in map". The error from sigs.k8s.io/yaml wraps the underlying yaml.TypeError, and errors.As properly unwraps it. This eliminates the dead code branches for "already defined" and "duplicate" strings that were never produced by the yaml parser, while still being precise enough to not misclassify other yaml.TypeError variants as duplicate key errors. Signed-off-by: Kartik Suryavanshi <kartiksuryavanshi@users.noreply.github.com> Signed-off-by: Kartik Suryavanshi <158498247+KartikSuryavanshi@users.noreply.github.com>pull/32363/head
parent
65c3fc7581
commit
e58ce34aa1
Loading…
Reference in new issue