diff --git a/integration/client/client.go b/integration/client/client.go index 0dae393c35ae..09ff9292c937 100644 --- a/integration/client/client.go +++ b/integration/client/client.go @@ -6,7 +6,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "net/http" "net/url" "strconv" @@ -150,7 +149,7 @@ func (c *Client) pushLogLine(line string, timestamp time.Time, extraLabelList .. return nil } - buf, err := ioutil.ReadAll(res.Body) + buf, err := io.ReadAll(res.Body) if err != nil { return fmt.Errorf("reading request failed with status code %v: %w", res.StatusCode, err) } @@ -430,7 +429,7 @@ func (c *Client) run(u string) ([]byte, int, error) { } defer res.Body.Close() - buf, err := ioutil.ReadAll(res.Body) + buf, err := io.ReadAll(res.Body) if err != nil { return nil, 0, fmt.Errorf("request failed with status code %v: %w", res.StatusCode, err) } diff --git a/integration/cluster/cluster.go b/integration/cluster/cluster.go index cb01b349d158..787aefb068cf 100644 --- a/integration/cluster/cluster.go +++ b/integration/cluster/cluster.go @@ -4,7 +4,6 @@ import ( "errors" "flag" "fmt" - "io/ioutil" "net" "net/http/httptest" "net/url" @@ -115,7 +114,7 @@ type Cluster struct { func New() *Cluster { wrapRegistry() - sharedPath, err := ioutil.TempDir("", "loki-shared-data") + sharedPath, err := os.MkdirTemp("", "loki-shared-data") if err != nil { panic(err.Error()) } @@ -157,7 +156,6 @@ func (c *Cluster) Cleanup() error { c.waitGroup.Wait() // cleanup dirs/files - for _, d := range dirs { errs.Add(os.RemoveAll(d)) } @@ -220,14 +218,14 @@ func (c *Component) GRPCURL() *url.URL { func (c *Component) writeConfig() error { var err error - configFile, err := ioutil.TempFile("", "loki-config") + configFile, err := os.CreateTemp("", "loki-config") if err != nil { return fmt.Errorf("error creating config file: %w", err) } - c.dataPath, err = ioutil.TempDir("", "loki-data") + c.dataPath, err = os.MkdirTemp("", "loki-data") if err != nil { - return fmt.Errorf("error creating config file: %w", err) + return fmt.Errorf("error creating data path: %w", err) } if err := configTemplate.Execute(configFile, map[string]interface{}{ @@ -241,7 +239,7 @@ func (c *Component) writeConfig() error { } if err := configFile.Close(); err != nil { - return fmt.Errorf("error writing config file: %w", err) + return fmt.Errorf("error closing config file: %w", err) } c.configFile = configFile.Name() diff --git a/integration/loki_micro_services_test.go b/integration/loki_micro_services_test.go index 33a576d5b2a1..954dd8fce177 100644 --- a/integration/loki_micro_services_test.go +++ b/integration/loki_micro_services_test.go @@ -29,7 +29,7 @@ func TestMicroServicesIngestQuery(t *testing.T) { tIngester = clu.AddComponent( "ingester", "-target=ingester", - // "-boltdb.shipper.index-gateway-client.server-address="+tIndexGateway.GRPCURL().Host, + "-boltdb.shipper.index-gateway-client.server-address="+tIndexGateway.GRPCURL().Host, ) tQueryScheduler = clu.AddComponent( "query-scheduler",