Make linters happy
This commit is contained in:
parent
ce986e8d1d
commit
e4dcfeacd5
@ -1,9 +1,9 @@
|
||||
ARG REPO=library
|
||||
FROM golang:1.12-alpine AS builder
|
||||
|
||||
RUN apk add --no-cache git=~2
|
||||
RUN apk add --no-cache git=~2 \
|
||||
&& mkdir /app
|
||||
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
|
||||
COPY ./go.mod ./go.sum /app/
|
||||
|
2
main.go
2
main.go
@ -92,7 +92,7 @@ func main() {
|
||||
flag.BoolVar(&slog.DebugLevel, "debug", false, "Enables debug logs (default: false)")
|
||||
flag.BoolVar(&ExportMetrics, "metrics", false, "Enables prometheus metrics exporting (default: false)")
|
||||
flag.BoolVar(&PyCompat, "py-compat", false, "Enables support for legacy Python Minitor config. Will eventually be removed. (default: false)")
|
||||
flag.IntVar(&MetricsPort, "metrics-port", 8080, "The port that Prometheus metrics should be exported on, if enabled. (default: 8080)")
|
||||
flag.IntVar(&MetricsPort, "metrics-port", MetricsPort, "The port that Prometheus metrics should be exported on, if enabled. (default: 8080)")
|
||||
flag.Parse()
|
||||
|
||||
// Print version if flag is provided
|
||||
|
18
main_test.go
18
main_test.go
@ -16,7 +16,7 @@ func TestCheckMonitors(t *testing.T) {
|
||||
{
|
||||
config: Config{
|
||||
Monitors: []*Monitor{
|
||||
&Monitor{
|
||||
{
|
||||
Name: "Success",
|
||||
Command: CommandOrShell{Command: []string{"true"}},
|
||||
},
|
||||
@ -28,7 +28,7 @@ func TestCheckMonitors(t *testing.T) {
|
||||
{
|
||||
config: Config{
|
||||
Monitors: []*Monitor{
|
||||
&Monitor{
|
||||
{
|
||||
Name: "Failure",
|
||||
Command: CommandOrShell{Command: []string{"false"}},
|
||||
AlertAfter: 1,
|
||||
@ -41,7 +41,7 @@ func TestCheckMonitors(t *testing.T) {
|
||||
{
|
||||
config: Config{
|
||||
Monitors: []*Monitor{
|
||||
&Monitor{
|
||||
{
|
||||
Name: "Success",
|
||||
Command: CommandOrShell{Command: []string{"ls"}},
|
||||
alertCount: 1,
|
||||
@ -54,7 +54,7 @@ func TestCheckMonitors(t *testing.T) {
|
||||
{
|
||||
config: Config{
|
||||
Monitors: []*Monitor{
|
||||
&Monitor{
|
||||
{
|
||||
Name: "Failure",
|
||||
Command: CommandOrShell{Command: []string{"false"}},
|
||||
AlertDown: []string{"unknown"},
|
||||
@ -68,7 +68,7 @@ func TestCheckMonitors(t *testing.T) {
|
||||
{
|
||||
config: Config{
|
||||
Monitors: []*Monitor{
|
||||
&Monitor{
|
||||
{
|
||||
Name: "Success",
|
||||
Command: CommandOrShell{Command: []string{"true"}},
|
||||
AlertUp: []string{"unknown"},
|
||||
@ -82,7 +82,7 @@ func TestCheckMonitors(t *testing.T) {
|
||||
{
|
||||
config: Config{
|
||||
Monitors: []*Monitor{
|
||||
&Monitor{
|
||||
{
|
||||
Name: "Failure",
|
||||
Command: CommandOrShell{Command: []string{"false"}},
|
||||
AlertDown: []string{"good"},
|
||||
@ -90,7 +90,7 @@ func TestCheckMonitors(t *testing.T) {
|
||||
},
|
||||
},
|
||||
Alerts: map[string]*Alert{
|
||||
"good": &Alert{
|
||||
"good": {
|
||||
Command: CommandOrShell{Command: []string{"true"}},
|
||||
},
|
||||
},
|
||||
@ -101,7 +101,7 @@ func TestCheckMonitors(t *testing.T) {
|
||||
{
|
||||
config: Config{
|
||||
Monitors: []*Monitor{
|
||||
&Monitor{
|
||||
{
|
||||
Name: "Failure",
|
||||
Command: CommandOrShell{Command: []string{"false"}},
|
||||
AlertDown: []string{"bad"},
|
||||
@ -109,7 +109,7 @@ func TestCheckMonitors(t *testing.T) {
|
||||
},
|
||||
},
|
||||
Alerts: map[string]*Alert{
|
||||
"bad": &Alert{
|
||||
"bad": {
|
||||
Name: "bad",
|
||||
Command: CommandOrShell{Command: []string{"false"}},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user