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

fix: generate mock name for expanded resources #2529

Merged
merged 6 commits into from
Mar 14, 2023

Conversation

davis-haba
Copy link
Contributor

@davis-haba davis-haba commented Jan 21, 2023

Signed-off-by: davis-haba davishaba@google.com

What this PR does / why we need it:

Generates a mock name for expanded resources. The mock name is a function of the generator's name, and the resultant kind.

A deployment named nginx-deployment which expands into a Pod would create a resultant Pod with a name nginx-deployment-pod.

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):
Partly fixes #2485

Fix to update match schema will be added in separate PR.

@codecov-commenter
Copy link

codecov-commenter commented Jan 21, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.09 🎉

Comparison is base (1a3fee5) 53.68% compared to head (a0c0d37) 53.78%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2529      +/-   ##
==========================================
+ Coverage   53.68%   53.78%   +0.09%     
==========================================
  Files         120      120              
  Lines       10634    10643       +9     
==========================================
+ Hits         5709     5724      +15     
+ Misses       4496     4491       -5     
+ Partials      429      428       -1     
Flag Coverage Δ
unittests 53.78% <100.00%> (+0.09%) ⬆️

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

Impacted Files Coverage Δ
pkg/expansion/system.go 81.67% <100.00%> (+1.35%) ⬆️

... and 2 files with indirect coverage changes

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 in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

pkg/expansion/system.go Outdated Show resolved Hide resolved
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 with one nit

pkg/expansion/system.go Outdated Show resolved Hide resolved
@maxsmythe
Copy link
Contributor

Though it looks like unit tests are breaking

Copy link
Contributor

@acpana acpana left a comment

Choose a reason for hiding this comment

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

pending fix for TestExpand

@maxsmythe
Copy link
Contributor

DCO check is failing?

Signed-off-by: davis-haba <davishaba@google.com>
Signed-off-by: davis-haba <davishaba@google.com>
Signed-off-by: davis-haba <davishaba@google.com>
Signed-off-by: davis-haba <davishaba@google.com>
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

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

I updated the PR description to match the updated implementation.

@ritazh ritazh merged commit f4d2d0f into open-policy-agent:master Mar 14, 2023
davis-haba added a commit to davis-haba/gatekeeper that referenced this pull request Mar 23, 2023
Co-authored-by: Sertaç Özercan <852750+sozercan@users.noreply.github.com>
Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>
salaxander pushed a commit to salaxander/gatekeeper that referenced this pull request Apr 5, 2023
Co-authored-by: Sertaç Özercan <852750+sozercan@users.noreply.github.com>
Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>
Signed-off-by: Xander Grzywinski <xandergr@microsoft.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.

Expanded resource not evaluated for constraint
7 participants