Skip to content

Commit

Permalink
Merge pull request #36 from chrroberts-pure/1.0.4.hotfix
Browse files Browse the repository at this point in the history
1.0.4.hotfix
  • Loading branch information
sdodsley authored Feb 22, 2023
2 parents 13d1ffd + df9895f commit df8de26
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 460 deletions.
2 changes: 1 addition & 1 deletion build/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ FROM scratch
COPY --from=build /usr/local/bin/pure-fa-om-exporter /pure-fa-om-exporter
EXPOSE 9490
ENTRYPOINT ["/pure-fa-om-exporter"]
CMD ["--host", "0.0.0.0", "--port", "9490"]
CMD ["--address", "0.0.0.0", "--port", "9490"]
14 changes: 7 additions & 7 deletions cmd/fa-om-exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ package main
import (
"context"
"fmt"
"io"
"log"
"net/http"
"os"
config "purestorage/fa-openmetrics-exporter/internal/config"
collectors "purestorage/fa-openmetrics-exporter/internal/openmetrics-exporter"
client "purestorage/fa-openmetrics-exporter/internal/rest-client"
"strings"
"os"
"io"

"gopkg.in/yaml.v3"
"github.com/akamensky/argparse"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"gopkg.in/yaml.v3"
)

var version string = "1.0.4"
var version string = "1.0.4.hotfix1"
var debug bool = false
var arraytokens config.FlashArrayList

Expand All @@ -42,15 +42,15 @@ func main() {
defer at.Close()
buf := make([]byte, 1024)
arrlist := ""
for {
for {
n, err := at.Read(buf)
if err == io.EOF {
break
}
if err != nil {
log.Fatalf("Reading token file: %v", err)
}
if n > 0 {
if n > 0 {
arrlist = arrlist + string(buf[:n])
}
}
Expand Down Expand Up @@ -115,7 +115,7 @@ func metricsHandler(w http.ResponseWriter, r *http.Request) {
}
authHeader := r.Header.Get("Authorization")
authFields := strings.Fields(authHeader)

apitoken := arraytokens.GetApiToken(endpoint)
if len(authFields) == 2 && strings.ToLower(authFields[0]) == "bearer" {
apitoken = authFields[1]
Expand Down
16 changes: 10 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ require (

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/prometheus/common v0.40.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
)
Loading

0 comments on commit df8de26

Please sign in to comment.