-
Notifications
You must be signed in to change notification settings - Fork 17
[checker] Checker bin, JSON config file, new Check interface #121
base: master
Are you sure you want to change the base?
Conversation
hey @kawmarco , thanks for the contribution! Could you please re-submit with DCO (just amend the commit with |
0cea717
to
cd6541a
Compare
Codecov Report
@@ Coverage Diff @@
## master #121 +/- ##
==========================================
- Coverage 50.17% 46.99% -3.19%
==========================================
Files 14 21 +7
Lines 562 798 +236
==========================================
+ Hits 282 375 +93
- Misses 252 391 +139
- Partials 28 32 +4
Continue to review full report at Codecov.
|
3d2ca90
to
34d9ed4
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.
I've done only a partial review, publishing it to unblock you.
Also note - several files have changed permissions with this commit, they have now an executable bit set where they should not
Signed-off-by: Marco Kawajiri <[email protected]>
Signed-off-by: Marco Kawajiri <[email protected]>
Signed-off-by: Marco Kawajiri <[email protected]>
Signed-off-by: Marco Kawajiri <[email protected]>
Signed-off-by: Marco Kawajiri <[email protected]>
Signed-off-by: Marco Kawajiri <[email protected]>
Signed-off-by: Marco Kawajiri <[email protected]>
Signed-off-by: Marco Kawajiri <[email protected]>
Discussed offline, we will reopen this one against uroot after the move is done |
checker/main.go
) which accepts a JSON configuration file as input (--config-file
), containing a list ofCheck
sCheck
structs to be more friendly to JSON configuration and JSON report output, thinking of the following workflowCheckFun(CheckArgs)
functions, which contain the actual logic of the check, and "register" their functions usingregisterCheckFun
oninit()
(so that they are registered in a global map and we can then find the check functions by name at runtime)Check
struct defines howCheckFuns
should be called, includingCheckArgs
, possible remediations and metadata. The config file is achecklist
(a list ofCheck
)Check.Run()
returns a JSON-friendlyCheckResult
, containing the result of theCheck
and the result of the configured remediationsTODO:
pkg/checker/checker.go