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

Expose two Read methods in gktest #1651

Conversation

julianKatz
Copy link
Contributor

I have an opportunity to re-use code made written in gktest, as long as
the necessary functions are public. This PR makes the following two
functions in the gktest package public. They are (with their newly
capitalized names):

  • ReadTemplate()
  • ReadObject()

Signed-off-by: juliankatz juliankatz@google.com

Signed-off-by: juliankatz <juliankatz@google.com>
Signed-off-by: juliankatz <juliankatz@google.com>
Signed-off-by: juliankatz <juliankatz@google.com>
Signed-off-by: juliankatz <juliankatz@google.com>
Signed-off-by: juliankatz <juliankatz@google.com>
I have an opportunity to re-use code made written in gktest, as long as
the necessary functions are public.  This PR makes the following two
functions in the gktest package public.  They are (with their newly
capitalized names):

- ReadTemplate()
- ReadObject()

Signed-off-by: juliankatz <juliankatz@google.com>
@julianKatz julianKatz force-pushed the refactor-read-constraint-in-gator branch from 6d755b8 to fc0af6e Compare November 10, 2021 00:02
@@ -72,13 +71,10 @@ func readUnstructured(bytes []byte) (*unstructured.Unstructured, error) {
return u, nil
}

// TODO(willbeason): Remove once ToVersionless() is threadsafe.
Copy link
Member

Choose a reason for hiding this comment

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

Is this threadsafe now to remove the lock?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've also confirmed that these frameworks changes are in gatekeeper already

… refactor-read-constraint-in-gator

Signed-off-by: juliankatz <juliankatz@google.com>
@codecov-commenter
Copy link

codecov-commenter commented Nov 10, 2021

Codecov Report

Merging #1651 (ea0dff1) into master (f43223e) will increase coverage by 0.11%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1651      +/-   ##
==========================================
+ Coverage   52.05%   52.16%   +0.11%     
==========================================
  Files          98       98              
  Lines        8693     8691       -2     
==========================================
+ Hits         4525     4534       +9     
+ Misses       3806     3798       -8     
+ Partials      362      359       -3     
Flag Coverage Δ
unittests 52.16% <100.00%> (+0.11%) ⬆️

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

Impacted Files Coverage Δ
pkg/gktest/read_constraints.go 86.02% <100.00%> (-0.30%) ⬇️
pkg/gktest/runner.go 96.75% <100.00%> (ø)
pkg/controller/config/config_controller.go 65.04% <0.00%> (ø)
...onstrainttemplate/constrainttemplate_controller.go 60.42% <0.00%> (+2.60%) ⬆️

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 f43223e...ea0dff1. Read the comment docs.

… refactor-read-constraint-in-gator

Signed-off-by: juliankatz <juliankatz@google.com>
@julianKatz
Copy link
Contributor Author

ping :) @ritazh @shomron @sozercan

… refactor-read-constraint-in-gator

Signed-off-by: juliankatz <juliankatz@google.com>
@julianKatz julianKatz merged commit 5a2b027 into open-policy-agent:master Nov 16, 2021
@julianKatz julianKatz deleted the refactor-read-constraint-in-gator branch November 16, 2021 00:22
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