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

Add context to validatePolicyForNodeState errors #504

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

zeeke
Copy link
Member

@zeeke zeeke commented Sep 18, 2023

validatePolicyForNodeState(...) errors should contain the node they were validated against, making the user understand where the configuration problem is located.

Examples of how error messages changed:

- numVfs(65) in CR p1 exceed the maximum allowed value(64)           
+ numVfs(65) in CR p1 exceed the maximum allowed value(64) interface(ens803f0) node(worker-1)
                        
- vendor(8086) in CR p1 not supported for vdpa
+ vendor(8086) in CR p1 not supported for vdpa interface(ens803f0) node(worker-1)

(Note: I put literals instead of fmt.Sprintf(...) in assertion calls to simplify test code, as suggested here)

`validatePolicyForNodeState(...)` errors should contain the node they
were validated againsti, making the user understand where the
configuration problem is located.

Signed-off-by: Andrea Panattoni <[email protected]>
@github-actions
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 6225738869

  • 2 of 4 (50.0%) changed or added relevant lines in 1 file are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.003%) to 25.777%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/webhook/validate.go 2 4 50.0%
Files with Coverage Reduction New Missed Lines %
controllers/sriovibnetwork_controller.go 2 69.77%
controllers/sriovnetwork_controller.go 2 69.77%
Totals Coverage Status
Change from base Build 6185490527: 0.003%
Covered Lines: 2165
Relevant Lines: 8399

💛 - Coveralls

Copy link
Collaborator

@SchSeba SchSeba left a comment

Choose a reason for hiding this comment

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

LGTM
thanks!

@rollandf
Copy link
Contributor

LGTM

@e0ne e0ne merged commit 8d53a20 into k8snetworkplumbingwg:master Oct 5, 2023
9 checks passed
mlguerrero12 pushed a commit to mlguerrero12/sriov-network-operator that referenced this pull request Oct 6, 2023
…tion-error

Add context to `validatePolicyForNodeState` errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants