Skip to content

Commit

Permalink
dont reuse buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
wleese committed Jan 14, 2019
1 parent 7bd3bd0 commit 0f9eac9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/e2e/prometheus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,11 @@ scrape_configs:
- 111.111.111.111:9090
`

var buf bytes.Buffer
if err := gzipConfig(&buf, []byte(firstConfig)); err != nil {
var bufOne bytes.Buffer
if err := gzipConfig(&bufOne, []byte(firstConfig)); err != nil {
t.Fatal(err)
}
firstConfigCompressed := buf.Bytes()
firstConfigCompressed := bufOne.Bytes()

cfg := &v1.Secret{
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -339,10 +339,11 @@ scrape_configs:
- 111.111.111.112:9090
`

if err := gzipConfig(&buf, []byte(secondConfig)); err != nil {
var bufTwo bytes.Buffer
if err := gzipConfig(&bufTwo, []byte(secondConfig)); err != nil {
t.Fatal(err)
}
secondConfigCompressed := buf.Bytes()
secondConfigCompressed := bufTwo.Bytes()

cfg, err := framework.KubeClient.CoreV1().Secrets(ns).Get(cfg.Name, metav1.GetOptions{})
if err != nil {
Expand Down

0 comments on commit 0f9eac9

Please sign in to comment.