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

resources: Fail on non-string template labels. #1030

Merged
merged 1 commit into from
Apr 2, 2021

Commits on Apr 2, 2021

  1. resources: Fail on non-string template labels.

    Although ObjectMeta defines labels as a map[string]string, Unstructured
    types allow for map[string]interface{}, which means that users can set
    non-string values like ints in their configurations, and we will parse it
    with no issues.
    
    We discovered that the behavior of
    [unstructured.GetLabels](https://github.com/kubernetes/apimachinery/blob/dd12c7a65e7f49c4e00b5bd5eb93de2fcbf7831d/pkg/apis/meta/v1/unstructured/unstructured.go#L395)
    will silently ignore errors, returning an empty label set if a
    non-string value is included. When used in triggers, this looks like we
    are completely ignoring the user provided labels.
    
    This change replaces GetLabels with it's underlying implementation, and bubbles
    back the non-string error if it is encountered.
    wlynch committed Apr 2, 2021
    Configuration menu
    Copy the full SHA
    e3168d2 View commit details
    Browse the repository at this point in the history