Skip to content

Commit

Permalink
Merge pull request #153 from PureStorage-OpenConnect/148-feature-requ…
Browse files Browse the repository at this point in the history
…est-add-tls-to-exporter-array-interface

Add secure mode to the exporter
  • Loading branch information
sdodsley authored Jul 29, 2024
2 parents 1568ae8 + af60512 commit 37087ec
Show file tree
Hide file tree
Showing 49 changed files with 62 additions and 56 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,20 @@ The `X-Request-ID` Header, as used in the Purity API, may be used when calling t

```shell

usage: pure-fa-om-exporter [-h|--help] [-a|--address "<value>"] [-p|--port <integer>] [-d|--debug] [-t|--tokens <file>] [-k|--key <file>] [-c|--cert <file>]
usage: pure-fa-om-exporter [-h|--help] [-a|--address "<value>"] [-p|--port <integer>] [-d|--debug] [-s|--secure] [-t|--tokens <file>] [-c|--cert "<value>"] [-k|--key "<value>"]

Pure Storage FA OpenMetrics exporter
Pure Storage FA OpenMetrics exporter

Arguments:

-h --help Print help information
-a --address IP address for this exporter to bind to. Default: 0.0.0.0
-p --port Port for this exporter to listen. Default: 9490
-d --debug Enable debug. Default: false
-s --secure Enable TLS verification when connecting to array. Default: false
-t --tokens API token(s) map file
-c --cert SSL/TLS certificate file. Required only for TLS
-k --key SSL/TLS private key file. Required only for TLS
-c --cert SSL/TLS certificate file. Required only for Exporter TLS
-k --key SSL/TLS private key file. Required only for Exporter TLS
```

The array token configuration file must have to following syntax:
Expand Down
9 changes: 6 additions & 3 deletions cmd/fa-om-exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (

var version string = "development"
var debug bool = false
var secure bool = false
var arraytokens config.FlashArrayList

func fileExists(args []string) error {
Expand All @@ -41,9 +42,10 @@ func main() {
host := parser.String("a", "address", &argparse.Options{Required: false, Help: "IP address for this exporter to bind to", Default: "0.0.0.0"})
port := parser.Int("p", "port", &argparse.Options{Required: false, Help: "Port for this exporter to listen", Default: 9490})
d := parser.Flag("d", "debug", &argparse.Options{Required: false, Help: "Enable debug", Default: false})
s := parser.Flag("s", "secure", &argparse.Options{Required: false, Help: "Enable TLS verification when connecting to array", Default: false})
at := parser.File("t", "tokens", os.O_RDONLY, 0600, &argparse.Options{Required: false, Validate: fileExists, Help: "API token(s) map file"})
cert := parser.String("c", "cert", &argparse.Options{Required: false, Help: "SSL/TLS certificate file. Required only for TLS"})
key := parser.String("k", "key", &argparse.Options{Required: false, Help: "SSL/TLS private key file. Required only for TLS"})
cert := parser.String("c", "cert", &argparse.Options{Required: false, Help: "SSL/TLS certificate file. Required only for Exporter TLS"})
key := parser.String("k", "key", &argparse.Options{Required: false, Help: "SSL/TLS private key file. Required only for Exporter TLS"})
err := parser.Parse(os.Args)
if err != nil {
log.Fatalf("Error in token file: %v", err)
Expand Down Expand Up @@ -81,6 +83,7 @@ func main() {
}
}
debug = *d
secure = *s
addr := fmt.Sprintf("%s:%d", *host, *port)
log.Printf("Start Pure FlashArray exporter %s on %s", version, addr)

Expand Down Expand Up @@ -159,7 +162,7 @@ func metricsHandler(w http.ResponseWriter, r *http.Request) {
rid := r.Header.Get("X-Request-ID")

registry := prometheus.NewRegistry()
faclient := client.NewRestClient(address, apitoken, apiver, uagent, rid, debug)
faclient := client.NewRestClient(address, apitoken, apiver, uagent, rid, debug, secure)
if faclient.Error != nil {
log.Printf("[ERROR] %s %s %s %s FACLIENT ERROR: %s\n", r.RemoteAddr, r.Method, r.URL, r.Header.Get("User-Agent"), faclient.Error.Error())
http.Error(w, faclient.Error.Error(), http.StatusBadRequest)
Expand Down
2 changes: 1 addition & 1 deletion internal/openmetrics-exporter/alerts_collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestAlertsCollector(t *testing.T) {

want[fmt.Sprintf("label:{name:\"category\" value:\"%s\"} label:{name:\"code\" value:\"%s\"} label:{name:\"component_type\" value:\"%s\"} label:{name:\"created\" value:\"%s\"} label:{name:\"issue\" value:\"%s\"} label:{name:\"name\" value:\"%s\"} label:{name:\"severity\" value:\"%s\"} label:{name:\"summary\" value:\"%s\"} gauge:{value:%g}", alert[0], alert[1], alert[2], alert[3], alert[4], alert[5], alert[6], alert[7], n)] = true
}
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)
ac := NewAlertsCollector(c)
metricsCheck(t, ac, want)
server.Close()
Expand Down
2 changes: 1 addition & 1 deletion internal/openmetrics-exporter/arrays_collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestArraysCollector(t *testing.T) {

want[fmt.Sprintf("label:{name:\"array_name\" value:\"%s\"} label:{name:\"os\" value:\"%s\"} label:{name:\"subscription_type\" value:\"%s\"} label:{name:\"system_id\" value:\"%s\"} label:{name:\"version\" value:\"%s\"} gauge:{value:1}", a.Name, a.Os, s.Service, a.Id, a.Version)] = true

c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)
ac := NewArraysCollector(c)
metricsCheck(t, ac, want)
server.Close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestArrayControllersCollector(t *testing.T) {
want[fmt.Sprintf("label:{name:\"mode\" value:\"%s\"} label:{name:\"model\"value:\"%s\"} label:{name:\"name\" value:\"%s\"} label:{name:\"status\" value:\"%s\"} label:{name:\"type\" value:\"%s\"} label:{name:\"version\" value:\"%s\"} gauge:{value:\"%g\"}", ctl.Mode, ctl.Model, ctl.Name, ctl.Status, ctl.Type, ctl.Version, (float64(ctl.ModeSince)/1000))] = true
}

c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

dc := NewControllersCollector(c)
metricsCheck(t, dc, want)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestArrayPerformanceCollector(t *testing.T) {
want[fmt.Sprintf("label:{name:\"dimension\" value:\"bytes_per_read\"} gauge:{value:%g}", p.BytesPerRead)] = true
want[fmt.Sprintf("label:{name:\"dimension\" value:\"bytes_per_write\"} gauge:{value:%g}", p.BytesPerWrite)] = true
want[fmt.Sprintf("gauge:{value:%g}", p.QueueDepth)] = true
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

pc := NewArraysPerformanceCollector(c)
metricsCheck(t, pc, want)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func TestArraySpaceCollector(t *testing.T) {
want[fmt.Sprintf("label:{name:\"space\" value:\"empty\"} gauge:{value:%g}", a.Capacity-(float64(*a.Space.System)+float64(*a.Space.Replication)+float64(*a.Space.Shared)+float64(*a.Space.Snapshots)+float64(*a.Space.Unique)))] = true
want[fmt.Sprintf("gauge:{value:%g}", (float64(*a.Space.System)+float64(*a.Space.Replication)+float64(*a.Space.Shared)+float64(*a.Space.Snapshots)+float64(*a.Space.Unique))/a.Capacity*100)] = true
defer server.Close()
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

ac := NewArraySpaceCollector(c)
metricsCheck(t, ac, want)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestDirectoriesPerformanceCollector(t *testing.T) {
want[fmt.Sprintf("label:{name:\"dimension\" value:\"bytes_per_read\"} label:{name:\"name\" value:\"%s\"} gauge:{value:%g}", p.Name, p.BytesPerRead)] = true
want[fmt.Sprintf("label:{name:\"dimension\" value:\"bytes_per_write\"} label:{name:\"name\" value:\"%s\"} gauge:{value:%g}", p.Name, p.BytesPerWrite)] = true
}
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

pc := NewDirectoriesPerformanceCollector(c)
metricsCheck(t, pc, want)
Expand Down
2 changes: 1 addition & 1 deletion internal/openmetrics-exporter/dirs_space_collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestDirectoriesSpaceCollector(t *testing.T) {
}
}
defer server.Close()
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

hc := NewDirectoriesSpaceCollector(c)
metricsCheck(t, hc, want)
Expand Down
2 changes: 1 addition & 1 deletion internal/openmetrics-exporter/drives_collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestDriveCollector(t *testing.T) {
want[fmt.Sprintf("label:{name:\"component_name\" value:\"%s\"} label:{name:\"component_status\" value:\"%s\"} label:{name:\"component_type\" value:\"%s\"} label:{name:\"component_type\" value:\"%s\"} gauge:{value:\"%g\"}", d.Name, d.Type, d.Status, d.Protocol, d.Capacity)] = true
}

c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

dc := NewDriveCollector(c)
metricsCheck(t, dc, want)
Expand Down
2 changes: 1 addition & 1 deletion internal/openmetrics-exporter/hardware_collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestHardwareCollector(t *testing.T) {
want[fmt.Sprintf("label:{name:\"component_name\" value:\"%s\"} label:{name:\"component_type\" value:\"%s\"} gauge:{value:%g}", h.Name, h.Type, float64(h.Voltage))] = true
}
}
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

hc := NewHardwareCollector(c)
metricsCheck(t, hc, want)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestHostConnectionsCollector(t *testing.T) {
for _, hc := range conn.Items {
want[fmt.Sprintf("label:{name:\"host\" value:\"%s\"} label:{name:\"hostgroup\" value:\"%s\"} label:{name:\"volume\" value:\"%s\"} gauge:{value:1}", hc.Host.Name, hc.HostGroup.Name, hc.Volume.Name)] = true
}
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

hc := NewHostConnectionsCollector(c)
metricsCheck(t, hc, want)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestHostsPerformanceCollector(t *testing.T) {
want[fmt.Sprintf("label:{name:\"dimension\" value:\"bytes_per_read\"} label:{name:\"host\" value:\"%s\"} gauge:{value:%g}", p.Name, p.BytesPerRead)] = true
want[fmt.Sprintf("label:{name:\"dimension\" value:\"bytes_per_write\"} label:{name:\"host\" value:\"%s\"} gauge:{value:%g}", p.Name, p.BytesPerWrite)] = true
}
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

pc := NewHostsPerformanceCollector(c)
metricsCheck(t, pc, want)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestHostsSpaceCollector(t *testing.T) {
want[fmt.Sprintf("label:{name:\"host\" value:\"%s\"} label:{name:\"details\" value:\"%s\"} label:{name:\"status\" value:\"%s\"} gauge:{value:1}", h.Name, h.PortConnectivity.Details, h.PortConnectivity.Status)] = true
}
defer server.Close()
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

hc := NewHostsSpaceCollector(c)
metricsCheck(t, hc, want)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestNetworkInterfacesCollectorTest(t *testing.T) {
for _, h := range hwl.Items {
want[fmt.Sprintf("label:{name:\"enabled\" value:\"%s\"} label:{name:\"ethsubtype\" value:\"%s\"} label:{name:\"name\" value:\"%s\"} label:{name:\"services\" value:\"%s\"} label:{name:\"type\" value:\"%s\"} gauge:{value:%g}", strconv.FormatBool(h.Enabled), h.Eth.Subtype, h.Name, strings.Join(h.Services, ", "), h.InterfaceType, float64(h.Speed))] = true
}
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

nc := NewNetworkInterfacesCollector(c)
metricsCheck(t, nc, want)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestNetworkInterfacesPerformanceCollector(t *testing.T) {
want[fmt.Sprintf("label:{name:\"dimension\" value:\"%s\"} label:{name:\"name\" value:\"%s\"} label:{name:\"type\" value:\"%s\"} gauge:{value:%g}", "transmitted_invalid_words_per_sec", n.Name, n.InterfaceType, n.Fc.TransmittedInvalidWordsPerSec)] = true
}
}
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

pc := NewNetworkInterfacesPerformanceCollector(c)
metricsCheck(t, pc, want)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestPodReplicaLinksLagCollector(t *testing.T) {
want[fmt.Sprintf("label:{name:\"direction\" value:\"%s\"} label:{name:\"local_pod\" value:\"%s\"} label:{name:\"remote\" value:\"%s\"} label:{name:\"remote_pod\" value:\"%s\"} label:{name:\"status\" value:\"%s\"} gauge:{value:%g}", p.Direction, p.LocalPod.Name, p.Remotes[0].Name, p.RemotePod.Name, p.Status, p.Lag.Max)] = true

}
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

pc := NewPodReplicaLinksLagCollector(c)
metricsCheck(t, pc, want)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestPodReplicaLinksPerformanceCollector(t *testing.T) {
want[fmt.Sprintf("label:{name:\"dimension\" value:\"bytes_per_sec_total\"} label:{name:\"direction\" value:\"%s\"} label:{name:\"local_pod\" value:\"%s\"} label:{name:\"remote\" value:\"%s\"} label:{name:\"remote_pod\" value:\"%s\"} gauge:{value:%g}", p.Direction, p.LocalPod.Name, p.Remotes[0].Name, p.RemotePod.Name, p.BytesPerSecTotal)] = true

}
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

pc := NewPodReplicaLinksPerformanceCollector(c)
metricsCheck(t, pc, want)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func TestPodsPerformanceCollector(t *testing.T) {
want[fmt.Sprintf("label:{name:\"dimension\" value:\"bytes_per_read\"} label:{name:\"name\" value:\"%s\"} gauge:{value:%g}", p.Name, p.BytesPerRead)] = true
want[fmt.Sprintf("label:{name:\"dimension\" value:\"bytes_per_write\"} label:{name:\"name\" value:\"%s\"} gauge:{value:%g}", p.Name, p.BytesPerWrite)] = true
}
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

pc := NewPodsPerformanceCollector(c)
metricsCheck(t, pc, want)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestPodsPerformanceReplicationCollector(t *testing.T) {
want[fmt.Sprintf("label:{name:\"dimension\" value:\"sync\"} label:{name:\"direction\" value:\"total\"} label:{name:\"name\" value:\"%s\"} gauge:{value:%g}", p.Pod.Name, p.SyncBytesPerSec.TotalBytesPerSec)] = true
want[fmt.Sprintf("label:{name:\"dimension\" value:\"periodic\"} label:{name:\"direction\" value:\"total\"} label:{name:\"name\" value:\"%s\"} gauge:{value:%g}", p.Pod.Name, p.PeriodicBytesPerSec.TotalBytesPerSec)] = true
}
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

pc := NewPodsPerformanceReplicationCollector(c)
metricsCheck(t, pc, want)
Expand Down
2 changes: 1 addition & 1 deletion internal/openmetrics-exporter/pods_space_collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestPodsSpaceCollector(t *testing.T) {
}
}
defer server.Close()
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

pc := NewPodsSpaceCollector(c)
metricsCheck(t, pc, want)
Expand Down
2 changes: 1 addition & 1 deletion internal/openmetrics-exporter/ports_collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestPortsCollector(t *testing.T) {
for _, h := range hwl.Items {
want[fmt.Sprintf("label:{name:\"iqn\" value:\"%s\"} label:{name:\"name\" value:\"%s\"} label:{name:\"nqn\" value:\"%s\"} label:{name:\"portal\" value:\"%s\"} label:{name:\"wwn\" value:\"%s\"} gauge:{value:1}", h.Iqn, h.Name, h.Nqn, h.Portal, h.Wwn)] = true
}
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)
pc := NewPortsCollector(c)
metricsCheck(t, pc, want)
server.Close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestVolumesPerformanceCollector(t *testing.T) {
want[fmt.Sprintf("label:{name:\"dimension\" value:\"bytes_per_read\"} label:{name:\"naa_id\" value:\"%s\"} label:{name:\"name\" value:\"%s\"} gauge:{value:%g}", naaid[p.Name], p.Name, p.BytesPerRead)] = true
want[fmt.Sprintf("label:{name:\"dimension\" value:\"bytes_per_write\"} label:{name:\"naa_id\" value:\"%s\"} label:{name:\"name\" value:\"%s\"} gauge:{value:%g}", naaid[p.Name], p.Name, p.BytesPerWrite)] = true
}
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)

vl := c.GetVolumes()
pc := NewVolumesPerformanceCollector(c, vl)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func TestVolumesSpaceCollector(t *testing.T) {
}
}
defer server.Close()
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)
vl := c.GetVolumes()
pc := NewVolumesSpaceCollector(vl)
metricsCheck(t, pc, want)
Expand Down
4 changes: 2 additions & 2 deletions internal/rest-client/alerts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ func TestAlerts(t *testing.T) {
endp := strings.Split(server.URL, "/")
e := endp[len(endp)-1]
t.Run("alerts_open", func(t *testing.T) {
c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)
al := c.GetAlerts("state='open'")
if diff := cmp.Diff(al.Items, aopen.Items); diff != "" {
t.Errorf("Mismatch (-want +got):\n%s", diff)
server.Close()
}
})
t.Run("alerts_all", func(t *testing.T) {
c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)
al := c.GetAlerts("")
if diff := cmp.Diff(al.Items, aall.Items); diff != "" {
t.Errorf("Mismatch (-want +got):\n%s", diff)
Expand Down
2 changes: 1 addition & 1 deletion internal/rest-client/arrays_performance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestArraysPerformance(t *testing.T) {
e := endp[len(endp)-1]
t.Run("arrays_performance_1", func(t *testing.T) {
defer server.Close()
c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false)
c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", "test-X-Request-Id-string", false, false)
apl := c.GetArraysPerformance()
if diff := cmp.Diff(apl.Items[0], arrsp.Items[0]); diff != "" {
t.Errorf("Mismatch (-want +got):\n%s", diff)
Expand Down
Loading

0 comments on commit 37087ec

Please sign in to comment.