You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+36-40
Original file line number
Diff line number
Diff line change
@@ -2,20 +2,19 @@
2
2
3
3
## Features
4
4
5
-
* Create a new check which makes sure that certain labels are overridden in
5
+
- Create a new check which makes sure that certain labels are overridden in
6
6
layered images.
7
-
* Certain remote API calls are now being retried - this should help in environments where network is unreliable.
7
+
- Certain remote API calls are now being retried - this should help in environments where network is unreliable.
8
8
9
9
## Breaking changes
10
10
11
-
* Python 2 is now completely unsupported.
11
+
- Python 2 is now completely unsupported.
12
12
13
13
## Minor
14
14
15
-
* A bunch of usability issues: when things go wrong, colin should not
15
+
- A bunch of usability issues: when things go wrong, colin should not
16
16
produce more helpful error messages and logs.
17
17
18
-
19
18
# 0.3.1
20
19
21
20
## Fixes
@@ -26,72 +25,69 @@
26
25
27
26
## Breaking changes
28
27
29
-
* Remove support for Python 2.
30
-
28
+
- Remove support for Python 2.
31
29
32
30
# 0.3.0
33
31
34
32
## New Features
35
33
36
-
* You can configure timeout for checks now:
37
-
* This can be done via CLI or add `timeout: <seconds>` to a check in a ruleset.
38
-
* Default timeout is set to 10 minutes.
39
-
* Checks can be skipped via CLI option `--skip`.
34
+
- You can configure timeout for checks now:
35
+
- This can be done via CLI or add `timeout: <seconds>` to a check in a ruleset.
36
+
- Default timeout is set to 10 minutes.
37
+
- Checks can be skipped via CLI option `--skip`.
40
38
41
39
## Breaking changes
42
40
43
-
* Colin searches a value in label now instead of matching it using a regex.
41
+
- Colin searches a value in label now instead of matching it using a regex.
44
42
45
43
## Fixes
46
44
47
-
* Output a sensible error message when the check code cannot be found.
48
-
* Handle the situation when the instruction FROM is missing in testing image tag.
49
-
45
+
- Output a sensible error message when the check code cannot be found.
46
+
- Handle the situation when the instruction FROM is missing in testing image tag.
50
47
51
48
# 0.2.1
52
49
53
50
## New Features
54
51
55
-
* Allow setting CLI options via environment variables
56
-
* Allow loading rulesets from virtualenv
57
-
* Add info subcommand
52
+
- Allow setting CLI options via environment variables
53
+
- Allow loading rulesets from virtualenv
54
+
- Add info subcommand
58
55
59
56
# 0.2.0
60
57
61
58
## Breaking changes
62
59
63
-
* switch from docker to podman, thanks to @lachmanfrantisek
64
-
* remove `container` target type
65
-
* new cli arg: target type (defaults to image -- for podman)
60
+
- switch from docker to podman, thanks to @lachmanfrantisek
61
+
- remove `container` target type
62
+
- new cli arg: target type (defaults to image -- for podman)
66
63
67
64
## New Features
68
65
69
-
* add `ostree` target, thanks to @TomasTomecek
70
-
* use fmf format in checks, thanks to @jscotka
71
-
* allow rulesets in the YAML format, thanks to @SkullTech
66
+
- add `ostree` target, thanks to @TomasTomecek
67
+
- use fmf format in checks, thanks to @jscotka
68
+
- allow rulesets in the YAML format, thanks to @SkullTech
72
69
73
70
## Fixes
74
71
75
-
* many code style fixes
76
-
* use Centos CI, thanks to @jpopelka
77
-
* better loading of the ruleset files (subdir -> user -> system), thanks to @SkullTech
78
-
* check existence of json output file directory
79
-
* simpler loading of checks
80
-
* tinker CONTRIBUTING.md
81
-
* do not mount whole FS when checking for files
82
-
* improve tests quality
83
-
72
+
- many code style fixes
73
+
- use Centos CI, thanks to @jpopelka
74
+
- better loading of the ruleset files (subdir -> user -> system), thanks to @SkullTech
75
+
- check existence of json output file directory
76
+
- simpler loading of checks
77
+
- tinker CONTRIBUTING.md
78
+
- do not mount whole FS when checking for files
79
+
- improve tests quality
84
80
85
81
# 0.1.0
86
82
87
83
Welcome to the first official release of colin. With `0.0.*` releases we tried to iterate on a minimal viable product and with this `0.1.0` release we believe it's finally here.
88
84
89
85
# Features
90
86
91
-
* Validate a selected artifact against a ruleset.
92
-
* Artifacts can be container images, containers and dockerfiles.
93
-
* We provide a default ruleset we believe every container should satisfy.
94
-
* There is a ruleset to validate an artifact whether it complies to [Fedora Container Guidelines](https://fedoraproject.org/wiki/Container:Guidelines)
95
-
* Colin can list available rulesets and list checks in a ruleset.
96
-
* There is a python API available
97
-
* Colin can be integrated into your workflow easily - it can provide results in json format.
87
+
- Validate a selected artifact against a ruleset.
88
+
- Artifacts can be container images, containers and dockerfiles.
89
+
- We provide a default ruleset we believe every container should satisfy.
90
+
- There is a ruleset to validate an artifact whether it complies to [Fedora Container Guidelines](https://fedoraproject.org/wiki/Container:Guidelines)
91
+
- Colin can list available rulesets and list checks in a ruleset.
92
+
- There is a python API available
93
+
- Colin can be integrated into your workflow easily - it can provide results in json format.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+34-23
Original file line number
Diff line number
Diff line change
@@ -8,17 +8,19 @@ Use your best judgement, and feel free to propose changes to this document in a
8
8
By contributing to this project you agree to the Developer Certificate of Origin (DCO). This document is a simple statement that you, as a contributor, have the legal right to submit the contribution. See the [DCO](DCO) file for details.
9
9
10
10
## Reporting Bugs
11
+
11
12
Before creating bug reports, please check a [list of known issues](https://github.com/user-cont/colin/issues) to see
12
13
if the problem has already been reported (or fixed in a master branch).
13
14
14
15
If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/user-cont/colin/issues/new).
15
16
Be sure to include a **descriptive title and a clear description**. Ideally, please provide:
16
-
* version of colin you are using (`rpm -q colin` or `pip3 freeze | grep colin`)
17
-
* version of [conu](https://github.com/user-cont/conu) library (`rpm -q python3-conu` or `pip3 freeze | grep conu`)
18
-
* version of [dockerfile-parse](https://github.com/DBuildService/dockerfile-parse) library (`rpm -q python3-dockerfile-parse` or `pip3 freeze | grep dockerfile-parse`)
19
-
* version of container runtime you are using (`rpm -qa | grep docker`)
20
-
* the command you executed, output and ideally please describe the image, container or dockerfile you are validating
21
-
* invoke colin in debug mode (`--debug`)
17
+
18
+
- version of colin you are using (`rpm -q colin` or `pip3 freeze | grep colin`)
19
+
- version of [conu](https://github.com/user-cont/conu) library (`rpm -q python3-conu` or `pip3 freeze | grep conu`)
20
+
- version of [dockerfile-parse](https://github.com/DBuildService/dockerfile-parse) library (`rpm -q python3-dockerfile-parse` or `pip3 freeze | grep dockerfile-parse`)
21
+
- version of container runtime you are using (`rpm -qa | grep docker`)
22
+
- the command you executed, output and ideally please describe the image, container or dockerfile you are validating
23
+
- invoke colin in debug mode (`--debug`)
22
24
23
25
If possible, add a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.
24
26
@@ -33,24 +35,27 @@ in as many details as possible.
33
35
34
36
## How to contribute code to colin
35
37
36
-
* Please make sure that your code complies with [PEP8](https://www.python.org/dev/peps/pep-0008/).
37
-
* One line should not contain more than 100 characters.
38
-
* Make sure that new code is covered by a test case (new or existing one).
39
-
* We don't like [spaghetti code](https://en.wikipedia.org/wiki/Spaghetti_code).
40
-
* The tests have to pass.
38
+
- Please make sure that your code complies with [PEP8](https://www.python.org/dev/peps/pep-0008/).
39
+
- One line should not contain more than 100 characters.
40
+
- Make sure that new code is covered by a test case (new or existing one).
41
+
- We don't like [spaghetti code](https://en.wikipedia.org/wiki/Spaghetti_code).
* classes which end with `AbstractCheck` are NOT loaded
48
-
* only classes which with `Check` are loaded
49
-
* the check class needs to be a child of a `AbstractCheck`
50
+
51
+
- classes which end with `AbstractCheck` are NOT loaded
52
+
- only classes which with `Check` are loaded
53
+
- the check class needs to be a child of a `AbstractCheck`
50
54
51
55
Here's a simple template how you can create a new check:
52
56
53
57
## Label check example
58
+
54
59
```python
55
60
from colin.core.checks.labels import LabelAbstractCheck
56
61
@@ -81,6 +86,7 @@ Let's go through the list of keyword arguments:
81
86
-`required` — keyword specific to `LabelCheck` class. If the check fails and this is true, the check is marked as failed. If this is false and the check fails, it is a warning.
82
87
83
88
## File system check example
89
+
84
90
```python
85
91
from colin.core.checks.filesystem import FileCheck
86
92
@@ -100,12 +106,14 @@ class FooBarFileCheck(FileCheck):
100
106
```
101
107
102
108
We only need to describe one argument here:
109
+
103
110
-`files` is specific to `FileSystemCheck` class and indicates on what files we want to operate on.
104
111
105
112
## Add the new check into a ruleset
113
+
106
114
Once code for your check is complete, here's how you can run it.
107
115
108
-
Create a new ruleset file with your locally created check(s):
116
+
Create a new ruleset file with your locally created check(s):
109
117
110
118
```bash
111
119
$ cat foobar.yaml
@@ -115,8 +123,9 @@ checks:
115
123
- {name: foobar_file_required}
116
124
117
125
```
118
-
__NOTE__: _Colin_ accepts `YAML` formatted ruleset files. As `JSON` is a subset of the `YAML` standard, `JSON` formatted
119
-
rulesets are also supported, but `YAML` is recommended.
126
+
127
+
**NOTE**: _Colin_ accepts `YAML` formatted ruleset files. As `JSON` is a subset of the `YAML` standard, `JSON` formatted
128
+
rulesets are also supported, but `YAML` is recommended.
The command above implies that your check lives happily with other checks in this upstream repo. It's possible to have checks stored externally and point colin to them.
128
137
129
138
Let's move one of the checks mentioned above to `/tmp/external_checks/checks.py`:
139
+
130
140
```
131
141
$ cat /tmp/external_checks/checks.py
132
142
from colin.core.checks.filesystem import FileCheck
@@ -147,6 +157,7 @@ class FooBarFileCheck(FileCheck):
147
157
```
148
158
149
159
This would be our simple ruleset:
160
+
150
161
```bash
151
162
$ cat foobar.json
152
163
{
@@ -158,6 +169,7 @@ $ cat foobar.json
158
169
```
159
170
160
171
And we would just call colin and point it to the directory containing python files with checks:
If your check is generic enough, it may make sense to add it to [default ruleset](https://github.com/user-cont/colin/blob/master/rulesets/default.json).
190
202
191
-
192
203
## Changelog
193
204
194
205
When you are contributing to changelog, please follow these suggestions:
195
206
196
-
* The changelog is meant to be read by everyone. Imagine that an average user
207
+
- The changelog is meant to be read by everyone. Imagine that an average user
197
208
will read it and should understand the changes. `Add check timeouts` is
198
209
completely undescriptive.
199
-
* Every line should be a complete sentence. Either tell what is the change that the tool is doing or describe it precisely:
200
-
* Bad: `Use search method in label regex`
201
-
* Good: `Colin now uses search method when...`
202
-
* And finally, with the changelogs we are essentially selling our projects:
210
+
- Every line should be a complete sentence. Either tell what is the change that the tool is doing or describe it precisely:
211
+
- Bad: `Use search method in label regex`
212
+
- Good: `Colin now uses search method when...`
213
+
- And finally, with the changelogs we are essentially selling our projects:
203
214
think about a situation that you met someone at a conference and you are
204
215
trying to convince the person to use the project and that the changelog
Tool to check generic rules and best-practices for container images and dockerfiles.
@@ -13,21 +13,18 @@ For more information, please check our [documentation on colin.readthedocs.io](h
13
13
14
14

15
15
16
-
17
16
# Features
18
17
19
-
* Validate a selected artifact against a ruleset.
20
-
* Artifacts can be container images and dockerfiles.
21
-
* We provide a default ruleset we believe every container image should satisfy.
22
-
* There is a ruleset to validate an artifact whether it complies to [Fedora Container Guidelines](https://fedoraproject.org/wiki/Container:Guidelines)
23
-
* Colin can list available rulesets and list checks in a ruleset.
24
-
* There is a python API available
25
-
* Colin can be integrated into your workflow easily - it can provide results in json format.
26
-
18
+
- Validate a selected artifact against a ruleset.
19
+
- Artifacts can be container images and dockerfiles.
20
+
- We provide a default ruleset we believe every container image should satisfy.
21
+
- There is a ruleset to validate an artifact whether it complies to [Fedora Container Guidelines](https://fedoraproject.org/wiki/Container:Guidelines)
22
+
- Colin can list available rulesets and list checks in a ruleset.
23
+
- There is a python API available
24
+
- Colin can be integrated into your workflow easily - it can provide results in json format.
27
25
28
26
## Installation
29
27
30
-
31
28
### Via `pip`
32
29
33
30
If you are on Fedora distribution, please install python3-pyxattr so you don't
@@ -42,6 +39,7 @@ $ pip3 install --user colin
42
39
### On Fedora distribution
43
40
44
41
colin is packaged in official Fedora repositories:
42
+
45
43
```
46
44
$ dnf install -y colin
47
45
```
@@ -51,9 +49,9 @@ $ dnf install -y colin
51
49
- For checking `image` target-type, you have to install [podman](https://github.com/containers/libpod/blob/master/docs/tutorials/podman_tutorial.md). If you need to check local docker images, you need to prefix your images with `docker-daemon` (e.g. `colin check docker-daemon:docker.io/openshift/origin-web-console:v3.11`).
52
50
53
51
- If you want to use `ostree` target, you need to install following tools:
0 commit comments