Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI Test #1

Closed
wants to merge 16 commits into from
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
27 changes: 18 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y libseccomp-dev libelf-dev libapparmor-dev
sudo hack/install-libbpf.sh
run: sudo hack/install-packages
- run: make test-unit
- uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab
with:
Expand Down Expand Up @@ -69,7 +66,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y vagrant virtualbox
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2
- uses: actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85
- uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427
with:
name: image
path: .
Expand Down Expand Up @@ -104,7 +101,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y vagrant virtualbox
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2
- uses: actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85
- uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427
with:
name: image
path: .
Expand Down Expand Up @@ -148,7 +145,7 @@ jobs:
run: |
ln -sf hack/ci/Vagrantfile-flatcar Vagrantfile
vagrant box update
- uses: actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85
- uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427
with:
name: image
path: .
Expand All @@ -166,6 +163,18 @@ jobs:
$RUN "echo \"export E2E_TEST_FLAKY_TESTS_ONLY=true\" >> /vagrant/hack/ci/env-flatcar.sh"
$RUN hack/ci/e2e-flatcar-dev-container.sh

e2e-spoc:
runs-on: ubuntu-22.04
timeout-minutes: 90
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
with:
go-version: ${{ env.GO_VERSION }}
- name: Install dependencies
run: sudo hack/install-packages
- run: make test-spoc-e2e

baseprofiles:
needs: image
runs-on: ubuntu-22.04
Expand All @@ -180,7 +189,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y vagrant virtualbox
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2
- uses: actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85
- uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427
with:
name: image
path: .
Expand All @@ -200,6 +209,6 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2
- uses: crate-ci/typos@v1.18.2
- uses: crate-ci/typos@v1.19.0
with:
config: .typos.toml
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -461,13 +461,17 @@ test-unit: $(BUILD_DIR) ## Run the unit tests
test-e2e: ## Run the end-to-end tests
CGO_LDFLAGS= \
E2E_SKIP_FLAKY_TESTS=true \
$(GO) test -parallel 1 -timeout 60m -count=1 ./test/... -v
$(GO) test -parallel 1 -timeout 60m -count=1 ./test -v

.PHONY: test-flaky-e2e
test-flaky-e2e: ## Only run the flaky end-to-end tests
CGO_LDFLAGS= \
E2E_SKIP_FLAKY_TESTS=false \
$(GO) test -parallel 1 -timeout 20m -count=1 ./test/... -v -testify.m '^(TestSecurityProfilesOperator_Flaky)$$'
$(GO) test -parallel 1 -timeout 20m -count=1 ./test -v -testify.m '^(TestSecurityProfilesOperator_Flaky)$$'

.PHONY: test-spoc-e2e
test-spoc-e2e: build/spoc
$(GO) test -v ./test/spoc

# Generate CRD manifests
manifests: $(BUILD_DIR)/kubernetes-split-yaml $(BUILD_DIR)/kustomize
Expand Down
31 changes: 31 additions & 0 deletions cmd/spoc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

"sigs.k8s.io/security-profiles-operator/cmd"
spocli "sigs.k8s.io/security-profiles-operator/internal/pkg/cli"
"sigs.k8s.io/security-profiles-operator/internal/pkg/cli/merger"
"sigs.k8s.io/security-profiles-operator/internal/pkg/cli/puller"
"sigs.k8s.io/security-profiles-operator/internal/pkg/cli/pusher"
"sigs.k8s.io/security-profiles-operator/internal/pkg/cli/recorder"
Expand Down Expand Up @@ -78,6 +79,22 @@ func main() {
},
},
},
&cli.Command{
Name: "merge",
Aliases: []string{"m"},
Usage: "merge multiple security profiles",
Action: merge,
ArgsUsage: "INFILE...",
Flags: []cli.Flag{
&cli.StringFlag{
Name: merger.FlagOutputFile,
Aliases: []string{"o"},
Usage: "the output file path for the combined profile",
DefaultText: merger.DefaultOutputFile,
TakesFile: true,
},
},
},
&cli.Command{
Name: "run",
Aliases: []string{"x"},
Expand Down Expand Up @@ -192,6 +209,20 @@ func record(ctx *cli.Context) error {
return nil
}

// merge runs the `spoc merge` subcommand.
func merge(ctx *cli.Context) error {
options, err := merger.FromContext(ctx)
if err != nil {
return fmt.Errorf("build options: %w", err)
}

if err := merger.New(options).Run(); err != nil {
return fmt.Errorf("launch merger: %w", err)
}

return nil
}

// run runs the `spoc run` subcommand.
func run(ctx *cli.Context) error {
options, err := runner.FromContext(ctx)
Expand Down
50 changes: 25 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/aquasecurity/libbpfgo v0.6.0-libbpf-1.3
github.com/blang/semver/v4 v4.0.0
github.com/cert-manager/cert-manager v1.14.3
github.com/containers/common v0.57.4
github.com/containers/common v0.58.0
github.com/go-logr/logr v1.4.1
github.com/google/go-cmp v0.6.0
github.com/google/go-containerregistry v0.19.0
Expand All @@ -21,19 +21,19 @@ require (
github.com/opencontainers/runtime-spec v1.2.0
github.com/openshift/api v0.0.0-20221205111557-f2fbb1d1cd5e
github.com/pjbgf/go-apparmor v0.1.2
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.71.2
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.72.0
github.com/prometheus/client_golang v1.19.0
github.com/prometheus/client_model v0.6.0
github.com/seccomp/libseccomp-golang v0.10.0
github.com/sigstore/cosign/v2 v2.2.3
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
github.com/urfave/cli/v2 v2.27.1
golang.org/x/mod v0.15.0
golang.org/x/net v0.21.0
golang.org/x/mod v0.16.0
golang.org/x/net v0.22.0
golang.org/x/sync v0.6.0
google.golang.org/grpc v1.62.0
google.golang.org/grpc v1.62.1
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0
google.golang.org/protobuf v1.32.0
google.golang.org/protobuf v1.33.0
k8s.io/api v0.29.2
k8s.io/apimachinery v0.29.2
k8s.io/cli-runtime v0.29.2
Expand Down Expand Up @@ -113,16 +113,16 @@ require (
github.com/coreos/go-oidc/v3 v3.9.0 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/cyberphone/json-canonicalization v0.0.0-20231011164504-785e29786b46 // indirect
github.com/cyberphone/json-canonicalization v0.0.0-20231217050601-ba74d44ecf5f // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 // indirect
github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/docker/cli v24.0.7+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker v24.0.7+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.0 // indirect
github.com/docker/docker v25.0.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/emicklei/proto v1.12.1 // indirect
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
Expand All @@ -132,17 +132,17 @@ require (
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-chi/chi v4.1.2+incompatible // indirect
github.com/go-ini/ini v1.67.0 // indirect
github.com/go-jose/go-jose/v3 v3.0.1 // indirect
github.com/go-jose/go-jose/v3 v3.0.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.22.0 // indirect
github.com/go-openapi/errors v0.21.0 // indirect
github.com/go-openapi/errors v0.21.1 // indirect
github.com/go-openapi/jsonpointer v0.20.2 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/loads v0.21.5 // indirect
github.com/go-openapi/runtime v0.27.1 // indirect
github.com/go-openapi/spec v0.20.13 // indirect
github.com/go-openapi/strfmt v0.22.0 // indirect
github.com/go-openapi/swag v0.22.9 // indirect
github.com/go-openapi/strfmt v0.22.2 // indirect
github.com/go-openapi/swag v0.22.10 // indirect
github.com/go-openapi/validate v0.22.4 // indirect
github.com/go-piv/piv-go v1.11.0 // indirect
github.com/gobuffalo/flect v1.0.2 // indirect
Expand Down Expand Up @@ -172,7 +172,7 @@ require (
github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.3 // indirect
github.com/klauspost/compress v1.17.7 // indirect
github.com/letsencrypt/boulder v0.0.0-20231026200631-000cd05d5491 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/magiconair/properties v1.8.7 // indirect
Expand Down Expand Up @@ -214,7 +214,7 @@ require (
github.com/shibumi/go-pathspec v1.3.0 // indirect
github.com/sigstore/fulcio v1.4.3 // indirect
github.com/sigstore/rekor v1.3.4 // indirect
github.com/sigstore/sigstore v1.8.1 // indirect
github.com/sigstore/sigstore v1.8.2 // indirect
github.com/sigstore/timestamp-authority v1.2.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
Expand All @@ -240,7 +240,7 @@ require (
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yashtewari/glob-intersection v0.2.0 // indirect
github.com/zeebo/errs v1.3.0 // indirect
go.mongodb.org/mongo-driver v1.13.1 // indirect
go.mongodb.org/mongo-driver v1.14.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect
go.opentelemetry.io/otel v1.22.0 // indirect
Expand All @@ -250,14 +250,14 @@ require (
go.step.sm/crypto v0.42.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/term v0.17.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.17.0 // indirect
golang.org/x/tools v0.18.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/api v0.159.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
Expand All @@ -268,8 +268,8 @@ require (
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.29.0 // indirect
k8s.io/component-base v0.29.0 // indirect
k8s.io/apiextensions-apiserver v0.29.2 // indirect
k8s.io/component-base v0.29.2 // indirect
k8s.io/kube-openapi v0.0.0-20240103051144-eec4567ac022 // indirect
k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect
sigs.k8s.io/gateway-api v1.0.0 // indirect
Expand Down
Loading
Loading