Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Amir Malka <amirm@armosec.io>
  • Loading branch information
amirmalka committed Aug 23, 2023
1 parent d5be0bf commit ca176fe
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
6 changes: 3 additions & 3 deletions adapters/v1/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ type BackendAdapter struct {

var _ ports.Platform = (*BackendAdapter)(nil)

func NewBackendAdapter(accountID, gatewayRestURL, eventReceiverRestURL string) *BackendAdapter {
func NewBackendAdapter(accountID, apiServerRestURL, eventReceiverRestURL string) *BackendAdapter {
return &BackendAdapter{
clusterConfig: pkgcautils.ClusterConfig{
AccountID: accountID,
EventReceiverRestURL: eventReceiverRestURL,
GatewayRestURL: gatewayRestURL, // why ???
ApiServerRestURL: apiServerRestURL,
},
getCVEExceptionsFunc: backendClientV1.GetCVEExceptionByDesignator,
httpPostFunc: httputils.HttpPost,
Expand Down Expand Up @@ -86,7 +86,7 @@ func (a *BackendAdapter) GetCVEExceptions(ctx context.Context) (domain.CVEExcept
},
}

vulnExceptionList, err := a.getCVEExceptionsFunc(a.clusterConfig.GatewayRestURL, a.clusterConfig.AccountID, &designator)
vulnExceptionList, err := a.getCVEExceptionsFunc(a.clusterConfig.ApiServerRestURL, a.clusterConfig.AccountID, &designator)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions adapters/v1/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func TestBackendAdapter_SubmitCVE(t *testing.T) {
func TestNewBackendAdapter(t *testing.T) {
type args struct {
accountID string
gatewayRestURL string
apiServerRestURL string
eventReceiverRestURL string
}
tests := []struct {
Expand All @@ -214,7 +214,7 @@ func TestNewBackendAdapter(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := NewBackendAdapter(tt.args.accountID, tt.args.gatewayRestURL, tt.args.eventReceiverRestURL)
got := NewBackendAdapter(tt.args.accountID, tt.args.apiServerRestURL, tt.args.eventReceiverRestURL)
// need to nil functions to compare
got.httpPostFunc = nil
got.getCVEExceptionsFunc = nil
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/armosec/armoapi-go v0.0.220
github.com/armosec/logger-go v0.0.14
github.com/armosec/utils-go v0.0.20
github.com/armosec/utils-k8s-go v0.0.16
github.com/armosec/utils-k8s-go v0.0.17
github.com/distribution/distribution v2.8.2+incompatible
github.com/docker/docker v24.0.5+incompatible
github.com/eapache/go-resiliency v1.3.0
Expand Down
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ github.com/armosec/logger-go v0.0.14 h1:5YpXMlYt/7zIAcmJP4q1BmWNH/7bpkSndfZTyysr
github.com/armosec/logger-go v0.0.14/go.mod h1:OKV/cBcEjNv/T62vd1cnD2lf07POPSpy3PQkURfoCeI=
github.com/armosec/utils-go v0.0.20 h1:bvr+TMumEYdMsGFGSsaQysST7K02nNROFvuajNuKPlw=
github.com/armosec/utils-go v0.0.20/go.mod h1:ZEFiSv8KpTFNT19jHis1IengiF/BGDvg7tHmXo+cwxs=
github.com/armosec/utils-k8s-go v0.0.16 h1:h46PoxAb4OHA2p719PzcAS03lADw4lH4TyRMaZ3ix/g=
github.com/armosec/utils-k8s-go v0.0.16/go.mod h1:QX0QAGlH7KCZq810eO9QjTYqkhjw8cvrr96TZfaUGrk=
github.com/armosec/utils-k8s-go v0.0.17 h1:HUntJGR0/PHt7bp8S0zLhVcJ6sDz061Hc9mAM9ha1lA=
github.com/armosec/utils-k8s-go v0.0.17/go.mod h1:FJRG/MRz7jT4ExSEYHIFsilVsAF11M+GJRhLl4PFZ4s=
github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
github.com/aws/aws-sdk-go v1.44.312 h1:llrElfzeqG/YOLFFKjg1xNpZCFJ2xraIi3PqSuP+95k=
github.com/aws/aws-sdk-go v1.44.312/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
Expand Down Expand Up @@ -764,10 +764,6 @@ github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubescape/backend v0.0.0-20230822211641-7f8d6f1f87d7 h1:Gy3Lpg3sZzKRp3F/LHKdta1375f6hzPZNKyn6tgRKgc=
github.com/kubescape/backend v0.0.0-20230822211641-7f8d6f1f87d7/go.mod h1:V3ohHdCYWZmaPLNACQv+j7uVDm2jRDCjLsUk7FBfXbU=
github.com/kubescape/backend v0.0.0-20230823062307-65504659f91e h1:R9F67Ohiu986xbfYmJbfiwREZkwkYk5JoMlGgOzBQGk=
github.com/kubescape/backend v0.0.0-20230823062307-65504659f91e/go.mod h1:V3ohHdCYWZmaPLNACQv+j7uVDm2jRDCjLsUk7FBfXbU=
github.com/kubescape/backend v0.0.0-20230823064127-e914c64f4aba h1:SMrex81D7x42fMYVdRNqXK4SzJggdozHv/GC1fMOO+E=
github.com/kubescape/backend v0.0.0-20230823064127-e914c64f4aba/go.mod h1:V3ohHdCYWZmaPLNACQv+j7uVDm2jRDCjLsUk7FBfXbU=
github.com/kubescape/go-logger v0.0.14-0.20230730134225-e59751254525 h1:9wzR38LebiA58cGxRBnsF78k4eJGnk7UetoTPKkyz2A=
Expand Down

0 comments on commit ca176fe

Please sign in to comment.