-
Notifications
You must be signed in to change notification settings - Fork 24
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
Migrate builtin check commands to Plugin crd #347
Conversation
e14c353
to
199e868
Compare
Codecov Report
@@ Coverage Diff @@
## master #347 +/- ##
=========================================
- Coverage 32.36% 32.27% -0.1%
=========================================
Files 15 15
Lines 1001 1004 +3
=========================================
Hits 324 324
- Misses 623 626 +3
Partials 54 54
Continue to review full report at Codecov.
|
hack/deploy/searchlight.sh
Outdated
@@ -260,5 +260,8 @@ for crd in "${crds[@]}"; do | |||
$ONESSL wait-until-ready crd ${crd}.monitoring.appscode.com || { echo "$crd crd failed to be ready"; exit 1; } | |||
done | |||
|
|||
echo "creating built-in plugins" | |||
${SCRIPT_LOCATION}docs/examples/plugins/plugins.yaml| kubectl apply -f - |
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.
inside hack deploy
pkg/operator/controller.go
Outdated
@@ -123,6 +123,11 @@ func (op *Operator) RunWatchers(stopCh <-chan struct{}) { | |||
} | |||
|
|||
func (op *Operator) Run(stopCh <-chan struct{}) error { | |||
err := op.MigrateAlerts() | |||
if err != nil { | |||
log.Fatalln("Failed alert migrations:", err) |
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.
return err
pkg/operator/migrations.go
Outdated
} | ||
|
||
if len(errs) > 0 { | ||
return utilerrors.NewAggregate(errs) |
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.
check not needed
return nil | ||
} | ||
|
||
func (op *Operator) MigrateNodeAlert() error { |
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.
mountPoint ?
plugins/check_event/lib.go
Outdated
@@ -42,7 +42,7 @@ type options struct { | |||
contextName string | |||
// Event check information | |||
namespace string | |||
checkInterval time.Duration | |||
checkInterval int |
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.
checkIntervalSecs
plugins/check_event/lib.go
Outdated
@@ -99,7 +104,16 @@ type serviceOutput struct { | |||
func (p *plugin) Check() (icinga.State, interface{}) { | |||
opts := p.options | |||
|
|||
checkTime := time.Now().Add(-(opts.checkInterval + opts.clockSkew)) | |||
var checkInterval time.Duration = 0 |
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.
- 1 time.Sec
No description provided.