kapp-controller plugin handles missing metadata. #4527
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Michael Nelson minelson@vmware.com
Description of the change
While helping @cmoulliard debug an issue he was seeing running Kubeapps with carvel support and the TAP 1.0.2 repo, we noticed that the repo itself appears to have invalid data (missing metadata for some packages). Running this locally myself, I would see the error in the UI:
This is because our kapp-controller plugin was asserting that there was always one
PackageMetadata
for any package'srefName
. It turns out that sometimes invalid repositories get published, as seemed to be the case with the TAP 1.0.2 repo.This change removes the assumption in our plugin, so instead we'll log a message, but skip a package that doesn't have a corresponding package metadata.
As a result, I can then see the TAP catalog:
and verify in the logs of our API service that it notes the correct missing package metadatas:
Benefits
Kubeapps can still present the valid packages from a repository, even when there are some invalid ones.
Possible drawbacks
Applicable issues
Additional information