Skip to content

Commit

Permalink
Merge pull request #49 from testwill/ioutil
Browse files Browse the repository at this point in the history
chore: remove refs to deprecated io/ioutil
  • Loading branch information
matthyx authored Aug 11, 2024
2 parents 6e97c07 + 4b0cef9 commit ea35349
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions e2e/cloudproviderinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package e2e_test

import (
"encoding/json"
"io/ioutil"
"io"
"net/http"

"github.com/kubescape/host-scanner/sensor"
Expand Down Expand Up @@ -30,7 +30,7 @@ var _ = Describe("Cloudproviderinfo", func() {
It("should return the expected value of CloudProviderInfo", func() {
resultBody := &sensor.CloudProviderInfo{}

resBody, err = ioutil.ReadAll(res.Body)
resBody, err = io.ReadAll(res.Body)
Expect(err).ToNot(HaveOccurred())

err = json.Unmarshal(resBody, resultBody)
Expand Down
4 changes: 2 additions & 2 deletions e2e/cniinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package e2e_test

import (
"encoding/json"
"io/ioutil"
"io"
"net/http"

"github.com/kubescape/host-scanner/sensor"
Expand All @@ -29,7 +29,7 @@ var _ = Describe("CniInfo", func() {
It("should return the expected value of CNIInfo", func() {
resultBody := &sensor.CNIInfo{}

resBody, err = ioutil.ReadAll(res.Body)
resBody, err = io.ReadAll(res.Body)
Expect(err).ToNot(HaveOccurred())

err = json.Unmarshal(resBody, resultBody)
Expand Down
4 changes: 2 additions & 2 deletions e2e/controlplaneinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package e2e_test

import (
"encoding/json"
"io/ioutil"
"io"
"net/http"

. "github.com/onsi/ginkgo"
Expand Down Expand Up @@ -33,7 +33,7 @@ var _ = Describe("ControlPlaneInfo", func() {
It("should return the expected value of PKIDir and PKIFiles", func() {
resultBody := &sensor.ControlPlaneInfo{}

resBody, err = ioutil.ReadAll(res.Body)
resBody, err = io.ReadAll(res.Body)
Expect(err).ToNot(HaveOccurred())

err = json.Unmarshal(resBody, resultBody)
Expand Down
4 changes: 2 additions & 2 deletions e2e/kubeletinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package e2e_test

import (
"encoding/json"
"io/ioutil"
"io"
"net/http"

"github.com/kubescape/host-scanner/sensor"
Expand All @@ -29,7 +29,7 @@ var _ = Describe("Kubeletinfo", func() {
It("should return the expected value of KubeletInfo", func() {
resultBody := &sensor.KubeletInfo{}

resBody, err = ioutil.ReadAll(res.Body)
resBody, err = io.ReadAll(res.Body)
Expect(err).ToNot(HaveOccurred())

err = json.Unmarshal(resBody, resultBody)
Expand Down
4 changes: 2 additions & 2 deletions e2e/kubeproxyinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package e2e_test

import (
"encoding/json"
"io/ioutil"
"io"
"net/http"

sensor "github.com/kubescape/host-scanner/sensor"
Expand All @@ -29,7 +29,7 @@ var _ = Describe("KubeProxyInfo", func() {
It("should return the expected value of KubeProxyInfo", func() {
resultBody := &sensor.KubeProxyInfo{}

resBody, err = ioutil.ReadAll(res.Body)
resBody, err = io.ReadAll(res.Body)
Expect(err).ToNot(HaveOccurred())

err = json.Unmarshal(resBody, resultBody)
Expand Down
4 changes: 2 additions & 2 deletions e2e/linuxsecurityhardening_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package e2e_test

import (
"encoding/json"
"io/ioutil"
"io"
"net/http"

ds "github.com/kubescape/host-scanner/sensor/datastructures"
Expand All @@ -31,7 +31,7 @@ var _ = Describe("LinuxSecurityHardening", func() {
It("should return the expected value of LinuxSecurityHardeningStatus", func() {
resultBody := &ds.LinuxSecurityHardeningStatus{}

resBody, err = ioutil.ReadAll(res.Body)
resBody, err = io.ReadAll(res.Body)
Expect(err).ToNot(HaveOccurred())

err = json.Unmarshal(resBody, resultBody)
Expand Down
4 changes: 2 additions & 2 deletions e2e/openedports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package e2e_test

import (
"encoding/json"
"io/ioutil"
"io"
"net/http"

"github.com/kubescape/host-scanner/sensor"
Expand Down Expand Up @@ -41,7 +41,7 @@ var _ = Describe("Openedports", func() {
}
jsonOpenedPortsInfo := &sensor.OpenPortsStatus{}

resBody, err = ioutil.ReadAll(res.Body)
resBody, err = io.ReadAll(res.Body)
Expect(err).ToNot(HaveOccurred())

err = json.Unmarshal(resBody, jsonOpenedPortsInfo)
Expand Down
4 changes: 2 additions & 2 deletions e2e/osrelease_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package e2e_test

import (
"io/ioutil"
"io"
"net/http"

. "github.com/onsi/ginkgo"
Expand All @@ -29,7 +29,7 @@ var _ = Describe("OsRelease", func() {
Expect(res.StatusCode).To(BeEquivalentTo(200))
})
It("should return the expected value", func() {
resBody, err = ioutil.ReadAll(res.Body)
resBody, err = io.ReadAll(res.Body)
Ω(string(resBody)).Should(ContainSubstring(expectedResult))
})
})
Expand Down
4 changes: 2 additions & 2 deletions e2e/version_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package e2e_test

import (
"io/ioutil"
"io"
"net/http"

. "github.com/onsi/ginkgo"
Expand All @@ -27,7 +27,7 @@ var _ = Describe("Version", func() {
Expect(res.StatusCode).To(BeEquivalentTo(200))
})
It("should return the expected value", func() {
resBody, err = ioutil.ReadAll(res.Body)
resBody, err = io.ReadAll(res.Body)
Expect(string(resBody)).To(BeEquivalentTo(expectedResult))
})
})
Expand Down

0 comments on commit ea35349

Please sign in to comment.