Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package conftest for openSUSE:Factory checked in at 2023-09-06 18:58:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/conftest (Old) and /work/SRC/openSUSE:Factory/.conftest.new.1766 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "conftest" Wed Sep 6 18:58:11 2023 rev:9 rq:1109106 version:0.45.0 Changes: -------- --- /work/SRC/openSUSE:Factory/conftest/conftest.changes 2023-07-09 20:43:12.166163473 +0200 +++ /work/SRC/openSUSE:Factory/.conftest.new.1766/conftest.changes 2023-09-06 19:02:03.039809182 +0200 @@ -1,0 +2,25 @@ +Tue Sep 05 14:24:06 UTC 2023 - ka...@b1-systems.de + +- Update to version 0.45.0: + * chore: Replace ghodss/yaml with sigs.k8s.io/yaml (#858) + * build(deps): bump github.com/open-policy-agent/opa from 0.55.0 + to 0.56.0 (#860) + * cleanup: Use generics to simplify code for parse_config and + related builtins (#857) + * ci: Bump Go to 1.21.0 (#855) + * build(deps): bump alpine from 3.18.2 to 3.18.3 (#851) + * build(deps): bump golang from 1.20.7-alpine to 1.21.0-alpine + (#850) + * feat: added support for Azure DevOps output (#853) + * build(deps): bump golang from 1.20.6-alpine to 1.20.7-alpine + (#849) + * build(deps): bump github.com/open-policy-agent/opa from 0.54.0 + to 0.55.0 (#848) + * fix: Use Bool instead of BoolP for three flags (#847) + * docs: Fix typo in options docs (#846) + * build(deps): bump golang from 1.20.5-alpine to 1.20.6-alpine + (#845) + * ci: Check GoReleaser config before performing any release + actions (#843) + +------------------------------------------------------------------- Old: ---- conftest-0.44.1.obscpio conftest-0.44.1.tar.gz New: ---- conftest-0.45.0.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ conftest.spec ++++++ --- /var/tmp/diff_new_pack.0ag9Cs/_old 2023-09-06 19:02:04.815872495 +0200 +++ /var/tmp/diff_new_pack.0ag9Cs/_new 2023-09-06 19:02:04.819872637 +0200 @@ -17,7 +17,7 @@ Name: conftest -Version: 0.44.1 +Version: 0.45.0 Release: 0 Summary: Tool to write tests against structured configuration data License: Apache-2.0 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.0ag9Cs/_old 2023-09-06 19:02:04.847873635 +0200 +++ /var/tmp/diff_new_pack.0ag9Cs/_new 2023-09-06 19:02:04.851873778 +0200 @@ -1,19 +1,19 @@ <services> - <service name="obs_scm" mode="disabled"> + <service name="obs_scm" mode="manual"> <param name="url">https://github.com/open-policy-agent/conftest.git</param> <param name="scm">git</param> <param name="versionformat">@PARENT_TAG@</param> <param name="versionrewrite-pattern">v(.*)</param> - <param name="revision">v0.44.1</param> + <param name="revision">v0.45.0</param> <param name="changesgenerate">enable</param> </service> - <service name="set_version" mode="disabled"> + <service name="set_version" mode="manual"> </service> <service name="tar" mode="buildtime"/> <service name="recompress" mode="buildtime"> <param name="file">conftest-*.tar</param> <param name="compression">gz</param> </service> - <service name="go_modules" mode="disabled"/> + <service name="go_modules" mode="manual"/> </services> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.0ag9Cs/_old 2023-09-06 19:02:04.867874348 +0200 +++ /var/tmp/diff_new_pack.0ag9Cs/_new 2023-09-06 19:02:04.871874491 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/open-policy-agent/conftest.git</param> - <param name="changesrevision">ffb3c96d83b2eac43f44c39fb0009054e369ac67</param></service></servicedata> + <param name="changesrevision">97b393eff26b7cfab7c61e8babed09efc5cf863a</param></service></servicedata> (No newline at EOF) ++++++ conftest-0.44.1.obscpio -> conftest-0.45.0.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conftest-0.44.1/.github/workflows/pr.yaml new/conftest-0.45.0/.github/workflows/pr.yaml --- old/conftest-0.44.1/.github/workflows/pr.yaml 2023-07-09 02:37:32.000000000 +0200 +++ new/conftest-0.45.0/.github/workflows/pr.yaml 2023-09-01 17:50:26.000000000 +0200 @@ -37,7 +37,7 @@ - name: setup go uses: actions/setup-go@v2 with: - go-version: "1.20.5" + go-version: "1.21.0" - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conftest-0.44.1/.github/workflows/release.yaml new/conftest-0.45.0/.github/workflows/release.yaml --- old/conftest-0.44.1/.github/workflows/release.yaml 2023-07-09 02:37:32.000000000 +0200 +++ new/conftest-0.45.0/.github/workflows/release.yaml 2023-09-01 17:50:26.000000000 +0200 @@ -14,6 +14,14 @@ with: fetch-depth: 0 + # It is important to check the GoReleaser config before pushing to + # Dockerhub to avoid having mismatches between what is in Dockerhub + # and GitHub releases. + - name: check releaser config + uses: goreleaser/goreleaser-action@v2 + with: + args: check + - name: login to docker hub uses: docker/login-action@v1 with: @@ -35,7 +43,7 @@ - name: setup go uses: actions/setup-go@v2 with: - go-version: "1.20.5" + go-version: "1.21.0" - name: release uses: goreleaser/goreleaser-action@v2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conftest-0.44.1/.golangci.yaml new/conftest-0.45.0/.golangci.yaml --- old/conftest-0.44.1/.golangci.yaml 2023-07-09 02:37:32.000000000 +0200 +++ new/conftest-0.45.0/.golangci.yaml 2023-09-01 17:50:26.000000000 +0200 @@ -5,7 +5,6 @@ linters: disable-all: true enable: - - deadcode - errcheck - goconst - gofmt @@ -20,10 +19,8 @@ - predeclared - revive - staticcheck - - structcheck - typecheck - unconvert - unparam - unused - - varcheck - wastedassign diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conftest-0.44.1/Dockerfile new/conftest-0.45.0/Dockerfile --- old/conftest-0.44.1/Dockerfile 2023-07-09 02:37:32.000000000 +0200 +++ new/conftest-0.45.0/Dockerfile 2023-09-01 17:50:26.000000000 +0200 @@ -1,4 +1,4 @@ -FROM golang:1.20.5-alpine as base +FROM golang:1.21.0-alpine as base ARG TARGETARCH ARG VERSION ARG COMMIT @@ -51,7 +51,7 @@ WORKDIR /examples ## RELEASE ## -FROM alpine:3.18.2 +FROM alpine:3.18.3 # Install git for protocols that depend on it when using conftest pull RUN apk add --no-cache git diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conftest-0.44.1/builtins/parse_config.go new/conftest-0.45.0/builtins/parse_config.go --- old/conftest-0.44.1/builtins/parse_config.go 2023-07-09 02:37:32.000000000 +0200 +++ new/conftest-0.45.0/builtins/parse_config.go 2023-09-01 17:50:26.000000000 +0200 @@ -24,7 +24,7 @@ Name: "parse_config", Decl: types.NewFunction( types.Args(types.S, types.S), // parser name, configuration - types.NewObject(nil, types.NewDynamicProperty(types.S, types.NewAny())), // map[string]interface{} aka JSON + types.NewObject(nil, types.NewDynamicProperty(types.S, types.NewAny())), // map[string]any aka JSON ), } rego.RegisterBuiltin2(&decl, parseConfig) @@ -35,7 +35,7 @@ Name: "parse_config_file", Decl: types.NewFunction( types.Args(types.S), // path to configuration file - types.NewObject(nil, types.NewDynamicProperty(types.S, types.NewAny())), // map[string]interface{} aka JSON + types.NewObject(nil, types.NewDynamicProperty(types.S, types.NewAny())), // map[string]any aka JSON ), } rego.RegisterBuiltin1(&decl, parseConfigFile) @@ -46,7 +46,7 @@ Name: "parse_combined_config_files", Decl: types.NewFunction( types.Args(types.NewArray(nil, types.S)), // paths to configuration files - types.NewObject(nil, types.NewDynamicProperty(types.S, types.NewAny())), // map[string]interface{} aka JSON + types.NewObject(nil, types.NewDynamicProperty(types.S, types.NewAny())), // map[string]any aka JSON ), } rego.RegisterBuiltin1(&decl, parseCombinedConfigFiles) @@ -56,24 +56,17 @@ // parsed configuration as a Rego object. This can be used to parse all of the // configuration formats conftest supports in-line in Rego policies. func parseConfig(bctx rego.BuiltinContext, op1, op2 *ast.Term) (*ast.Term, error) { - args, err := decodeArgs([]*ast.Term{op1, op2}) + args, err := decodeTypedArgs("", op1, op2) if err != nil { return nil, fmt.Errorf("decode args: %w", err) } - parserName, ok := args[0].(string) - if !ok { - return nil, fmt.Errorf("parser name %v [%T] is not expected type string", args[0], args[0]) - } - config, ok := args[1].(string) - if !ok { - return nil, fmt.Errorf("config %v [%T] is not expected type string", args[1], args[1]) - } + parserName, config := args[0], args[1] + parser, err := parser.New(parserName) if err != nil { return nil, fmt.Errorf("create config parser: %w", err) } - - var cfg map[string]interface{} + var cfg map[string]any if err := parser.Unmarshal([]byte(config), &cfg); err != nil { return nil, fmt.Errorf("unmarshal config: %w", err) } @@ -84,15 +77,12 @@ // parseConfigFile takes a config file path, parses the config file, and // returns the parsed configuration as a Rego object. func parseConfigFile(bctx rego.BuiltinContext, op1 *ast.Term) (*ast.Term, error) { - args, err := decodeArgs([]*ast.Term{op1}) + args, err := decodeTypedArgs("", op1) if err != nil { return nil, fmt.Errorf("decode args: %w", err) } - file, ok := args[0].(string) - if !ok { - return nil, fmt.Errorf("file %v [%T] is not expected type string", args[0], args[0]) - } - filePath := filepath.Join(filepath.Dir(bctx.Location.File), file) + filePath := filepath.Join(filepath.Dir(bctx.Location.File), args[0]) + parser, err := parser.NewFromPath(filePath) if err != nil { return nil, fmt.Errorf("create config parser: %w", err) @@ -102,7 +92,7 @@ return nil, fmt.Errorf("read config file %s: %w", filePath, err) } - var cfg map[string]interface{} + var cfg map[string]any if err := parser.Unmarshal(contents, &cfg); err != nil { return nil, fmt.Errorf("unmarshal config: %w", err) } @@ -110,46 +100,58 @@ return toAST(bctx, cfg, contents) } -// parseCombinedConfigFiles +// parseCombinedConfigFiles takes multiple config file paths, parses the configs, +// combines them, and returns that as a Rego object. func parseCombinedConfigFiles(bctx rego.BuiltinContext, op1 *ast.Term) (*ast.Term, error) { - args, err := decodeArgs([]*ast.Term{op1}) + iface, err := ast.ValueToInterface(op1.Value, nil) if err != nil { - return nil, fmt.Errorf("decode args: %w", err) + return nil, fmt.Errorf("ast.ValueToInterface: %w", err) + } + slice, ok := iface.([]any) + if !ok { + return nil, fmt.Errorf("argument is not a slice") } - filePaths := []string{} - fileList := args[0].([]interface{}) - for _, file := range fileList { - filePaths = append(filePaths, filepath.Join(filepath.Dir(bctx.Location.File), file.(string))) + var paths []string + for i, s := range slice { + path, ok := s.(string) + if !ok { + return nil, fmt.Errorf("index %d is not expected type string", i) + } + paths = append(paths, filepath.Join(filepath.Dir(bctx.Location.File), path)) } - cfg, err := parser.ParseConfigurations(filePaths) + cfg, err := parser.ParseConfigurations(paths) if err != nil { - return nil, fmt.Errorf("failed to parse combine configurations: %w", err) + return nil, fmt.Errorf("parse combine configurations: %w", err) } - combinedCfg := parser.CombineConfigurations(cfg) - combinedContent, err := json.Marshal(combinedCfg) + combined := parser.CombineConfigurations(cfg) + content, err := json.Marshal(combined) if err != nil { - return nil, fmt.Errorf("failed to marshal combined content: %w", err) + return nil, fmt.Errorf("marshal combined content: %w", err) } - return toAST(bctx, combinedCfg["Combined"], combinedContent) + return toAST(bctx, combined["Combined"], content) } -func decodeArgs(args []*ast.Term) ([]interface{}, error) { - decoded := make([]interface{}, len(args)) +func decodeTypedArgs[T any](ty T, args ...*ast.Term) ([]T, error) { + decoded := make([]T, len(args)) for i, arg := range args { iface, err := ast.ValueToInterface(arg.Value, nil) if err != nil { return nil, fmt.Errorf("ast.ValueToInterface: %w", err) } - decoded[i] = iface + v, ok := iface.(T) + if !ok { + return nil, fmt.Errorf("argument %d is not type %T, have %T", i, ty, iface) + } + decoded[i] = v } return decoded, nil } -func toAST(bctx rego.BuiltinContext, cfg interface{}, contents []byte) (*ast.Term, error) { +func toAST(bctx rego.BuiltinContext, cfg any, contents []byte) (*ast.Term, error) { val, err := ast.InterfaceToValue(cfg) if err != nil { return nil, fmt.Errorf("convert config to ast.Value: %w", err) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conftest-0.44.1/docs/options.md new/conftest-0.45.0/docs/options.md --- old/conftest-0.44.1/docs/options.md 2023-07-09 02:37:32.000000000 +0200 +++ new/conftest-0.45.0/docs/options.md 2023-09-01 17:50:26.000000000 +0200 @@ -139,7 +139,7 @@ ## `--fail-on-warn` -Policies can either be catagorized as a warning (using the `warn` rule) or a failure (using the `deny` or `violation` rules). By default, Conftest only returns an exit code of `1` when a policy has failed. +Policies can either be categorized as a warning (using the `warn` rule) or a failure (using the `deny` or `violation` rules). By default, Conftest only returns an exit code of `1` when a policy has failed. The `--fail-on-warn` flag changes this behavior to the following: @@ -172,6 +172,7 @@ - Table `--output=table` - JUnit `--output=junit` - GitHub `--output=github` +- AzureDevOps `--output=azuredevops` ### Plaintext @@ -306,6 +307,21 @@ conftest test -o github -p examples/kubernetes/policy examples/kubernetes/deployment.yaml ``` +### Azure DevOps + +```console +$ conftest test -o azuredevops -p examples/kubernetes/policy examples/kubernetes/deployment.yaml +##[section]Testing 'examples/kubernetes/deployment.yaml' against 5 policies in namespace 'main' +##[group]See conftest results +##vso[task.logissue type=error] file=examples/kubernetes/deployment.yaml --> Containers must not run as root in Deployment hello-kubernetes +##vso[task.logissue type=error] file=examples/kubernetes/deployment.yaml --> Deployment hello-kubernetes must provide app/release labels for pod selectors +##vso[task.logissue type=error] file=examples/kubernetes/deployment.yaml --> hello-kubernetes must include Kubernetes recommended labels: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels +##vso[task.logissue type=error] file=examples/kubernetes/deployment.yaml --> Found deployment hello-kubernetes but deployments are not allowed +success file=examples/kubernetes/deployment.yaml 1 +##[endgroup] +5 tests, 1 passed, 0 warnings, 4 failures, 0 exceptions +``` + ## `--parser` Conftest normally detects which parser to used based on the file extension of the file, even when multiple input files are passed in. However, it is possible force a specific parser to be used with the `--parser` flag. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conftest-0.44.1/examples/kubernetes/combine/combine.rego new/conftest-0.45.0/examples/kubernetes/combine/combine.rego --- old/conftest-0.44.1/examples/kubernetes/combine/combine.rego 2023-07-09 02:37:32.000000000 +0200 +++ new/conftest-0.45.0/examples/kubernetes/combine/combine.rego 2023-09-01 17:50:26.000000000 +0200 @@ -11,4 +11,4 @@ input[i].contents.kind == "Service" service := input[i].contents service.spec.selector.app == app -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conftest-0.44.1/go.mod new/conftest-0.45.0/go.mod --- old/conftest-0.44.1/go.mod 2023-07-09 02:37:32.000000000 +0200 +++ new/conftest-0.45.0/go.mod 2023-09-01 17:50:26.000000000 +0200 @@ -10,7 +10,6 @@ github.com/basgys/goxml2json v1.1.0 github.com/bufbuild/protocompile v0.5.1 github.com/cpuguy83/dockercfg v0.3.1 - github.com/ghodss/yaml v1.0.0 github.com/go-akka/configuration v0.0.0-20200606091224-a002c0330665 github.com/go-ini/ini v1.67.0 github.com/google/go-cmp v0.5.9 @@ -22,8 +21,8 @@ github.com/magiconair/properties v1.8.5 github.com/moby/buildkit v0.11.5 github.com/olekukonko/tablewriter v0.0.5 - github.com/open-policy-agent/opa v0.54.0 - github.com/opencontainers/image-spec v1.1.0-rc2 + github.com/open-policy-agent/opa v0.56.0 + github.com/opencontainers/image-spec v1.1.0-rc4 github.com/pkg/errors v0.9.1 github.com/shteou/go-ignore v0.3.1 github.com/spdx/tools-golang v0.3.1-0.20230104082527-d6f58551be3f @@ -35,7 +34,8 @@ google.golang.org/protobuf v1.30.0 muzzammil.xyz/jsonc v1.0.0 olympos.io/encoding/edn v0.0.0-20201019073823-d3554ca0b0a3 - oras.land/oras-go/v2 v2.2.0 + oras.land/oras-go/v2 v2.3.0 + sigs.k8s.io/yaml v1.3.0 ) require ( @@ -105,22 +105,24 @@ github.com/yashtewari/glob-intersection v0.2.0 // indirect github.com/zclconf/go-cty v1.8.1 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/otel v1.14.0 // indirect - go.opentelemetry.io/otel/sdk v1.14.0 // indirect - go.opentelemetry.io/otel/trace v1.14.0 // indirect - golang.org/x/crypto v0.10.0 // indirect - golang.org/x/net v0.11.0 // indirect + go.opentelemetry.io/otel v1.16.0 // indirect + go.opentelemetry.io/otel/metric v1.16.0 // indirect + go.opentelemetry.io/otel/sdk v1.16.0 // indirect + go.opentelemetry.io/otel/trace v1.16.0 // indirect + golang.org/x/crypto v0.12.0 // indirect + golang.org/x/net v0.14.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sync v0.2.0 // indirect - golang.org/x/sys v0.9.0 // indirect - golang.org/x/text v0.10.0 // indirect + golang.org/x/sync v0.3.0 // indirect + golang.org/x/sys v0.11.0 // indirect + golang.org/x/text v0.12.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.121.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect - google.golang.org/grpc v1.56.1 // indirect + google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect + google.golang.org/grpc v1.57.0 // indirect gopkg.in/ini.v1 v1.66.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conftest-0.44.1/go.sum new/conftest-0.45.0/go.sum --- old/conftest-0.44.1/go.sum 2023-07-09 02:37:32.000000000 +0200 +++ new/conftest-0.45.0/go.sum 2023-09-01 17:50:26.000000000 +0200 @@ -235,7 +235,7 @@ github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= github.com/bufbuild/protocompile v0.5.1/go.mod h1:G5iLmavmF4NsYtpZFvE3B/zFch2GIY8+wjsYLR/lc40= github.com/bytecodealliance/wasmtime-go/v3 v3.0.2 h1:3uZCA/BLTIu+DqCfguByNMJa2HVHpXvjfy0Dy7g6fuA= -github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -309,7 +309,6 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-akka/configuration v0.0.0-20200606091224-a002c0330665 h1:Iz3aEheYgn+//VX7VisgCmF/wW3BMtXCLbvHV4jMQJA= github.com/go-akka/configuration v0.0.0-20200606091224-a002c0330665/go.mod h1:19bUnum2ZAeftfwwLZ/wRe7idyfoW2MfmXO464Hrfbw= @@ -536,12 +535,12 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/open-policy-agent/opa v0.54.0 h1:mGEsK+R5ZTMV8fzzbNzmYDGbTmY30wmRCIHmtm2VqWs= -github.com/open-policy-agent/opa v0.54.0/go.mod h1:d8I8jWygKGi4+T4H07qrbeCdH1ITLsEfT0M+bsvxWw0= +github.com/open-policy-agent/opa v0.56.0 h1:FUSb6MyckjuffOMshEG8P+HGnckxkJ8ENZJHEzAddhk= +github.com/open-policy-agent/opa v0.56.0/go.mod h1:un01L10fkolr00KJMDSqGb2FXCjVyVQOybLtHOfSEfY= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/image-spec v1.1.0-rc4 h1:oOxKUJWnFC4YGHCCMNql1x4YaDfYBTS5Y4x/Cgeo1E0= +github.com/opencontainers/image-spec v1.1.0-rc4/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= @@ -634,7 +633,7 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tchap/go-patricia/v2 v2.3.1 h1:6rQp39lgIYZ+MHmdEq4xzuk1t7OdC35z/xm0BGhTkes= @@ -682,17 +681,18 @@ go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0 h1:yt2NKzK7Vyo6h0+X8BA4FpreZQTlVEIarnsBP/H5mzs= -go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= -go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 h1:/fXHZHGvro6MVqV34fJzDhi7sHGpX3Ej/Qjmfn003ho= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 h1:TKf2uAs2ueguzLaxOCBXNpHxfO/aC7PAdDsSH0IbeRQ= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 h1:ap+y8RXX3Mu9apKVtOkM6WSFESLM8K3wNQyOU8sWHcc= -go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= -go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= -go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= -go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= -go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0 h1:pginetY7+onl4qN1vl0xW/V/v6OBZ0vVdH+esuJgvmM= +go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= +go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0 h1:t4ZwRPU+emrcvM2e9DHd0Fsf0JTPVcbfa/BhTDF03d0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0 h1:cbsD4cUcviQGXdw8+bo5x2wazq10SKz8hEbtCRPcU78= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.16.0 h1:TVQp/bboR4mhZSav+MdgXB8FaRho1RC8UwVn3T0vjVc= +go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= +go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= +go.opentelemetry.io/otel/sdk v1.16.0 h1:Z1Ok1YsijYL0CSJpHt4cS3wDDh7p572grzNrBMiMWgE= +go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= +go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= +go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -709,8 +709,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -806,8 +806,8 @@ golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -849,8 +849,8 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -923,8 +923,8 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -939,8 +939,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1171,8 +1171,12 @@ google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 h1:9NWlQfY2ePejTmfwUH1OWwmznFa+0kKcHGPDvcPza9M= +google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54/go.mod h1:zqTuNwFlFRsw5zIts5VnzLQxSRqh+CGOTVMlYbY0Eyk= +google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 h1:m8v1xLLLzMe1m5P+gCTF8nJB9epwZQUBERm20Oy1poQ= +google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1209,8 +1213,8 @@ google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ= -google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= +google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1263,8 +1267,8 @@ muzzammil.xyz/jsonc v1.0.0/go.mod h1:rFv8tUUKe+QLh7v02BhfxXEf4ZHhYD7unR93HL/1Uvo= olympos.io/encoding/edn v0.0.0-20201019073823-d3554ca0b0a3 h1:slmdOY3vp8a7KQbHkL+FLbvbkgMqmXojpFUO/jENuqQ= olympos.io/encoding/edn v0.0.0-20201019073823-d3554ca0b0a3/go.mod h1:oVgVk4OWVDi43qWBEyGhXgYxt7+ED4iYNpTngSLX2Iw= -oras.land/oras-go/v2 v2.2.0 h1:E1fqITD56Eg5neZbxBtAdZVgDHD6wBabJo6xESTcQyo= -oras.land/oras-go/v2 v2.2.0/go.mod h1:pXjn0+KfarspMHHNR3A56j3tgvr+mxArHuI8qVn59v8= +oras.land/oras-go/v2 v2.3.0 h1:lqX1aXdN+DAmDTKjiDyvq85cIaI4RkIKp/PghWlAGIU= +oras.land/oras-go/v2 v2.3.0/go.mod h1:GeAwLuC4G/JpNwkd+bSZ6SkDMGaaYglt6YK2WvZP7uQ= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conftest-0.44.1/internal/commands/test.go new/conftest-0.45.0/internal/commands/test.go --- old/conftest-0.44.1/internal/commands/test.go 2023-07-09 02:37:32.000000000 +0200 +++ new/conftest-0.45.0/internal/commands/test.go 2023-09-01 17:50:26.000000000 +0200 @@ -166,9 +166,9 @@ cmd.Flags().Bool("all-namespaces", false, "Test policies found in all namespaces") cmd.Flags().Bool("quiet", false, "Disable successful test output") - cmd.Flags().BoolP("trace", "", false, "Enable more verbose trace output for Rego queries") - cmd.Flags().BoolP("strict", "", false, "Enable strict mode for Rego policies") - cmd.Flags().BoolP("combine", "", false, "Combine all config files to be evaluated together") + cmd.Flags().Bool("trace", false, "Enable more verbose trace output for Rego queries") + cmd.Flags().Bool("strict", false, "Enable strict mode for Rego policies") + cmd.Flags().Bool("combine", false, "Combine all config files to be evaluated together") cmd.Flags().String("ignore", "", "A regex pattern which can be used for ignoring paths") cmd.Flags().String("parser", "", fmt.Sprintf("Parser to use to parse the configurations. Valid parsers: %s", parser.Parsers())) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conftest-0.44.1/output/azuredevops.go new/conftest-0.45.0/output/azuredevops.go --- old/conftest-0.44.1/output/azuredevops.go 1970-01-01 01:00:00.000000000 +0100 +++ new/conftest-0.45.0/output/azuredevops.go 2023-09-01 17:50:26.000000000 +0200 @@ -0,0 +1,104 @@ +package output + +import ( + "fmt" + "io" + + "github.com/open-policy-agent/opa/tester" +) + +// AzureDevOps represents an Outputter that outputs +// results in AzureDevOps Pipelines format. +// https://learn.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands +type AzureDevOps struct { + writer io.Writer +} + +// NewAzureDevOps creates a new AzureDevOps with the given writer. +func NewAzureDevOps(w io.Writer) *AzureDevOps { + azuredevops := AzureDevOps{ + writer: w, + } + + return &azuredevops +} + +// Output outputs the results. +func (t *AzureDevOps) Output(checkResults []CheckResult) error { + var totalFailures int + var totalExceptions int + var totalWarnings int + var totalSuccesses int + var totalSkipped int + + for _, result := range checkResults { + totalPolicies := result.Successes + len(result.Failures) + len(result.Warnings) + len(result.Exceptions) + len(result.Skipped) + + fmt.Fprintf(t.writer, "##[section]Testing '%v' against %v policies in namespace '%v'\n", result.FileName, totalPolicies, result.Namespace) + fmt.Fprintf(t.writer, "##[group]See conftest results\n") + for _, failure := range result.Failures { + fmt.Fprintf(t.writer, "##vso[task.logissue type=error] file=%v --> %v\n", result.FileName, failure.Message) + } + + for _, warning := range result.Warnings { + fmt.Fprintf(t.writer, "##vso[task.logissue type=warning] file=%v --> %v\n", result.FileName, warning.Message) + } + + for _, exception := range result.Exceptions { + fmt.Fprintf(t.writer, "##vso[task.logissuetype=warning] file=%v --> %v\n", result.FileName, exception.Message) + } + + for _, skipped := range result.Skipped { + fmt.Fprintf(t.writer, "skipped file=%v %v\n", result.FileName, skipped.Message) + } + + if result.Successes > 0 { + fmt.Fprintf(t.writer, "success file=%v %v\n", result.FileName, result.Successes) + } + + totalFailures += len(result.Failures) + totalExceptions += len(result.Exceptions) + totalWarnings += len(result.Warnings) + totalSkipped += len(result.Skipped) + totalSuccesses += result.Successes + + fmt.Fprintf(t.writer, "##[endgroup]\n") + } + + totalTests := totalFailures + totalExceptions + totalWarnings + totalSuccesses + totalSkipped + + var pluralSuffixTests string + if totalTests != 1 { + pluralSuffixTests = "s" + } + + var pluralSuffixWarnings string + if totalWarnings != 1 { + pluralSuffixWarnings = "s" + } + + var pluralSuffixFailures string + if totalFailures != 1 { + pluralSuffixFailures = "s" + } + + var pluralSuffixExceptions string + if totalExceptions != 1 { + pluralSuffixExceptions = "s" + } + + outputText := fmt.Sprintf("%v test%s, %v passed, %v warning%s, %v failure%s, %v exception%s", + totalTests, pluralSuffixTests, + totalSuccesses, + totalWarnings, pluralSuffixWarnings, + totalFailures, pluralSuffixFailures, + totalExceptions, pluralSuffixExceptions, + ) + fmt.Fprintln(t.writer, outputText) + + return nil +} + +func (t *AzureDevOps) Report(_ []*tester.Result, _ string) error { + return fmt.Errorf("report is not supported in AzureDevOps output") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conftest-0.44.1/output/azuredevops_test.go new/conftest-0.45.0/output/azuredevops_test.go --- old/conftest-0.44.1/output/azuredevops_test.go 1970-01-01 01:00:00.000000000 +0100 +++ new/conftest-0.45.0/output/azuredevops_test.go 2023-09-01 17:50:26.000000000 +0200 @@ -0,0 +1,107 @@ +package output + +import ( + "bytes" + "strings" + "testing" +) + +func TestAzureDevOps(t *testing.T) { + tests := []struct { + name string + input []CheckResult + expected []string + }{ + { + name: "no warnings or errors", + input: []CheckResult{ + { + FileName: "examples/kubernetes/service.yaml", + Namespace: "namespace", + }, + }, + expected: []string{ + "##[section]Testing 'examples/kubernetes/service.yaml' against 0 policies in namespace 'namespace'", + "##[group]See conftest results", + "##[endgroup]", + "0 tests, 0 passed, 0 warnings, 0 failures, 0 exceptions", + "", + }, + }, + { + name: "records failure and warnings", + input: []CheckResult{ + { + FileName: "examples/kubernetes/service.yaml", + Namespace: "namespace", + Warnings: []Result{{Message: "first warning"}}, + Failures: []Result{{Message: "first failure"}}, + }, + }, + expected: []string{ + "##[section]Testing 'examples/kubernetes/service.yaml' against 2 policies in namespace 'namespace'", + "##[group]See conftest results", + "##vso[task.logissue type=error] file=examples/kubernetes/service.yaml --> first failure", + "##vso[task.logissue type=warning] file=examples/kubernetes/service.yaml --> first warning", + "##[endgroup]", + "2 tests, 0 passed, 1 warning, 1 failure, 0 exceptions", + "", + }, + }, + { + name: "mixed failure, warnings and skipped", + input: []CheckResult{ + { + FileName: "examples/kubernetes/service.yaml", + Namespace: "namespace", + Failures: []Result{{Message: "first failure"}}, + Skipped: []Result{{Message: "first skipped"}}, + }, + }, + expected: []string{ + "##[section]Testing 'examples/kubernetes/service.yaml' against 2 policies in namespace 'namespace'", + "##[group]See conftest results", + "##vso[task.logissue type=error] file=examples/kubernetes/service.yaml --> first failure", + "skipped file=examples/kubernetes/service.yaml first skipped", + "##[endgroup]", + "2 tests, 0 passed, 0 warnings, 1 failure, 0 exceptions", + "", + }, + }, + { + name: "handles stdin input", + input: []CheckResult{ + { + FileName: "-", + Namespace: "namespace", + Failures: []Result{{Message: "first failure"}}, + }, + }, + expected: []string{ + "##[section]Testing '-' against 1 policies in namespace 'namespace'", + "##[group]See conftest results", + "##vso[task.logissue type=error] file=- --> first failure", + "##[endgroup]", + "1 test, 0 passed, 0 warnings, 1 failure, 0 exceptions", + "", + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + expected := strings.Join(tt.expected, "\n") + + buf := new(bytes.Buffer) + if err := NewAzureDevOps(buf).Output(tt.input); err != nil { + t.Fatal("output Azure DevOps:", err) + } + + actual := buf.String() + + if expected != actual { + t.Errorf("unexpected output. expected %v actual %v", expected, actual) + } + }) + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conftest-0.44.1/output/output.go new/conftest-0.45.0/output/output.go --- old/conftest-0.44.1/output/output.go 2023-07-09 02:37:32.000000000 +0200 +++ new/conftest-0.45.0/output/output.go 2023-09-01 17:50:26.000000000 +0200 @@ -26,12 +26,13 @@ // The defined output formats represent all of the supported formats // that can be used to format and render results. const ( - OutputStandard = "stdout" - OutputJSON = "json" - OutputTAP = "tap" - OutputTable = "table" - OutputJUnit = "junit" - OutputGitHub = "github" + OutputStandard = "stdout" + OutputJSON = "json" + OutputTAP = "tap" + OutputTable = "table" + OutputJUnit = "junit" + OutputGitHub = "github" + OutputAzureDevOps = "azuredevops" ) // Get returns a type that can render output in the given format. @@ -49,6 +50,8 @@ return NewJUnit(os.Stdout, options.JUnitHideMessage) case OutputGitHub: return NewGitHub(os.Stdout) + case OutputAzureDevOps: + return NewAzureDevOps(os.Stdout) default: return NewStandard(os.Stdout) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conftest-0.44.1/parser/cyclonedx/cyclonedx_test.go new/conftest-0.45.0/parser/cyclonedx/cyclonedx_test.go --- old/conftest-0.44.1/parser/cyclonedx/cyclonedx_test.go 2023-07-09 02:37:32.000000000 +0200 +++ new/conftest-0.45.0/parser/cyclonedx/cyclonedx_test.go 2023-09-01 17:50:26.000000000 +0200 @@ -49,6 +49,7 @@ t.Error("There should be information parsed but its nil") } + //#nosec until https://github.com/securego/gosec/issues/1001 is fixed expectedSHA256 := "sha256:d7ec60cf8390612b360c857688b383068b580d9a6ab78417c9493170ad3f1616" metadata := input.(map[string]interface{})["metadata"] @@ -103,6 +104,7 @@ t.Error("There should be information parsed but its nil") } + //#nosec until https://github.com/securego/gosec/issues/1001 is fixed expectedSHA256 := "sha256:d7ec60cf8390612b360c857688b383068b580d9a6ab78417c9493170ad3f1616" metadata := input.(map[string]interface{})["metadata"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conftest-0.44.1/parser/yaml/yaml.go new/conftest-0.45.0/parser/yaml/yaml.go --- old/conftest-0.44.1/parser/yaml/yaml.go 2023-07-09 02:37:32.000000000 +0200 +++ new/conftest-0.45.0/parser/yaml/yaml.go 2023-09-01 17:50:26.000000000 +0200 @@ -4,7 +4,7 @@ "bytes" "fmt" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) // Parser is a YAML parser. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/conftest-0.44.1/plugin/plugin.go new/conftest-0.45.0/plugin/plugin.go --- old/conftest-0.44.1/plugin/plugin.go 2023-07-09 02:37:32.000000000 +0200 +++ new/conftest-0.45.0/plugin/plugin.go 2023-09-01 17:50:26.000000000 +0200 @@ -10,7 +10,7 @@ "strings" "syscall" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) const ( ++++++ conftest.obsinfo ++++++ --- /var/tmp/diff_new_pack.0ag9Cs/_old 2023-09-06 19:02:05.035880337 +0200 +++ /var/tmp/diff_new_pack.0ag9Cs/_new 2023-09-06 19:02:05.039880480 +0200 @@ -1,5 +1,5 @@ name: conftest -version: 0.44.1 -mtime: 1688863052 -commit: ffb3c96d83b2eac43f44c39fb0009054e369ac67 +version: 0.45.0 +mtime: 1693583426 +commit: 97b393eff26b7cfab7c61e8babed09efc5cf863a ++++++ vendor.tar.gz ++++++ /work/SRC/openSUSE:Factory/conftest/vendor.tar.gz /work/SRC/openSUSE:Factory/.conftest.new.1766/vendor.tar.gz differ: char 5, line 1