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

Log a warning when loading bundle manifests with multiple documents #708

Merged
merged 1 commit into from
Oct 29, 2021

Conversation

omertuc
Copy link
Contributor

@omertuc omertuc commented Jul 12, 2021

decodeFileFS reads only the first YAML document in a manifest and
ignores the rest of the documents in that file. This commit makes
it so that it will log a warning when more than one document is
encountered in a single manifest file.

Motivation for the change:
Inspired by this annoying bug: https://gitlab.com/nvidia/kubernetes/gpu-operator/-/merge_requests/254

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

@openshift-ci openshift-ci bot requested review from awgreene and ecordell July 12, 2021 14:54
@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 12, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 12, 2021

Hi @omertuc. Thanks for your PR.

I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@omertuc omertuc changed the title **Description of the change:** Log a warning when loading bundle manifests with multiple documents Log a warning when loading bundle manifests with multiple documents Jul 12, 2021
@dinhxuanvu
Copy link
Member

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 27, 2021
@omertuc
Copy link
Contributor Author

omertuc commented Oct 27, 2021

Force-pushed to fix indentation / lint / rebase

@omertuc
Copy link
Contributor Author

omertuc commented Oct 27, 2021

Force pushed again to fix DCO

@codecov
Copy link

codecov bot commented Oct 27, 2021

Codecov Report

Merging #708 (ce63d0d) into master (c426f78) will increase coverage by 0.03%.
The diff coverage is 90.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #708      +/-   ##
==========================================
+ Coverage   51.04%   51.08%   +0.03%     
==========================================
  Files         103      103              
  Lines        9050     9056       +6     
==========================================
+ Hits         4620     4626       +6     
  Misses       3553     3553              
  Partials      877      877              
Impacted Files Coverage Δ
pkg/registry/parse.go 73.68% <75.00%> (ø)
pkg/registry/decode.go 82.14% <100.00%> (+4.87%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c426f78...ce63d0d. Read the comment docs.

Copy link
Member

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some comments and a question.

pkg/registry/decode.go Show resolved Hide resolved
pkg/registry/decode.go Show resolved Hide resolved
decodeFileFS reads only the first YAML document in a manifest and
ignores the rest of the documents in that file. This commit makes
it so that it will log a warning when more than one document is
encountered in a single manifest file.

Inspired by this annoying bug: https://gitlab.com/nvidia/kubernetes/gpu-operator/-/merge_requests/254

Signed-off-by: Omer Tuchfeld <otuchfel@redhat.com>
@kevinrizza
Copy link
Member

/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 28, 2021
Copy link
Member

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 29, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 29, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jmrodri, kevinrizza, omertuc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit f22a60c into operator-framework:master Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants