Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add viperKeyDelimiter; Add unit test for imagebuilder nodeselectors (#…
…424) <!-- Thanks for sending a pull request! Here are some tips for you: 1. Run unit tests and ensure that they are passing 2. If your change introduces any API changes, make sure to update the e2e tests 3. Make sure documentation is updated for your PR! --> **What this PR does / why we need it**: <!-- Explain here the context and why you're making the change. What is the problem you're trying to solve. ---> Previous implementation of Viper cannot load the YAML key that contains ".". For example, give this config file: ``` NodeSelectors: cloud.google.com/gke-nodepool: image-build-job-node-pool ``` config.Load will raise error: ``` Failed initializing config: failed to unmarshal config values: 1 error(s) decoding: * 'ImageBuilderConfig.NodeSelectors[cloud]' expected type 'string', got unconvertible type 'map[string]interface {}', value: 'map[google:map[com/gke-nodepool:image-build-job-node-pool]]' ``` This PR fixes this issue by setting viper key delimiter to `::` **Does this PR introduce a user-facing change?**: <!-- If no, just write "NONE" in the release-note block below. If yes, a release note is required. Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". For more information about release notes, see kubernetes' guide here: http://git.k8s.io/community/contributors/guide/release-notes.md --> ```release-note NONE ``` **Checklist** - [ ] Added unit test, integration, and/or e2e tests - [x] Tested locally - [ ] Updated documentation - [ ] Update Swagger spec if the PR introduce API changes - [ ] Regenerated Golang and Python client if the PR introduce API changes
- Loading branch information