Skip to content

Commit

Permalink
move manifests pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
shireenf-ibm committed Nov 12, 2023
1 parent 406469a commit 1f492e5
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 20 deletions.
4 changes: 2 additions & 2 deletions cmd/netpolicy/cmd/evaluate.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
utilerrors "k8s.io/apimachinery/pkg/util/errors"

"github.com/np-guard/netpol-analyzer/pkg/logger"
"github.com/np-guard/netpol-analyzer/pkg/manifests/fsscanner"
"github.com/np-guard/netpol-analyzer/pkg/manifests/parser"
"github.com/np-guard/netpol-analyzer/pkg/netpol/eval"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/fsscanner"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/parser"
)

// TODO: consider using k8s.io/cli-runtime/pkg/genericclioptions to load kube config.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions pkg/netpol/connlist/connlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"k8s.io/cli-runtime/pkg/resource"

"github.com/np-guard/netpol-analyzer/pkg/logger"
"github.com/np-guard/netpol-analyzer/pkg/manifests/fsscanner"
"github.com/np-guard/netpol-analyzer/pkg/manifests/parser"
"github.com/np-guard/netpol-analyzer/pkg/netpol/common"
"github.com/np-guard/netpol-analyzer/pkg/netpol/connlist/internal/ingressanalyzer"
"github.com/np-guard/netpol-analyzer/pkg/netpol/eval"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/fsscanner"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/parser"

utilerrors "k8s.io/apimachinery/pkg/util/errors"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/netpol/connlist/connlist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strings"
"testing"

"github.com/np-guard/netpol-analyzer/pkg/manifests/fsscanner"
"github.com/np-guard/netpol-analyzer/pkg/netpol/common"
"github.com/np-guard/netpol-analyzer/pkg/netpol/internal/testutils"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/fsscanner"

"github.com/stretchr/testify/require"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"k8s.io/apimachinery/pkg/util/intstr"

"github.com/np-guard/netpol-analyzer/pkg/logger"
"github.com/np-guard/netpol-analyzer/pkg/manifests/parser"
"github.com/np-guard/netpol-analyzer/pkg/netpol/common"
"github.com/np-guard/netpol-analyzer/pkg/netpol/eval"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/parser"
)

type serviceInfo struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"k8s.io/apimachinery/pkg/types"

"github.com/np-guard/netpol-analyzer/pkg/logger"
"github.com/np-guard/netpol-analyzer/pkg/manifests/fsscanner"
"github.com/np-guard/netpol-analyzer/pkg/manifests/parser"
"github.com/np-guard/netpol-analyzer/pkg/netpol/eval"
"github.com/np-guard/netpol-analyzer/pkg/netpol/internal/testutils"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/fsscanner"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/parser"
)

// helping func - scans the directory objects and returns the ingress analyzer built from them
Expand Down
4 changes: 2 additions & 2 deletions pkg/netpol/connlist/internal/ingressanalyzer/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"github.com/stretchr/testify/require"

"github.com/np-guard/netpol-analyzer/pkg/logger"
"github.com/np-guard/netpol-analyzer/pkg/manifests/fsscanner"
"github.com/np-guard/netpol-analyzer/pkg/manifests/parser"
"github.com/np-guard/netpol-analyzer/pkg/netpol/eval"
"github.com/np-guard/netpol-analyzer/pkg/netpol/internal/testutils"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/fsscanner"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/parser"
)

const servicesDirName = "services"
Expand Down
4 changes: 2 additions & 2 deletions pkg/netpol/diff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (
"k8s.io/cli-runtime/pkg/resource"

"github.com/np-guard/netpol-analyzer/pkg/logger"
"github.com/np-guard/netpol-analyzer/pkg/manifests/fsscanner"
"github.com/np-guard/netpol-analyzer/pkg/manifests/parser"
"github.com/np-guard/netpol-analyzer/pkg/netpol/common"
"github.com/np-guard/netpol-analyzer/pkg/netpol/connlist"
"github.com/np-guard/netpol-analyzer/pkg/netpol/eval"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/fsscanner"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/parser"

utilerrors "k8s.io/apimachinery/pkg/util/errors"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/netpol/diff/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

"github.com/stretchr/testify/require"

"github.com/np-guard/netpol-analyzer/pkg/manifests/fsscanner"
"github.com/np-guard/netpol-analyzer/pkg/netpol/common"
"github.com/np-guard/netpol-analyzer/pkg/netpol/internal/testutils"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/fsscanner"
)

const expectedOutputFilePrefix = "diff_output_from_"
Expand Down
4 changes: 2 additions & 2 deletions pkg/netpol/eval/eval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"sigs.k8s.io/yaml"

"github.com/np-guard/netpol-analyzer/pkg/logger"
"github.com/np-guard/netpol-analyzer/pkg/manifests/fsscanner"
"github.com/np-guard/netpol-analyzer/pkg/manifests/parser"
"github.com/np-guard/netpol-analyzer/pkg/netpol/common"
"github.com/np-guard/netpol-analyzer/pkg/netpol/internal/testutils"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/fsscanner"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/parser"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/netpol/eval/internal/k8s/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

"github.com/np-guard/netpol-analyzer/pkg/manifests/parser"
"github.com/np-guard/netpol-analyzer/pkg/netpol/common"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/parser"
)

const defaultPortsListSize = 8
Expand Down
2 changes: 1 addition & 1 deletion pkg/netpol/eval/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"

"github.com/np-guard/netpol-analyzer/pkg/manifests/parser"
"github.com/np-guard/netpol-analyzer/pkg/netpol/common"
"github.com/np-guard/netpol-analyzer/pkg/netpol/eval/internal/k8s"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/parser"
)

type (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fsscanner
package netpol

import (
"fmt"
Expand All @@ -8,13 +8,14 @@ import (
"github.com/stretchr/testify/require"

"github.com/np-guard/netpol-analyzer/pkg/logger"
"github.com/np-guard/netpol-analyzer/pkg/manifests/fsscanner"
"github.com/np-guard/netpol-analyzer/pkg/manifests/parser"
"github.com/np-guard/netpol-analyzer/pkg/netpol/internal/testutils"
"github.com/np-guard/netpol-analyzer/pkg/netpol/manifests/parser"
)

func TestBasic(t *testing.T) {
dirPath := filepath.Join(testutils.GetTestsDirWithDepth(4), "basic")
rList, errs := GetResourceInfosFromDirPath([]string{dirPath}, true, false)
rList, errs := fsscanner.GetResourceInfosFromDirPath([]string{dirPath}, true, false)
require.Empty(t, errs, "expecting no errors on basic dir")

// TODO: move the code below to parser pkg
Expand Down

0 comments on commit 1f492e5

Please sign in to comment.