Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions checks/.manifest

This file was deleted.

4 changes: 0 additions & 4 deletions cmd/bundle/bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

rm -rf bundle || true
rm bundle.tar.gz || true
RELEASE_VERSION=${GITHUB_REF/refs\/tags\/v/}

for dir in kubernetes cloud docker; do
mkdir -p bundle/policies/$dir/policies
Expand Down Expand Up @@ -30,8 +29,5 @@ done
mkdir -p bundle/specs/compliance
rsync -avr pkg/specs/compliance bundle/specs

cp checks/.manifest bundle/
rm bundle/policies/.manifest
sed -i -e "s/\[GITHUB_SHA\]/${RELEASE_VERSION}/" bundle/.manifest
tar -C bundle -czvf bundle.tar.gz .
rm -rf bundle
27 changes: 1 addition & 26 deletions test/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"archive/tar"
"bytes"
"compress/gzip"
"encoding/json"
"errors"
"io"
"os"
Expand All @@ -18,12 +17,7 @@ import (
"github.com/stretchr/testify/require"
)

type manifest struct {
Revision string `json:"revision"`
Roots []string `json:"roots"`
}

func Test_ManifestValidity(t *testing.T) {
func Test_BundleValidity(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("Skipping on windows as it doesn't build a bundle on Windows anyway")
}
Expand All @@ -35,16 +29,6 @@ func Test_ManifestValidity(t *testing.T) {
_ = os.Remove("../bundle.tar.gz")
}()

f, err := os.Open("../checks/.manifest")
require.NoError(t, err)

var m manifest
require.NoError(t, json.NewDecoder(f).Decode(&m))

require.Equal(t, "[GITHUB_SHA]", m.Revision)
require.Len(t, m.Roots, 1)
require.Equal(t, "", m.Roots[0])

cmd := exec.Command("cmd/bundle/bundle.sh")
cmd.Env = append(os.Environ(), "GITHUB_REF=refs/tags/v1.2.3")
cmd.Dir = ".."
Expand Down Expand Up @@ -82,15 +66,6 @@ func Test_ManifestValidity(t *testing.T) {
}
}

mf, err := fsys.Open(".manifest")
require.NoError(t, err)

var m2 manifest
require.NoError(t, json.NewDecoder(mf).Decode(&m2))
assert.Equal(t, "1.2.3", m2.Revision)
assert.Len(t, m2.Roots, 1)
assert.Equal(t, "", m2.Roots[0])

policies, err := fsys.ReadDir("policies")
require.NoError(t, err)

Expand Down
Loading