-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from vshn/fix/sli_proper_redis_tls
Fix SLI prober when TLS is disabled for Redis
- Loading branch information
Showing
4 changed files
with
241 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package probes | ||
|
||
import ( | ||
"context" | ||
) | ||
|
||
var _ Prober = FailingProbe{} | ||
|
||
// FailingProbe is a prober that will always fail. | ||
type FailingProbe struct { | ||
Service string | ||
Name string | ||
Namespace string | ||
Error error | ||
} | ||
|
||
// Close closes open connections. | ||
func (p FailingProbe) Close() error { | ||
return nil | ||
} | ||
|
||
// GetInfo returns the prober infos | ||
func (p FailingProbe) GetInfo() ProbeInfo { | ||
return ProbeInfo{ | ||
Service: p.Service, | ||
Name: p.Name, | ||
Namespace: p.Namespace, | ||
} | ||
} | ||
|
||
// Will always return error, as this is a failing probe. | ||
func (p FailingProbe) Probe(ctx context.Context) error { | ||
return p.Error | ||
} | ||
|
||
// NewFailing creates a prober that will fail. | ||
// Can be used if the controller can't access valid credentials. | ||
func NewFailingProbe(service, name, namespace string, err error) (*FailingProbe, error) { | ||
return &FailingProbe{ | ||
Service: service, | ||
Name: name, | ||
Namespace: namespace, | ||
Error: err, | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.