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

Error when processing resource files with null/empty annotations #541

Closed
phanimarupaka opened this issue Apr 23, 2020 · 1 comment
Closed
Assignees
Labels
bug Something isn't working size/M 2 day triaged Issue has been triaged by adding an `area/` label

Comments

@phanimarupaka
Copy link
Contributor

Kpt reads KRM resources from files, adds annotations config.kubernetes.io/index and config.kubernetes.io/path, processes them and writes them back to respective file paths in original order. There is an edge case where kpt is not creating/adding annotations if the annotations field is already specified in resource files and is null/empty.

@phanimarupaka
Copy link
Contributor Author

phanimarupaka commented Jun 12, 2020

@pwittrock Why are we returning nil here instead of err. As this logic is used everywhere, nil fields are not being matched without explicit error which is leading to confusion. How should PathGetter behave if there are nil fields.

metadata:
     annotations:

For this yaml input with nil annotations, but field exists, kyaml doesn't add annotations.

cc @mortent

@phanimarupaka phanimarupaka added this to Backlog in Config as Data - Milestone 3 via automation Jun 23, 2020
@phanimarupaka phanimarupaka moved this from Backlog to Week/26 in Config as Data - Milestone 3 Jun 23, 2020
@phanimarupaka phanimarupaka modified the milestones: Milestone 2 (Starts 2020-Q2), Milestone 3 (Starts 2020-Q3) Jun 23, 2020
@sankit2020 sankit2020 removed this from the Milestone 3 (Starts 2020-Q3) milestone Jun 24, 2020
@phanimarupaka phanimarupaka moved this from Week/26 to Week/28 in Config as Data - Milestone 3 Jul 8, 2020
@phanimarupaka phanimarupaka added bug Something isn't working size/M 2 day labels Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/M 2 day triaged Issue has been triaged by adding an `area/` label
Projects
None yet
Development

No branches or pull requests

4 participants