-
Notifications
You must be signed in to change notification settings - Fork 343
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
Introduce HookServer config loading from /etc/runtime/hookserver.d/ #100
Conversation
@@ -0,0 +1,104 @@ | |||
package config |
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.
add some unittests?
@@ -0,0 +1,244 @@ | |||
package config |
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.
add tests to improve code coverage
type RuntimeHookConfig struct { | ||
RemoteEndpoint string `json:"remote-endpoint,omitempty"` | ||
FailurePolicy FailurePolicyType `json:"failure-policy,omitempty"` | ||
RuntimeHooks []RuntimeHookType `json:"runtime-hooks,omitempty"` |
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.
each RuntimeHookType may have different FailurePolicyType, maybe better as []struct{RuntimeHooks, FailurePolicy}
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.
each RuntimeHookType may have different FailurePolicyType, maybe better as []struct{RuntimeHooks, FailurePolicy}
let's make protocol simple here.
RuntimeHookServer can use different FailurePolicyType for different hooks by:
set FailurePolicy to 'Failure' and control grpc response code to nil or error on HookServer side.
Codecov Report
@@ Coverage Diff @@
## main #100 +/- ##
==========================================
+ Coverage 40.66% 44.19% +3.52%
==========================================
Files 66 73 +7
Lines 5144 5965 +821
==========================================
+ Hits 2092 2636 +544
- Misses 2804 3036 +232
- Partials 248 293 +45
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: pengyang.hpy <honpey@gmail.com>
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hormes The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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
Signed-off-by: pengyang.hpy honpey@gmail.com
Ⅰ. Describe what this PR does
load hookServer config file from local dir, config file example:
{
"remote-endpoint": "/var/run/koordlet.sock",
"failure-policy": "Ignore",
"runtime-hooks": [
"PreRunPodSandbox"
]
}
Ⅱ. Does this pull request fix one issue?
Ⅲ. Describe how to verify it
Ⅳ. Special notes for reviews