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

Handle normalization of dyn.KindTime into an any type #1836

Merged
merged 2 commits into from
Oct 17, 2024
Merged

Commits on Oct 17, 2024

  1. Handle normalization of dyn.KindTime into an any type

    The issue reported in #1828 illustrates how using a YAML timestamp-like value
    (a date in this case) causes an issue during conversion to and from the typed
    configuration tree.
    
    We use the `AsAny()` function on the `dyn.Value` when normalizing for the any
    type. We only use the any type for variable values, because they can assume
    every type. The `AsAny()` function returns a `time.Time` for the time value
    during conversion **to** the typed configuration tree. Upon conversion **from**
    the typed configuration tree back into the dynamic configuration tree, we
    cannot distinguish a `time.Time` struct from any other struct.
    
    To address this, we use the underlying string value of the time value when we
    normalize for the any type.
    
    Fixes #1828.
    pietern committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    3907afa View commit details
    Browse the repository at this point in the history
  2. null -> nil

    pietern committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    0ead0e0 View commit details
    Browse the repository at this point in the history