-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
59bd1b7
commit a545f76
Showing
2 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters