-
Notifications
You must be signed in to change notification settings - Fork 509
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
add support for validating admission webhook in terrascan #620
add support for validating admission webhook in terrascan #620
Conversation
d813f8f
to
a439fea
Compare
Codecov Report
@@ Coverage Diff @@
## master #620 +/- ##
==========================================
- Coverage 78.09% 75.41% -2.68%
==========================================
Files 104 109 +5
Lines 2597 3002 +405
==========================================
+ Hits 2028 2264 +236
- Misses 422 570 +148
- Partials 147 168 +21
|
9f19b92
to
f8106b9
Compare
71126ca
to
61162e2
Compare
return &APIHandler{} | ||
func NewAPIHandler(configFile string) *APIHandler { | ||
return &APIHandler{ | ||
configFile: configFile, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should change this logic. the configFile is loaded in the LoadGlobalConfig( ) call. by the cli framework itself here https://github.com/accurics/terrascan/blob/master/pkg/cli/register.go#L44
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The config file changes are quite significant and can be handled as separate PR. adding those changes in this PR would just increase the bulk of this PR.
If you are okay, we can open a separate issue for this and address it as a part of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. let's tackle this refactor seperately.
I'll also create one for helm charts.
@@ -29,13 +29,19 @@ type Route struct { | |||
|
|||
// Routes returns a slice of routes of API endpoints to be registered with | |||
// http server | |||
func (g *APIServer) Routes() []*Route { | |||
h := NewAPIHandler() | |||
func (g *APIServer) Routes(configFile string) []*Route { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and ofcourse we'll have to change the function a bit.. to consume the config values... config package can be used directly.
func (g *APIServer) Routes() []*Route { | ||
h := NewAPIHandler() | ||
func (g *APIServer) Routes(configFile string) []*Route { | ||
h := NewAPIHandler(configFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for this function
df17b05
to
8bca20e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. Wouldn't mind changing that CSS file, though.
result runtime.Output | ||
) | ||
|
||
if flag.Lookup("test.v") != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not looking for a change, but this feels strange as almost all the code uses Cobra...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
We should add e2e tests for admission webhook later.
Co-authored-by: Devang Gaur <devang.gaur@accurics.com>
Co-authored-by: Devang Gaur <devang.gaur@accurics.com>
7a9d195
to
a53ce45
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requested a small change in docs
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
No description provided.