Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to gopkg.in/yaml.v3 #2468

Merged
merged 7 commits into from
Jul 20, 2022
Merged

Migrate to gopkg.in/yaml.v3 #2468

merged 7 commits into from
Jul 20, 2022

Commits on Jul 19, 2022

  1. Use gopkg.in/yaml.v3 everywhere

    This replaces all usages of gopkg.in/yaml.v2 by v3 everywhere, adapts
    the UnmarshalYAML methods to the new signature, and replaces the
    UnmarshalStrict calls by the decoder with KnownFields flag.
    
    util.YAMLMarshalUnmarshal doesn't work because it doesn't support
    unmarshaling map[interface{}]interface{}
    
    Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
    colega committed Jul 19, 2022
    Configuration menu
    Copy the full SHA
    5e3f298 View commit details
    Browse the repository at this point in the history
  2. Fix yaml.YAMLMarshalUnmarshal

    yaml.v3 can't unmarshal to map[interface{}]interface{},
    but actually map[string]interface{} should be enough.
    
    Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
    colega committed Jul 19, 2022
    Configuration menu
    Copy the full SHA
    b90775a View commit details
    Browse the repository at this point in the history
  3. go mod tidy

    Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
    colega committed Jul 19, 2022
    Configuration menu
    Copy the full SHA
    e7b8102 View commit details
    Browse the repository at this point in the history
  4. Add faillint for gopkg.in/yaml.v2

    Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
    colega committed Jul 19, 2022
    Configuration menu
    Copy the full SHA
    c46e7b1 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2022

  1. Use custom fork of gopkg.in/yaml.v3

    This commit is the latest v3 with
    go-yaml/yaml#691 cherry-picked on top of it, to
    provide support for strict unmarshaling when doing custom unmarshaling
    (see go-yaml/yaml#460)
    
    Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
    colega committed Jul 20, 2022
    Configuration menu
    Copy the full SHA
    e0fa9fc View commit details
    Browse the repository at this point in the history
  2. Fix TestAlertmanagerNotificationLimitsOverrides

    There's no such field as
    `alertmanager_notification_limits_per_integration`
    and the fixed strict parsing has detected this.
    
    How does this test pass in `main`?
    
    Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
    colega committed Jul 20, 2022
    Configuration menu
    Copy the full SHA
    53d4a65 View commit details
    Browse the repository at this point in the history
  3. Remove cfg.validateYAMLEmptyNodes and adapt test

    gopkg.in/yaml.v3 implementation doesn't seem to set the entire value to
    zero value if an empty node is specified in the YAML. So we don't need
    that check again, and we can adapt the test just to check that this
    assertion is true.
    
    Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
    colega committed Jul 20, 2022
    Configuration menu
    Copy the full SHA
    e41127b View commit details
    Browse the repository at this point in the history