mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-24 23:34:45 +00:00
Remove the usages of deprecated io/ioutil
package
This commit is contained in:
parent
5250e4bde8
commit
71d1323640
@ -2,7 +2,6 @@ package acceptanceTests
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"testing"
|
"testing"
|
||||||
@ -58,7 +57,7 @@ func TestConfigRegenerate(t *testing.T) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
_, readFileErr := ioutil.ReadFile(configPath)
|
_, readFileErr := os.ReadFile(configPath)
|
||||||
if readFileErr != nil {
|
if readFileErr != nil {
|
||||||
t.Errorf("failed to read config file, err: %v", readFileErr)
|
t.Errorf("failed to read config file, err: %v", readFileErr)
|
||||||
return
|
return
|
||||||
@ -95,7 +94,7 @@ func TestConfigGuiPort(t *testing.T) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if writeErr := ioutil.WriteFile(configPath, configBytes, 0644); writeErr != nil {
|
if writeErr := os.WriteFile(configPath, configBytes, 0644); writeErr != nil {
|
||||||
t.Errorf("failed to write config to file, err: %v", writeErr)
|
t.Errorf("failed to write config to file, err: %v", writeErr)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -168,7 +167,7 @@ func TestConfigSetGuiPort(t *testing.T) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if writeErr := ioutil.WriteFile(configPath, configBytes, 0644); writeErr != nil {
|
if writeErr := os.WriteFile(configPath, configBytes, 0644); writeErr != nil {
|
||||||
t.Errorf("failed to write config to file, err: %v", writeErr)
|
t.Errorf("failed to write config to file, err: %v", writeErr)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -243,7 +242,7 @@ func TestConfigFlagGuiPort(t *testing.T) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if writeErr := ioutil.WriteFile(configPath, configBytes, 0644); writeErr != nil {
|
if writeErr := os.WriteFile(configPath, configBytes, 0644); writeErr != nil {
|
||||||
t.Errorf("failed to write config to file, err: %v", writeErr)
|
t.Errorf("failed to write config to file, err: %v", writeErr)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ package acceptanceTests
|
|||||||
import (
|
import (
|
||||||
"archive/zip"
|
"archive/zip"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
@ -532,7 +532,7 @@ func TestTapDumpLogs(t *testing.T) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
files, readErr := ioutil.ReadDir(kubesharkFolderPath)
|
files, readErr := os.ReadDir(kubesharkFolderPath)
|
||||||
if readErr != nil {
|
if readErr != nil {
|
||||||
t.Errorf("failed to read kubeshark folder files, err: %v", readErr)
|
t.Errorf("failed to read kubeshark folder files, err: %v", readErr)
|
||||||
return
|
return
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
@ -330,7 +330,7 @@ func ExecuteHttpRequest(response *http.Response, requestErr error) (interface{},
|
|||||||
|
|
||||||
defer func() { response.Body.Close() }()
|
defer func() { response.Body.Close() }()
|
||||||
|
|
||||||
data, readErr := ioutil.ReadAll(response.Body)
|
data, readErr := io.ReadAll(response.Body)
|
||||||
if readErr != nil {
|
if readErr != nil {
|
||||||
return nil, readErr
|
return nil, readErr
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
@ -223,7 +222,7 @@ func disableRootStaticCache() gin.HandlerFunc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setUIFlags(uiIndexPath string) error {
|
func setUIFlags(uiIndexPath string) error {
|
||||||
read, err := ioutil.ReadFile(uiIndexPath)
|
read, err := os.ReadFile(uiIndexPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -231,7 +230,7 @@ func setUIFlags(uiIndexPath string) error {
|
|||||||
replacedContent := strings.Replace(string(read), "__IS_OAS_ENABLED__", strconv.FormatBool(config.Config.OAS.Enable), 1)
|
replacedContent := strings.Replace(string(read), "__IS_OAS_ENABLED__", strconv.FormatBool(config.Config.OAS.Enable), 1)
|
||||||
replacedContent = strings.Replace(replacedContent, "__IS_SERVICE_MAP_ENABLED__", strconv.FormatBool(config.Config.ServiceMap), 1)
|
replacedContent = strings.Replace(replacedContent, "__IS_SERVICE_MAP_ENABLED__", strconv.FormatBool(config.Config.ServiceMap), 1)
|
||||||
|
|
||||||
err = ioutil.WriteFile(uiIndexPath, []byte(replacedContent), 0)
|
err = os.WriteFile(uiIndexPath, []byte(replacedContent), 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package config
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/kubeshark/kubeshark/shared"
|
"github.com/kubeshark/kubeshark/shared"
|
||||||
@ -23,7 +22,7 @@ func LoadConfig() error {
|
|||||||
}
|
}
|
||||||
filePath := fmt.Sprintf("%s%s", shared.ConfigDirPath, shared.ConfigFileName)
|
filePath := fmt.Sprintf("%s%s", shared.ConfigDirPath, shared.ConfigFileName)
|
||||||
|
|
||||||
content, err := ioutil.ReadFile(filePath)
|
content, err := os.ReadFile(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
return applyDefaultConfig()
|
return applyDefaultConfig()
|
||||||
|
@ -6,7 +6,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -111,7 +110,7 @@ func feedFromHAR(file string, isSync bool, gen *defaultOasGenerator) (uint, erro
|
|||||||
|
|
||||||
defer fd.Close()
|
defer fd.Close()
|
||||||
|
|
||||||
data, err := ioutil.ReadAll(fd)
|
data, err := io.ReadAll(fd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"mime"
|
"mime"
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
"net/textproto"
|
"net/textproto"
|
||||||
@ -615,7 +614,7 @@ func handleFormDataMultipart(text string, content *openapi.MediaType, ctypeParam
|
|||||||
}
|
}
|
||||||
defer part.Close()
|
defer part.Close()
|
||||||
|
|
||||||
body, err := ioutil.ReadAll(part)
|
body, err := io.ReadAll(part)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Log.Errorf("Error reading multipart Part %s: %v", part.Header, err)
|
logger.Log.Errorf("Error reading multipart Part %s: %v", part.Header, err)
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ package oas
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
@ -29,7 +29,7 @@ func outputSpec(label string, spec *openapi.OpenAPI, t *testing.T) string {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
err = ioutil.WriteFile(path+"/"+label+".json", content, 0644)
|
err = os.WriteFile(path+"/"+label+".json", content, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@ -150,7 +150,7 @@ func TestFileSingle(t *testing.T) {
|
|||||||
t.FailNow()
|
t.FailNow()
|
||||||
}
|
}
|
||||||
|
|
||||||
expected, err := ioutil.ReadFile(file + ".spec.json")
|
expected, err := os.ReadFile(file + ".spec.json")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf(err.Error())
|
t.Errorf(err.Error())
|
||||||
t.FailNow()
|
t.FailNow()
|
||||||
@ -170,7 +170,7 @@ func TestFileSingle(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if os.Getenv("KUBESHARK_OAS_WRITE_FILES") != "" {
|
if os.Getenv("KUBESHARK_OAS_WRITE_FILES") != "" {
|
||||||
err = ioutil.WriteFile(file+".spec.json", []byte(specText), 0644)
|
err = os.WriteFile(file+".spec.json", []byte(specText), 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@ -194,7 +194,7 @@ func loadStartingOAS(file string, label string, specs *sync.Map) {
|
|||||||
|
|
||||||
defer fd.Close()
|
defer fd.Close()
|
||||||
|
|
||||||
data, err := ioutil.ReadAll(fd)
|
data, err := io.ReadAll(fd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@ -252,7 +252,7 @@ func TestLoadValid3_1(t *testing.T) {
|
|||||||
|
|
||||||
defer fd.Close()
|
defer fd.Close()
|
||||||
|
|
||||||
data, err := ioutil.ReadAll(fd)
|
data, err := io.ReadAll(fd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Log(err)
|
t.Log(err)
|
||||||
t.FailNow()
|
t.FailNow()
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
@ -59,7 +58,7 @@ func CheckErr(e error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ReadJsonFile(filePath string, value interface{}) error {
|
func ReadJsonFile(filePath string, value interface{}) error {
|
||||||
if content, err := ioutil.ReadFile(filePath); err != nil {
|
if content, err := os.ReadFile(filePath); err != nil {
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
if err = json.Unmarshal(content, value); err != nil {
|
if err = json.Unmarshal(content, value); err != nil {
|
||||||
@ -74,7 +73,7 @@ func SaveJsonFile(filePath string, value interface{}) error {
|
|||||||
if data, err := json.Marshal(value); err != nil {
|
if data, err := json.Marshal(value); err != nil {
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
if err = ioutil.WriteFile(filePath, data, 0644); err != nil {
|
if err = os.WriteFile(filePath, data, 0644); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,11 @@ package bucket
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/kubeshark/kubeshark/cli/utils"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/kubeshark/kubeshark/cli/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
@ -33,7 +34,7 @@ func (provider *Provider) GetInstallTemplate(templateName string) (string, error
|
|||||||
|
|
||||||
defer response.Body.Close()
|
defer response.Body.Close()
|
||||||
|
|
||||||
installTemplate, err := ioutil.ReadAll(response.Body)
|
installTemplate, err := io.ReadAll(response.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ package config
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -78,7 +78,7 @@ func WriteConfig(config *ConfigStruct) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data := []byte(template)
|
data := []byte(template)
|
||||||
if err := ioutil.WriteFile(Config.ConfigFilePath, data, 0644); err != nil {
|
if err := os.WriteFile(Config.ConfigFilePath, data, 0644); err != nil {
|
||||||
return fmt.Errorf("failed writing config, err: %v", err)
|
return fmt.Errorf("failed writing config, err: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ func loadConfigFile(configFilePath string, config *ConfigStruct) error {
|
|||||||
return openErr
|
return openErr
|
||||||
}
|
}
|
||||||
|
|
||||||
buf, readErr := ioutil.ReadAll(reader)
|
buf, readErr := io.ReadAll(reader)
|
||||||
if readErr != nil {
|
if readErr != nil {
|
||||||
return readErr
|
return readErr
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package configStructs
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
@ -70,7 +69,7 @@ func (config *TapConfig) GetInsertionFilter() string {
|
|||||||
insertionFilter := config.InsertionFilter
|
insertionFilter := config.InsertionFilter
|
||||||
if fs.ValidPath(insertionFilter) {
|
if fs.ValidPath(insertionFilter) {
|
||||||
if _, err := os.Stat(insertionFilter); err == nil {
|
if _, err := os.Stat(insertionFilter); err == nil {
|
||||||
b, err := ioutil.ReadFile(insertionFilter)
|
b, err := os.ReadFile(insertionFilter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Log.Warningf(uiUtils.Warning, fmt.Sprintf("Couldn't read the file on path: %s, err: %v", insertionFilter, err))
|
logger.Log.Warningf(uiUtils.Warning, fmt.Sprintf("Couldn't read the file on path: %s, err: %v", insertionFilter, err))
|
||||||
} else {
|
} else {
|
||||||
|
@ -3,7 +3,7 @@ package version
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
@ -47,7 +47,7 @@ func CheckNewerVersion(versionChan chan string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
data, err := ioutil.ReadAll(res.Body)
|
data, err := io.ReadAll(res.Body)
|
||||||
res.Body.Close()
|
res.Body.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Log.Debugf("[ERROR] Failed to read the version file -> %v", err)
|
logger.Log.Debugf("[ERROR] Failed to read the version file -> %v", err)
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@ -32,7 +31,7 @@ func checkError(response *http.Response, errInOperation error) (*http.Response,
|
|||||||
return response, errInOperation
|
return response, errInOperation
|
||||||
// Check only if status != 200 (and not status >= 300). Agent APIs return only 200 on success.
|
// Check only if status != 200 (and not status >= 300). Agent APIs return only 200 on success.
|
||||||
} else if response.StatusCode != http.StatusOK {
|
} else if response.StatusCode != http.StatusOK {
|
||||||
body, err := ioutil.ReadAll(response.Body)
|
body, err := io.ReadAll(response.Body)
|
||||||
response.Body.Close()
|
response.Body.Close()
|
||||||
response.Body = io.NopCloser(bytes.NewBuffer(body)) // rewind
|
response.Body = io.NopCloser(bytes.NewBuffer(body)) // rewind
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -6,7 +6,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
@ -192,7 +191,7 @@ func TestDissect(t *testing.T) {
|
|||||||
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
||||||
assert.Len(t, items, 0)
|
assert.Len(t, items, 0)
|
||||||
} else {
|
} else {
|
||||||
expectedBytes, err := ioutil.ReadFile(pathExpect)
|
expectedBytes, err := os.ReadFile(pathExpect)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
||||||
@ -222,7 +221,7 @@ func TestAnalyze(t *testing.T) {
|
|||||||
for _, _path := range paths {
|
for _, _path := range paths {
|
||||||
fmt.Printf("%s %s\n", msgAnalyzing, _path)
|
fmt.Printf("%s %s\n", msgAnalyzing, _path)
|
||||||
|
|
||||||
bytes, err := ioutil.ReadFile(_path)
|
bytes, err := os.ReadFile(_path)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
var items []*api.OutputChannelItem
|
var items []*api.OutputChannelItem
|
||||||
@ -249,7 +248,7 @@ func TestAnalyze(t *testing.T) {
|
|||||||
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
||||||
assert.Len(t, items, 0)
|
assert.Len(t, items, 0)
|
||||||
} else {
|
} else {
|
||||||
expectedBytes, err := ioutil.ReadFile(pathExpect)
|
expectedBytes, err := os.ReadFile(pathExpect)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
||||||
@ -279,7 +278,7 @@ func TestSummarize(t *testing.T) {
|
|||||||
for _, _path := range paths {
|
for _, _path := range paths {
|
||||||
fmt.Printf("%s %s\n", msgSummarizing, _path)
|
fmt.Printf("%s %s\n", msgSummarizing, _path)
|
||||||
|
|
||||||
bytes, err := ioutil.ReadFile(_path)
|
bytes, err := os.ReadFile(_path)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
var entries []*api.Entry
|
var entries []*api.Entry
|
||||||
@ -306,7 +305,7 @@ func TestSummarize(t *testing.T) {
|
|||||||
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
||||||
assert.Len(t, entries, 0)
|
assert.Len(t, entries, 0)
|
||||||
} else {
|
} else {
|
||||||
expectedBytes, err := ioutil.ReadFile(pathExpect)
|
expectedBytes, err := os.ReadFile(pathExpect)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
||||||
@ -336,7 +335,7 @@ func TestRepresent(t *testing.T) {
|
|||||||
for _, _path := range paths {
|
for _, _path := range paths {
|
||||||
fmt.Printf("%s %s\n", msgRepresenting, _path)
|
fmt.Printf("%s %s\n", msgRepresenting, _path)
|
||||||
|
|
||||||
bytes, err := ioutil.ReadFile(_path)
|
bytes, err := os.ReadFile(_path)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
var entries []*api.Entry
|
var entries []*api.Entry
|
||||||
@ -364,7 +363,7 @@ func TestRepresent(t *testing.T) {
|
|||||||
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
||||||
assert.Len(t, objects, 0)
|
assert.Len(t, objects, 0)
|
||||||
} else {
|
} else {
|
||||||
expectedBytes, err := ioutil.ReadFile(pathExpect)
|
expectedBytes, err := os.ReadFile(pathExpect)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -124,7 +123,7 @@ func handleHTTP1ClientStream(b *bufio.Reader, progress *api.ReadProgress, captur
|
|||||||
}
|
}
|
||||||
|
|
||||||
var body []byte
|
var body []byte
|
||||||
body, err = ioutil.ReadAll(req.Body)
|
body, err = io.ReadAll(req.Body)
|
||||||
req.Body = io.NopCloser(bytes.NewBuffer(body)) // rewind
|
req.Body = io.NopCloser(bytes.NewBuffer(body)) // rewind
|
||||||
|
|
||||||
ident := fmt.Sprintf(
|
ident := fmt.Sprintf(
|
||||||
@ -168,7 +167,7 @@ func handleHTTP1ServerStream(b *bufio.Reader, progress *api.ReadProgress, captur
|
|||||||
}
|
}
|
||||||
|
|
||||||
var body []byte
|
var body []byte
|
||||||
body, err = ioutil.ReadAll(res.Body)
|
body, err = io.ReadAll(res.Body)
|
||||||
res.Body = io.NopCloser(bytes.NewBuffer(body)) // rewind
|
res.Body = io.NopCloser(bytes.NewBuffer(body)) // rewind
|
||||||
|
|
||||||
ident := fmt.Sprintf(
|
ident := fmt.Sprintf(
|
||||||
|
@ -6,7 +6,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
@ -195,7 +194,7 @@ func TestDissect(t *testing.T) {
|
|||||||
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
||||||
assert.Len(t, items, 0)
|
assert.Len(t, items, 0)
|
||||||
} else {
|
} else {
|
||||||
expectedBytes, err := ioutil.ReadFile(pathExpect)
|
expectedBytes, err := os.ReadFile(pathExpect)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
||||||
@ -225,7 +224,7 @@ func TestAnalyze(t *testing.T) {
|
|||||||
for _, _path := range paths {
|
for _, _path := range paths {
|
||||||
fmt.Printf("%s %s\n", msgAnalyzing, _path)
|
fmt.Printf("%s %s\n", msgAnalyzing, _path)
|
||||||
|
|
||||||
bytes, err := ioutil.ReadFile(_path)
|
bytes, err := os.ReadFile(_path)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
var items []*api.OutputChannelItem
|
var items []*api.OutputChannelItem
|
||||||
@ -252,7 +251,7 @@ func TestAnalyze(t *testing.T) {
|
|||||||
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
||||||
assert.Len(t, items, 0)
|
assert.Len(t, items, 0)
|
||||||
} else {
|
} else {
|
||||||
expectedBytes, err := ioutil.ReadFile(pathExpect)
|
expectedBytes, err := os.ReadFile(pathExpect)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
||||||
@ -282,7 +281,7 @@ func TestSummarize(t *testing.T) {
|
|||||||
for _, _path := range paths {
|
for _, _path := range paths {
|
||||||
fmt.Printf("%s %s\n", msgSummarizing, _path)
|
fmt.Printf("%s %s\n", msgSummarizing, _path)
|
||||||
|
|
||||||
bytes, err := ioutil.ReadFile(_path)
|
bytes, err := os.ReadFile(_path)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
var entries []*api.Entry
|
var entries []*api.Entry
|
||||||
@ -309,7 +308,7 @@ func TestSummarize(t *testing.T) {
|
|||||||
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
||||||
assert.Len(t, entries, 0)
|
assert.Len(t, entries, 0)
|
||||||
} else {
|
} else {
|
||||||
expectedBytes, err := ioutil.ReadFile(pathExpect)
|
expectedBytes, err := os.ReadFile(pathExpect)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
||||||
@ -339,7 +338,7 @@ func TestRepresent(t *testing.T) {
|
|||||||
for _, _path := range paths {
|
for _, _path := range paths {
|
||||||
fmt.Printf("%s %s\n", msgRepresenting, _path)
|
fmt.Printf("%s %s\n", msgRepresenting, _path)
|
||||||
|
|
||||||
bytes, err := ioutil.ReadFile(_path)
|
bytes, err := os.ReadFile(_path)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
var entries []*api.Entry
|
var entries []*api.Entry
|
||||||
@ -367,7 +366,7 @@ func TestRepresent(t *testing.T) {
|
|||||||
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
||||||
assert.Len(t, objects, 0)
|
assert.Len(t, objects, 0)
|
||||||
} else {
|
} else {
|
||||||
expectedBytes, err := ioutil.ReadFile(pathExpect)
|
expectedBytes, err := os.ReadFile(pathExpect)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"hash/crc32"
|
"hash/crc32"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@ -166,7 +165,7 @@ func (d *decoder) discard(n int) {
|
|||||||
n, err = r.Discard(n)
|
n, err = r.Discard(n)
|
||||||
d.remain -= n
|
d.remain -= n
|
||||||
} else {
|
} else {
|
||||||
_, err = io.Copy(ioutil.Discard, d)
|
_, err = io.Copy(io.Discard, d)
|
||||||
}
|
}
|
||||||
d.setError(err)
|
d.setError(err)
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
@ -193,7 +192,7 @@ func TestDissect(t *testing.T) {
|
|||||||
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
||||||
assert.Len(t, items, 0)
|
assert.Len(t, items, 0)
|
||||||
} else {
|
} else {
|
||||||
expectedBytes, err := ioutil.ReadFile(pathExpect)
|
expectedBytes, err := os.ReadFile(pathExpect)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
||||||
@ -223,7 +222,7 @@ func TestAnalyze(t *testing.T) {
|
|||||||
for _, _path := range paths {
|
for _, _path := range paths {
|
||||||
fmt.Printf("%s %s\n", msgAnalyzing, _path)
|
fmt.Printf("%s %s\n", msgAnalyzing, _path)
|
||||||
|
|
||||||
bytes, err := ioutil.ReadFile(_path)
|
bytes, err := os.ReadFile(_path)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
var items []*api.OutputChannelItem
|
var items []*api.OutputChannelItem
|
||||||
@ -250,7 +249,7 @@ func TestAnalyze(t *testing.T) {
|
|||||||
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
||||||
assert.Len(t, items, 0)
|
assert.Len(t, items, 0)
|
||||||
} else {
|
} else {
|
||||||
expectedBytes, err := ioutil.ReadFile(pathExpect)
|
expectedBytes, err := os.ReadFile(pathExpect)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
||||||
@ -280,7 +279,7 @@ func TestSummarize(t *testing.T) {
|
|||||||
for _, _path := range paths {
|
for _, _path := range paths {
|
||||||
fmt.Printf("%s %s\n", msgSummarizing, _path)
|
fmt.Printf("%s %s\n", msgSummarizing, _path)
|
||||||
|
|
||||||
bytes, err := ioutil.ReadFile(_path)
|
bytes, err := os.ReadFile(_path)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
var entries []*api.Entry
|
var entries []*api.Entry
|
||||||
@ -307,7 +306,7 @@ func TestSummarize(t *testing.T) {
|
|||||||
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
||||||
assert.Len(t, entries, 0)
|
assert.Len(t, entries, 0)
|
||||||
} else {
|
} else {
|
||||||
expectedBytes, err := ioutil.ReadFile(pathExpect)
|
expectedBytes, err := os.ReadFile(pathExpect)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
||||||
@ -337,7 +336,7 @@ func TestRepresent(t *testing.T) {
|
|||||||
for _, _path := range paths {
|
for _, _path := range paths {
|
||||||
fmt.Printf("%s %s\n", msgRepresenting, _path)
|
fmt.Printf("%s %s\n", msgRepresenting, _path)
|
||||||
|
|
||||||
bytes, err := ioutil.ReadFile(_path)
|
bytes, err := os.ReadFile(_path)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
var entries []*api.Entry
|
var entries []*api.Entry
|
||||||
@ -365,7 +364,7 @@ func TestRepresent(t *testing.T) {
|
|||||||
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
||||||
assert.Len(t, objects, 0)
|
assert.Len(t, objects, 0)
|
||||||
} else {
|
} else {
|
||||||
expectedBytes, err := ioutil.ReadFile(pathExpect)
|
expectedBytes, err := os.ReadFile(pathExpect)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
||||||
|
@ -6,7 +6,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
@ -193,7 +192,7 @@ func TestDissect(t *testing.T) {
|
|||||||
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
||||||
assert.Len(t, items, 0)
|
assert.Len(t, items, 0)
|
||||||
} else {
|
} else {
|
||||||
expectedBytes, err := ioutil.ReadFile(pathExpect)
|
expectedBytes, err := os.ReadFile(pathExpect)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
||||||
@ -223,7 +222,7 @@ func TestAnalyze(t *testing.T) {
|
|||||||
for _, _path := range paths {
|
for _, _path := range paths {
|
||||||
fmt.Printf("%s %s\n", msgAnalyzing, _path)
|
fmt.Printf("%s %s\n", msgAnalyzing, _path)
|
||||||
|
|
||||||
bytes, err := ioutil.ReadFile(_path)
|
bytes, err := os.ReadFile(_path)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
var items []*api.OutputChannelItem
|
var items []*api.OutputChannelItem
|
||||||
@ -250,7 +249,7 @@ func TestAnalyze(t *testing.T) {
|
|||||||
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
||||||
assert.Len(t, items, 0)
|
assert.Len(t, items, 0)
|
||||||
} else {
|
} else {
|
||||||
expectedBytes, err := ioutil.ReadFile(pathExpect)
|
expectedBytes, err := os.ReadFile(pathExpect)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
||||||
@ -280,7 +279,7 @@ func TestSummarize(t *testing.T) {
|
|||||||
for _, _path := range paths {
|
for _, _path := range paths {
|
||||||
fmt.Printf("%s %s\n", msgSummarizing, _path)
|
fmt.Printf("%s %s\n", msgSummarizing, _path)
|
||||||
|
|
||||||
bytes, err := ioutil.ReadFile(_path)
|
bytes, err := os.ReadFile(_path)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
var entries []*api.Entry
|
var entries []*api.Entry
|
||||||
@ -307,7 +306,7 @@ func TestSummarize(t *testing.T) {
|
|||||||
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
||||||
assert.Len(t, entries, 0)
|
assert.Len(t, entries, 0)
|
||||||
} else {
|
} else {
|
||||||
expectedBytes, err := ioutil.ReadFile(pathExpect)
|
expectedBytes, err := os.ReadFile(pathExpect)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
||||||
@ -337,7 +336,7 @@ func TestRepresent(t *testing.T) {
|
|||||||
for _, _path := range paths {
|
for _, _path := range paths {
|
||||||
fmt.Printf("%s %s\n", msgRepresenting, _path)
|
fmt.Printf("%s %s\n", msgRepresenting, _path)
|
||||||
|
|
||||||
bytes, err := ioutil.ReadFile(_path)
|
bytes, err := os.ReadFile(_path)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
var entries []*api.Entry
|
var entries []*api.Entry
|
||||||
@ -365,7 +364,7 @@ func TestRepresent(t *testing.T) {
|
|||||||
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(pathExpect); errors.Is(err, os.ErrNotExist) {
|
||||||
assert.Len(t, objects, 0)
|
assert.Len(t, objects, 0)
|
||||||
} else {
|
} else {
|
||||||
expectedBytes, err := ioutil.ReadFile(pathExpect)
|
expectedBytes, err := os.ReadFile(pathExpect)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
||||||
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
assert.JSONEq(t, string(expectedBytes), string(marshaled))
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package source
|
package source
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ import (
|
|||||||
var numberRegex = regexp.MustCompile("[0-9]+")
|
var numberRegex = regexp.MustCompile("[0-9]+")
|
||||||
|
|
||||||
func getSingleValueFromEnvironmentVariableFile(filePath string, variableName string) (string, error) {
|
func getSingleValueFromEnvironmentVariableFile(filePath string, variableName string) (string, error) {
|
||||||
bytes, err := ioutil.ReadFile(filePath)
|
bytes, err := os.ReadFile(filePath)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Log.Warningf("Error reading environment file %v - %v", filePath, err)
|
logger.Log.Warningf("Error reading environment file %v - %v", filePath, err)
|
||||||
|
@ -2,7 +2,6 @@ package source
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -15,7 +14,7 @@ const envoyBinary = "/envoy"
|
|||||||
func discoverRelevantEnvoyPids(procfs string, pods []v1.Pod) ([]string, error) {
|
func discoverRelevantEnvoyPids(procfs string, pods []v1.Pod) ([]string, error) {
|
||||||
result := make([]string, 0)
|
result := make([]string, 0)
|
||||||
|
|
||||||
pids, err := ioutil.ReadDir(procfs)
|
pids, err := os.ReadDir(procfs)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
|
@ -2,7 +2,6 @@ package source
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -15,7 +14,7 @@ const linkerdBinary = "/linkerd2-proxy"
|
|||||||
func discoverRelevantLinkerdPids(procfs string, pods []v1.Pod) ([]string, error) {
|
func discoverRelevantLinkerdPids(procfs string, pods []v1.Pod) ([]string, error) {
|
||||||
result := make([]string, 0)
|
result := make([]string, 0)
|
||||||
|
|
||||||
pids, err := ioutil.ReadDir(procfs)
|
pids, err := os.ReadDir(procfs)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
|
@ -2,8 +2,8 @@ package tlstapper
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
@ -43,7 +43,7 @@ func UpdateTapTargets(tls *TlsTapper, pods *[]v1.Pod, procfs string) error {
|
|||||||
func findContainerPids(procfs string, containerIds map[string]v1.Pod) (map[uint32]v1.Pod, error) {
|
func findContainerPids(procfs string, containerIds map[string]v1.Pod) (map[uint32]v1.Pod, error) {
|
||||||
result := make(map[uint32]v1.Pod)
|
result := make(map[uint32]v1.Pod)
|
||||||
|
|
||||||
pids, err := ioutil.ReadDir(procfs)
|
pids, err := os.ReadDir(procfs)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@ -107,7 +107,7 @@ func buildContainerIdsMap(pods *[]v1.Pod) map[string]v1.Pod {
|
|||||||
func getProcessCgroup(procfs string, pid string) (string, error) {
|
func getProcessCgroup(procfs string, pid string) (string, error) {
|
||||||
filePath := fmt.Sprintf("%s/%s/cgroup", procfs, pid)
|
filePath := fmt.Sprintf("%s/%s/cgroup", procfs, pid)
|
||||||
|
|
||||||
bytes, err := ioutil.ReadFile(filePath)
|
bytes, err := os.ReadFile(filePath)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Log.Warningf("Error reading cgroup file %s - %v", filePath, err)
|
logger.Log.Warningf("Error reading cgroup file %s - %v", filePath, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user