Skip to content

Commit

Permalink
Merge pull request #610 from kubescape/rego-v2
Browse files Browse the repository at this point in the history
add constructor for regolibrary V2
  • Loading branch information
YiscahLevySilas1 authored Mar 25, 2024
2 parents f47888e + d9b9ec3 commit ea310c1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gitregostore/datastructures.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ func (gs *GitRegoStore) SetRegoObjects() error {
return err
}

// NewDefaultGitRegoStore - generates git store object for production regolibrary release files.
// Release files source: "https://github.com/kubescape/regolibrary/releases/latest/download"
func NewGitRegoStoreV2(frequency int) *GitRegoStore {
gs := NewGitRegoStore("https://github.com", "kubescape", "regolibrary", "releases", "download/v2", "", frequency)
return gs
}

// NewDefaultGitRegoStore - generates git store object for production regolibrary release files.
// Release files source: "https://github.com/kubescape/regolibrary/releases/latest/download"
func NewDefaultGitRegoStore(frequency int) *GitRegoStore {
Expand Down
12 changes: 12 additions & 0 deletions gitregostore/gitstoremethods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,18 @@ func gs_tests(t *testing.T, gs *GitRegoStore) {
})
}

func TestGetPoliciesMethodsNewV2(t *testing.T) {
t.Parallel()

gs := NewGitRegoStoreV2(-1)
t.Run("shoud set objects in rego store", func(t *testing.T) {
require.NoError(t, gs.SetRegoObjects())
})

gs_tests(t, gs)

}

func TestGetPoliciesMethodsNew(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit ea310c1

Please sign in to comment.