tektoncd / catalog

Catalog of shared Tasks and Pipelines.
Apache License 2.0
666 stars 577 forks source link

added 0.2 of conftest #1292

Closed garethahealy closed 3 months ago

garethahealy commented 4 months ago

Changes

added 0.2 of contest as 0.1 was using a very old image / old api

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you review them:

See the contribution guide for more details.

tekton-robot commented 4 months ago

Hi @garethahealy. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
garethahealy commented 4 months ago

/kind feature

tekton-robot commented 4 months ago
Diff between version 0.1 and 0.2 ````diff diff --git a/task/conftest/0.1/conftest.yaml b/task/conftest/0.2/conftest.yaml index 9b59d89..904473e 100644 --- a/task/conftest/0.1/conftest.yaml +++ b/task/conftest/0.2/conftest.yaml @@ -1,13 +1,14 @@ -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: Task metadata: name: conftest labels: - app.kubernetes.io/version: "0.1" + app.kubernetes.io/version: "0.2" annotations: - tekton.dev/pipelines.minVersion: "0.12.1" - tekton.dev/categories: Testing - tekton.dev/tags: test + tekton.dev/pipelines.minVersion: "0.56.1" + tekton.dev/displayName: "conftest" + tekton.dev/categories: Developer Tools + tekton.dev/tags: jq tekton.dev/platforms: "linux/amd64" spec: description: >- @@ -16,22 +17,22 @@ spec: Conftest is a tool for testing configuration files using Open Policy Agent. workspaces: - - name: source + - name: source params: - - name: files - type: string - - name: policy - default: "policy" - - name: output - default: "stdout" - - name: args - type: array - default: [] + - name: files + type: string + - name: policy + default: "policy" + - name: output + default: "stdout" + - name: args + type: array + default: [] steps: - name: conftest workingDir: $(workspaces.source.path) - image: docker.io/instrumenta/conftest:v0.21.0@sha256:7da62b227612d5cf50d6de80db740b77bcfb7fd52b2e1aa679dd9edd692fec21 #tag: v0.21.0 + image: docker.io/openpolicyagent/conftest:v0.54.0@sha256:094e3bc9af439d16d15379bff9fc3aec0d558936aa1ac1e0574c0dcfa1c43e86 #tag: v0.54.0 command: - conftest - test
tekton-robot commented 4 months ago
Diff between version 0.1 and 0.2 ````diff diff --git a/task/conftest/0.1/README.md b/task/conftest/0.2/README.md index 05ec4c9..071c533 100644 --- a/task/conftest/0.1/README.md +++ b/task/conftest/0.2/README.md @@ -8,7 +8,7 @@ your Tekton pipelines. Conftest is a tool for testing configuration files using In order to use Conftest with Tekton you need to first install the task. ```console -kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/conftest/0.1/raw +kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/conftest/0.2/raw ``` ## Platforms @@ -20,7 +20,7 @@ The Task can be run on `linux/amd64` platform. Once installed, the task can be used as follows: ```yaml -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: TaskRun metadata: name: conftest-example @@ -38,7 +38,7 @@ spec: value: examples/kubernetes/policy ``` -Note that the above respository contains both a configuration file we want to test (`examples/kubernetes/deployment.yaml`) and a directory (`examples/kubernetes/policy`) containing OPA policy files. When using the task you would provide the details of the repository you want to test. +Note that the above repository contains both a configuration file we want to test (`examples/kubernetes/deployment.yaml`) and a directory (`examples/kubernetes/policy`) containing OPA policy files. When using the task you would provide the details of the repository you want to test. If you apply the above `TaskRun` you can see the output in the `taskrun` logs. For example: diff --git a/task/conftest/0.1/conftest.yaml b/task/conftest/0.2/conftest.yaml index 9b59d89..904473e 100644 --- a/task/conftest/0.1/conftest.yaml +++ b/task/conftest/0.2/conftest.yaml @@ -1,13 +1,14 @@ -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: Task metadata: name: conftest labels: - app.kubernetes.io/version: "0.1" + app.kubernetes.io/version: "0.2" annotations: - tekton.dev/pipelines.minVersion: "0.12.1" - tekton.dev/categories: Testing - tekton.dev/tags: test + tekton.dev/pipelines.minVersion: "0.56.1" + tekton.dev/displayName: "conftest" + tekton.dev/categories: Developer Tools + tekton.dev/tags: jq tekton.dev/platforms: "linux/amd64" spec: description: >- @@ -16,22 +17,22 @@ spec: Conftest is a tool for testing configuration files using Open Policy Agent. workspaces: - - name: source + - name: source params: - - name: files - type: string - - name: policy - default: "policy" - - name: output - default: "stdout" - - name: args - type: array - default: [] + - name: files + type: string + - name: policy + default: "policy" + - name: output + default: "stdout" + - name: args + type: array + default: [] steps: - name: conftest workingDir: $(workspaces.source.path) - image: docker.io/instrumenta/conftest:v0.21.0@sha256:7da62b227612d5cf50d6de80db740b77bcfb7fd52b2e1aa679dd9edd692fec21 #tag: v0.21.0 + image: docker.io/openpolicyagent/conftest:v0.54.0@sha256:094e3bc9af439d16d15379bff9fc3aec0d558936aa1ac1e0574c0dcfa1c43e86 #tag: v0.54.0 command: - conftest - test
tekton-robot commented 3 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vinamra28

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[task/conftest/OWNERS](https://github.com/tektoncd/catalog/blob/main/task/conftest/OWNERS)~~ [vinamra28] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment