Skip to content

Commit df9895f

Browse files
bugfix init
1 parent 7642b13 commit df9895f

File tree

4 files changed

+44
-460
lines changed

4 files changed

+44
-460
lines changed

build/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ FROM scratch
1414
COPY --from=build /usr/local/bin/pure-fa-om-exporter /pure-fa-om-exporter
1515
EXPOSE 9490
1616
ENTRYPOINT ["/pure-fa-om-exporter"]
17-
CMD ["--host", "0.0.0.0", "--port", "9490"]
17+
CMD ["--address", "0.0.0.0", "--port", "9490"]

cmd/fa-om-exporter/main.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ package main
33
import (
44
"context"
55
"fmt"
6+
"io"
67
"log"
78
"net/http"
9+
"os"
810
config "purestorage/fa-openmetrics-exporter/internal/config"
911
collectors "purestorage/fa-openmetrics-exporter/internal/openmetrics-exporter"
1012
client "purestorage/fa-openmetrics-exporter/internal/rest-client"
1113
"strings"
12-
"os"
13-
"io"
1414

15-
"gopkg.in/yaml.v3"
1615
"github.com/akamensky/argparse"
1716
"github.com/prometheus/client_golang/prometheus"
1817
"github.com/prometheus/client_golang/prometheus/promhttp"
18+
"gopkg.in/yaml.v3"
1919
)
2020

21-
var version string = "1.0.4"
21+
var version string = "1.0.4.hotfix1"
2222
var debug bool = false
2323
var arraytokens config.FlashArrayList
2424

@@ -42,15 +42,15 @@ func main() {
4242
defer at.Close()
4343
buf := make([]byte, 1024)
4444
arrlist := ""
45-
for {
45+
for {
4646
n, err := at.Read(buf)
4747
if err == io.EOF {
4848
break
4949
}
5050
if err != nil {
5151
log.Fatalf("Reading token file: %v", err)
5252
}
53-
if n > 0 {
53+
if n > 0 {
5454
arrlist = arrlist + string(buf[:n])
5555
}
5656
}
@@ -115,7 +115,7 @@ func metricsHandler(w http.ResponseWriter, r *http.Request) {
115115
}
116116
authHeader := r.Header.Get("Authorization")
117117
authFields := strings.Fields(authHeader)
118-
118+
119119
apitoken := arraytokens.GetApiToken(endpoint)
120120
if len(authFields) == 2 && strings.ToLower(authFields[0]) == "bearer" {
121121
apitoken = authFields[1]

go.mod

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ require (
1313

1414
require (
1515
github.com/beorn7/perks v1.0.1 // indirect
16-
github.com/cespare/xxhash/v2 v2.1.2 // indirect
16+
github.com/cespare/xxhash/v2 v2.2.0 // indirect
1717
github.com/golang/protobuf v1.5.2 // indirect
18-
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
19-
github.com/prometheus/common v0.37.0 // indirect
20-
github.com/prometheus/procfs v0.8.0 // indirect
21-
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
22-
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
18+
github.com/json-iterator/go v1.1.12 // indirect
19+
github.com/kr/pretty v0.3.1 // indirect
20+
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
21+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
22+
github.com/modern-go/reflect2 v1.0.2 // indirect
23+
github.com/prometheus/common v0.40.0 // indirect
24+
github.com/prometheus/procfs v0.9.0 // indirect
25+
golang.org/x/net v0.7.0 // indirect
26+
golang.org/x/sys v0.5.0 // indirect
2327
google.golang.org/protobuf v1.28.1 // indirect
2428
)

0 commit comments

Comments
 (0)