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

ci: remove kubebuilder dependency #2524

Merged
merged 8 commits into from
Jan 21, 2023

Conversation

sozercan
Copy link
Member

Signed-off-by: Sertac Ozercan sozercan@gmail.com

What this PR does / why we need it:
migrate to envtest and remove kubebuilder dependency

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Fixes #

Special notes for your reviewer:

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Jan 19, 2023

Codecov Report

Base: 53.92% // Head: 54.01% // Increases project coverage by +0.09% 🎉

Coverage data is based on head (2daf4de) compared to base (73611cc).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2524      +/-   ##
==========================================
+ Coverage   53.92%   54.01%   +0.09%     
==========================================
  Files         116      116              
  Lines       10287    10287              
==========================================
+ Hits         5547     5557      +10     
+ Misses       4314     4307       -7     
+ Partials      426      423       -3     
Flag Coverage Δ
unittests 54.01% <ø> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...onstrainttemplate/constrainttemplate_controller.go 59.80% <0.00%> (+2.39%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@sozercan
Copy link
Member Author

/benchmark

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

This PR compares its performance to the latest released version. If it performs significantly lower, consider optimizing your changes to improve the performance.

name                                            old time/op  new time/op  delta
pkg:github.com/open-policy-agent/gatekeeper/pkg/mutation goos:linux goarch:amd64
System_Mutate                                   1.33µs ± 0%  1.35µs ± 1%   +1.24%  (p=0.000 n=9+9)
pkg:github.com/open-policy-agent/gatekeeper/pkg/mutation/mutators/assign goos:linux goarch:amd64
AssignMutator_Mutate/always_mutate_1-depth       207ns ±10%   200ns ± 2%     ~     (p=0.470 n=10+10)
AssignMutator_Mutate/always_mutate_2-depth       230ns ± 1%   238ns ± 1%   +3.60%  (p=0.000 n=9+10)
AssignMutator_Mutate/always_mutate_5-depth       338ns ± 2%   343ns ± 0%   +1.27%  (p=0.000 n=9+8)
AssignMutator_Mutate/always_mutate_10-depth      496ns ± 1%   499ns ± 1%   +0.67%  (p=0.009 n=10+10)
AssignMutator_Mutate/always_mutate_20-depth      824ns ± 1%   827ns ± 1%     ~     (p=0.072 n=10+10)
AssignMutator_Mutate/never_mutate_1-depth        162ns ± 1%   169ns ± 0%   +4.69%  (p=0.000 n=10+9)
AssignMutator_Mutate/never_mutate_2-depth        184ns ± 1%   193ns ± 1%   +4.95%  (p=0.000 n=10+10)
AssignMutator_Mutate/never_mutate_5-depth        240ns ± 2%   245ns ± 0%   +2.32%  (p=0.000 n=10+8)
AssignMutator_Mutate/never_mutate_10-depth       336ns ± 1%   344ns ± 1%   +2.22%  (p=0.000 n=10+10)
AssignMutator_Mutate/never_mutate_20-depth       618ns ± 1%   624ns ± 0%   +1.03%  (p=0.000 n=9+9)
pkg:github.com/open-policy-agent/gatekeeper/pkg/mutation/mutators/assignmeta goos:linux goarch:amd64
AssignMetadataMutator_Always                    1.25µs ± 5%  1.30µs ± 1%   +3.79%  (p=0.001 n=10+9)
AssignMetadataMutator_Never                      228ns ± 0%   229ns ± 0%   +0.30%  (p=0.046 n=8+10)
pkg:github.com/open-policy-agent/gatekeeper/pkg/mutation/mutators/modifyset goos:linux goarch:amd64
ModifySetMutator_Mutate/always_mutate_1-depth   1.19µs ± 2%  1.20µs ± 1%   +1.00%  (p=0.014 n=10+9)
ModifySetMutator_Mutate/always_mutate_2-depth   1.23µs ± 1%  1.23µs ± 1%     ~     (p=0.590 n=10+10)
ModifySetMutator_Mutate/always_mutate_5-depth   1.35µs ± 0%  1.35µs ± 0%   +0.48%  (p=0.000 n=10+8)
ModifySetMutator_Mutate/always_mutate_10-depth  1.62µs ± 2%  1.66µs ± 0%   +2.38%  (p=0.000 n=10+10)
ModifySetMutator_Mutate/always_mutate_20-depth  2.09µs ± 1%  2.11µs ± 2%   +0.87%  (p=0.009 n=10+10)
ModifySetMutator_Mutate/never_mutate_1-depth     336ns ± 1%   351ns ± 2%   +4.53%  (p=0.000 n=9+10)
ModifySetMutator_Mutate/never_mutate_2-depth     374ns ± 1%   371ns ± 1%   -0.78%  (p=0.008 n=10+10)
ModifySetMutator_Mutate/never_mutate_5-depth     432ns ± 1%   437ns ± 0%   +1.16%  (p=0.000 n=9+10)
ModifySetMutator_Mutate/never_mutate_10-depth    521ns ± 0%   525ns ± 0%   +0.91%  (p=0.000 n=10+10)
ModifySetMutator_Mutate/never_mutate_20-depth    832ns ± 1%   832ns ± 1%     ~     (p=0.684 n=10+10)
pkg:github.com/open-policy-agent/gatekeeper/pkg/webhook goos:linux goarch:amd64
ValidationHandler/psp:_100%_violations          1.71ms ± 0%  1.67ms ± 1%   -2.82%  (p=0.000 n=9+9)
ValidationHandler/psp:_100%_violations#01       2.23ms ± 1%  2.15ms ± 1%   -3.70%  (p=0.000 n=10+10)
ValidationHandler/psp:_100%_violations#02       5.68ms ± 2%  5.48ms ± 1%   -3.53%  (p=0.000 n=10+10)
ValidationHandler/psp:_100%_violations#03       10.1ms ± 3%   9.7ms ± 1%   -3.40%  (p=0.000 n=10+9)
ValidationHandler/psp:_100%_violations#04       19.1ms ± 3%  17.9ms ± 1%   -6.48%  (p=0.000 n=10+10)
ValidationHandler/psp:_100%_violations#05       92.6ms ± 1%  83.4ms ± 2%   -9.92%  (p=0.000 n=8+10)
ValidationHandler/psp:_100%_violations#06        199ms ± 1%   172ms ± 1%  -13.31%  (p=0.000 n=9+10)

Copy link
Member

@ritazh ritazh left a comment

Choose a reason for hiding this comment

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

LGTM

--build-arg KUBEBUILDER_VERSION=$(KUBEBUILDER_VERSION)
--build-arg KUSTOMIZE_VERSION=$(KUSTOMIZE_VERSION)

## Location to install dependencies to
Copy link
Contributor

Choose a reason for hiding this comment

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

fyi, I can see make test work locally on this fork now 🥇 ; thanks for fixing this !!

Makefile Outdated Show resolved Hide resolved
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

LGTM, same comments about "bin"

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
@sozercan
Copy link
Member Author

@maxsmythe bin is the default for kubebuilder v3 and it's in gitignore. looks like we are using .tmp already (for linter) so i changed to .tmp/bin

@sozercan sozercan merged commit f33c367 into open-policy-agent:master Jan 21, 2023
@sozercan sozercan deleted the ci-remove-kubebuilder branch January 21, 2023 04:17
davis-haba pushed a commit to davis-haba/gatekeeper that referenced this pull request Mar 7, 2023
* remove kubebuilder dependency

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>

* remove unused package

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>

* pin setup-envtest

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>

* use .tmp/bin

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
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.

None yet

5 participants