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

Set minimum TLS version in webhooks #1426

Merged
merged 15 commits into from
Sep 23, 2021

Conversation

sozercan
Copy link
Member

@sozercan sozercan commented Jul 7, 2021

Signed-off-by: Sertac Ozercan sozercan@gmail.com
What this PR does / why we need it:

  • Upgrades CR to v0.9.2
  • Introduces tls-min-version flag to set min TLS version (defaulting to 1.2)

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 #1424

Special notes for your reviewer:

if err != nil {
return nil, err
}
selectorsByGVK[gvk] = selector
Copy link
Member Author

Choose a reason for hiding this comment

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

@shomron I am getting error

cannot use selector (variable of type internal.Selector) as internal.Selector value in assignmentcompilerIncompatibleAssign

any ideas?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, the types come from different packages (upstream cache and forked cache) - and can't just be assigned to each other. This resolves it:

selectorsByGVK[gvk] = internal.Selector{
	Label: selector.Label,
	Field: selector.Field,
}

I'll go through the PR to see if there's anything else.

Copy link
Contributor

Choose a reason for hiding this comment

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

Opened sozercan#73 with fixes to the rebase.

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks @shomron!

@sozercan sozercan requested a review from shomron July 21, 2021 16:11
@ritazh ritazh marked this pull request as ready for review September 7, 2021 19:06
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

@ritazh
Copy link
Member

ritazh commented Sep 9, 2021

@shomron when you get a chance, can you please help take a look at these failures: https://github.com/open-policy-agent/gatekeeper/pull/1426/checks?check_run_id=3550979914

sozercan and others added 6 commits September 10, 2021 12:09
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Oren Shomron <shomron@gmail.com>
Signed-off-by: Rita Zhang <rita.z.zhang@gmail.com>
@sozercan
Copy link
Member Author

sozercan commented Sep 14, 2021

Looks like #1538 updated the constraint framework vendor without go.mod change. I updated frameworks to 2924b2c86f76 for now so it doesn't keep generating diffs.

@willbeason

@sozercan
Copy link
Member Author

sozercan commented Sep 14, 2021

@sozercan
Copy link
Member Author

@maxsmythe still LGTY?

@codecov-commenter
Copy link

Codecov Report

Merging #1426 (7e89a28) into master (14de7cf) will increase coverage by 0.04%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1426      +/-   ##
==========================================
+ Coverage   52.77%   52.82%   +0.04%     
==========================================
  Files          89       89              
  Lines        7843     7849       +6     
==========================================
+ Hits         4139     4146       +7     
- Misses       3356     3357       +1     
+ Partials      348      346       -2     
Flag Coverage Δ
unittests 52.82% <0.00%> (+0.04%) ⬆️

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

Impacted Files Coverage Δ
pkg/metrics/client_metrics.go 0.00% <0.00%> (ø)
pkg/webhook/common.go 66.00% <ø> (ø)
pkg/webhook/mutation.go 19.11% <0.00%> (-0.29%) ⬇️
pkg/webhook/namespacelabel.go 66.66% <0.00%> (-3.34%) ⬇️
pkg/webhook/policy.go 29.26% <0.00%> (-0.17%) ⬇️
pkg/controller/mutators/core/controller_core.go 55.44% <0.00%> (+1.55%) ⬆️
pkg/watch/replay.go 81.25% <0.00%> (+2.27%) ⬆️

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 a968ce3...7e89a28. Read the comment docs.

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.

One comment about metrics

WRT the informer, are we also upgrading our fork as part of this PR?

@@ -31,4 +32,4 @@ func DisableRESTClientMetrics() {

type noopLatency struct{}

func (noopLatency) Observe(string, url.URL, time.Duration) {}
func (noopLatency) Observe(context.Context, string, url.URL, time.Duration) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we adding context here? Looking at the definition of clientmetrics.RequestLatency, it doesn't appear to expect a context.

Copy link
Member Author

@sozercan sozercan Sep 22, 2021

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, might have been looking at an older version of the code. LGTM

@ritazh
Copy link
Member

ritazh commented Sep 22, 2021

WRT the informer, are we also upgrading our fork as part of this PR?

Yes, @shomron's commit d390a0a updates the fork from 0.8.2 to 0.9.2

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

@sozercan sozercan merged commit 921869d into open-policy-agent:master Sep 23, 2021
@sozercan sozercan deleted the tls-min-version branch September 23, 2021 15:44
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.

Set minimum TLS version in webhooks
5 participants