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

refactor: update executePlugins function to operate on a slice of PluginSpec's #206

Merged
merged 8 commits into from
Sep 6, 2024

Conversation

ahmad-ibra
Copy link
Collaborator

@ahmad-ibra ahmad-ibra commented Sep 3, 2024

Issue

Resolves #211

Description

The purpose of this PR is to refactor the executePlugin function to operate on a slice of PluginSpec's as opposed to a ValidatorConfig. This is prep work to help us soon support the --crd flag where users will be able to pass in CRs for various validation rules.

In the process of making these changes, I updated the oci and network plugins to fully support direct invocation of rules that previously required k8s secrets. Now those credentials/pubkeys that were defined in secrets can be defined inline within the oci and network plugin specs. To get this fully working, this PR also includes changes to:

  • Update OCI prompts to support configuring inline signature verification public keys
  • Update Network prompts to support configuring inline auth details for HTTPFileRules

Copy link

codecov bot commented Sep 3, 2024

Codecov Report

Attention: Patch coverage is 65.80311% with 66 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/services/validator/oci.go 25.00% 18 Missing and 6 partials ⚠️
pkg/services/validator/network.go 31.03% 17 Missing and 3 partials ⚠️
pkg/cmd/validator/validator.go 84.92% 12 Missing and 7 partials ⚠️
pkg/services/env_service.go 0.00% 2 Missing ⚠️
pkg/services/validator/rule_names.go 0.00% 1 Missing ⚠️
@@            Coverage Diff             @@
##             main     #206      +/-   ##
==========================================
- Coverage   53.33%   53.33%   -0.01%     
==========================================
  Files          45       45              
  Lines        6253     6272      +19     
==========================================
+ Hits         3335     3345      +10     
- Misses       2073     2082       +9     
  Partials      845      845              
Files with missing lines Coverage Δ
pkg/components/validator.go 56.44% <ø> (+0.26%) ⬆️
pkg/utils/exec/exec.go 44.06% <100.00%> (ø)
pkg/utils/kube/kube.go 51.13% <100.00%> (ø)
...integration/_validator/testcases/test_validator.go 93.68% <100.00%> (ø)
pkg/services/validator/rule_names.go 42.85% <0.00%> (ø)
pkg/services/env_service.go 0.00% <0.00%> (ø)
pkg/cmd/validator/validator.go 60.84% <84.92%> (+1.37%) ⬆️
pkg/services/validator/network.go 45.83% <31.03%> (-1.19%) ⬇️
pkg/services/validator/oci.go 44.64% <25.00%> (-1.83%) ⬇️

Continue to review full report in Codecov by Sentry.

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

@ahmad-ibra ahmad-ibra force-pushed the feat/add-crd-flag branch 2 times, most recently from 51a0b2a to e06b7b5 Compare September 4, 2024 17:59
@ahmad-ibra ahmad-ibra changed the title feat: add --crd flag to the check command and set as mutually exclusive refactor: update executePlugins function to operate on a slice of PluginSpec's Sep 4, 2024
@ahmad-ibra ahmad-ibra force-pushed the feat/add-crd-flag branch 7 times, most recently from d32c11f to 98960e0 Compare September 5, 2024 18:50
@ahmad-ibra ahmad-ibra marked this pull request as ready for review September 5, 2024 22:24
@ahmad-ibra ahmad-ibra requested a review from a team as a code owner September 5, 2024 22:24
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. refactoring Refactoring / tech debt labels Sep 5, 2024
@ahmad-ibra ahmad-ibra marked this pull request as draft September 5, 2024 22:41
@ahmad-ibra ahmad-ibra marked this pull request as ready for review September 5, 2024 23:28
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 6, 2024
@ahmad-ibra ahmad-ibra merged commit 97875f3 into main Sep 6, 2024
8 checks passed
@ahmad-ibra ahmad-ibra deleted the feat/add-crd-flag branch September 6, 2024 15:26
TylerGillson added a commit that referenced this pull request Sep 11, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.2.0](v0.1.4...v0.2.0)
(2024-09-11)


### ⚠ BREAKING CHANGES

* remove role privilege rules
([#217](#217))

### Features

* add --custom-resources flag to validator rules check as an alternate
to -f
([#218](#218))
([4aa14b6](4aa14b6))


### Bug Fixes

* add missing Host.Config.Storage privilege & document
([#212](#212))
([c7408a6](c7408a6))


### Docs

* remove subcommand docs from repo
([#205](#205))
([57ca6cb](57ca6cb))


### Dependency Updates

* **deps:** update golang.org/x/exp digest to e7e105d
([#214](#214))
([c4ac163](c4ac163))


### Refactoring

* remove role privilege rules
([#217](#217))
([b0976db](b0976db))
* update `executePlugins` function to operate on a slice of
`PluginSpec`'s
([#206](#206))
([97875f3](97875f3))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer refactoring Refactoring / tech debt size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🎨 Refactor executePlugins function to operate on a slice of PluginSpecs
2 participants