Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Create a Tekton Task that runs the Datree CLI #388

Closed
hadar-co opened this issue Jan 18, 2022 · 4 comments
Closed

Create a Tekton Task that runs the Datree CLI #388

hadar-co opened this issue Jan 18, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request plugins WIP Working in progress (will be deployed soon)
Projects

Comments

@hadar-co
Copy link
Contributor

hadar-co commented Jan 18, 2022

As part of our effort to support various plugins, we would like to create a Tekton Task that will enable users to run the Datree CLI as part of their Tekton pipeline/s.

Requirements:

  • Knowledge of yaml.
  • No knowledge of the Datree codebase is needed.

Resources:
To get started with creating a Tekton Task, see the Tekton readme.
For all Datree-related resources, see the Datree documentation.

Specification:

  1. The task should support using a Datree CLI token in two ways:
    • Setting the token at pipeline level, i.e. as an environment variable.
    • Passing the token directly into the task.
  2. The task should run “datree test” on a user-specified file/directory (see relevant Datree documentation), and fail the pipeline if any of the files failed Datree’s policy check.
  3. The task should be configurable with regards to the available CLI options. The supported options should be:
Flag Alias Values Description
--output -o json, yaml, xml Output the policy check results in the requested format
--output -o simple Output the policy check results in simple text (without emoji or colors)
--schema-version -s e.g. "1.20.0" Set Kubernetes version to validate against.Defaults to 1.18.0 (default "1.18.0")
--ignore-missing-schemas N/A N/A Skip files with missing schemas instead of failing the schema validation check
--policy -p e.g. staging Specify which policy to execute (by policy name)
--only-k8s-files N/A N/A Skip all non-K8s files.Especially useful when scanning a dir with K8s and other config files: datree test *.yaml --only-k8s-files
  1. The task should include an example workflow that uses it.
  2. Once finished, publish the task to the Tekton hub.
@hadar-co hadar-co added enhancement New feature or request plugins up for grabs Looking for a contributor to take this task labels Jan 18, 2022
@github-actions github-actions bot added this to To Do in Datree Jan 19, 2022
@hadar-co hadar-co removed the up for grabs Looking for a contributor to take this task label Jan 26, 2022
@github-actions
Copy link

github-actions bot commented Feb 3, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@eyarz eyarz added WIP Working in progress (will be deployed soon) and removed stale issue labels Feb 3, 2022
@avinashupadhya99
Copy link

Hi @hadar-co , I will be working on this issue. Thanks!

@avinashupadhya99
Copy link

avinashupadhya99 commented Feb 10, 2022

The task is created and documented at https://github.com/avinashupadhya99/catalog/tree/add-datree-task/task/datree/0.1 I will make the PR to the catalog repo once the task is approved by you folks.

Please note that the installation link in the README will not work as the PR is not yet merged. You can use https://raw.githubusercontent.com/avinashupadhya99/catalog/add-datree-task/task/datree/0.1/datree.yaml to install

@eyarz
Copy link
Member

eyarz commented Jun 22, 2022

@hadar-co can we close this?

Datree automation moved this from To Do to Done Jun 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request plugins WIP Working in progress (will be deployed soon)
Projects
Development

No branches or pull requests

3 participants