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

chore: updating to use 0.30.3 k8s client #461

Merged
merged 3 commits into from
Aug 2, 2024

Conversation

JaydipGabani
Copy link
Contributor

No description provided.

@@ -84,7 +84,7 @@ func (d *Driver) AddTemplate(_ context.Context, ct *templates.ConstraintTemplate
return err
}
vapVars = append(vapVars, vapVarsSuffix...)
filterCompiler, err := cel.NewCompositedCompiler(environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion()))
filterCompiler, err := cel.NewCompositedCompiler(environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion(), false))
Copy link
Member

Choose a reason for hiding this comment

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

why do we want to default to false here? can you add a comment

Copy link
Member

Choose a reason for hiding this comment

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

In k8s code I see places that defaults it to true?

	// strictCost is always true to enforce cost limits.
	celEnvironmentSet: environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion(), true),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

false here means that we are not enforcing strictCost calculation for CEL, which was the default behavior before this change was introduced.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should adopt whatever K8s is doing, since this is the release that will make our engine beta... we can always loosen the cost calculations, tightening them may break backwards compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated to follow K8s.

@codecov-commenter
Copy link

codecov-commenter commented Aug 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.80%. Comparing base (76869f8) to head (e736423).
Report is 39 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #461      +/-   ##
==========================================
- Coverage   54.68%   53.80%   -0.88%     
==========================================
  Files          71      104      +33     
  Lines        5241     6746    +1505     
==========================================
+ Hits         2866     3630     +764     
- Misses       2073     2745     +672     
- Partials      302      371      +69     
Flag Coverage Δ
unittests 53.80% <100.00%> (-0.88%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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 once costing discussion is resolved.

@ritazh
Copy link
Member

ritazh commented Aug 2, 2024

We should merge #435 first

@ritazh
Copy link
Member

ritazh commented Aug 2, 2024

We also need another PR to conditionally support admissionregistrationv1beta1 and admissionregistrationv1

@JaydipGabani
Copy link
Contributor Author

We also need another PR to conditionally support admissionregistrationv1beta1 and admissionregistrationv1

This we can handle on GK side based on the available APIVersion, here

Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>
Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>
@JaydipGabani JaydipGabani changed the title chore: updating to use 0.30.2 k8s client chore: updating to use 0.30.3 k8s client Aug 2, 2024
Copy link
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

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

LGTM pending @ritazh and @maxsmythe's comments

Signed-off-by: Jaydip Gabani <gabanijaydip@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

@ritazh
Copy link
Member

ritazh commented Aug 2, 2024

We also need another PR to conditionally support admissionregistrationv1beta1 and admissionregistrationv1

This we can handle on GK side based on the available APIVersion, here

I see r.scheme.Convert is added in GK to convert between these versions before writing/reading to/from the api server.

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

@JaydipGabani JaydipGabani merged commit aa99306 into open-policy-agent:master Aug 2, 2024
7 of 8 checks passed
@JaydipGabani JaydipGabani deleted the k8s-130 branch August 2, 2024 23:43
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