Commit c451cb6
Avoid zero-length matches (awslabs#30)
With the default value of `""` for the `IGNORE_TAGS_REGEX` we ended up
with zero-length matches, which caused many image tags to be ignored as
the matching didn't return a `None`.
An example that can demonstrate this behavior is:
```python
import re
REGEX=''
string='something'
response = re.compile(REGEX).match(string)
print("Type: {}".format(type(response))) # Type: <type '_sre.SRE_Match'>
print("First position of matching: {}".format(response.start())) # 0
print("Last position of matching: {}".format(response.end())) # 0
print("---")
REGEX='^$'
string='something'
response = re.compile(REGEX).match(string)
print("Type: {}".format(type(response))) # Type: <type 'NoneType'>
```
---
Before this modification we had:
```
Starting with repository :...
Total number of images found: 513
Number of untagged images found 3
Number of running images found 1
Number of images to be deleted: 3
```
And after:
```
Starting with repository :...
Total number of images found: 513
Number of untagged images found 3
Number of running images found 1
Number of images to be deleted: 503
```
Which is more aligned with the expected behavior.1 parent 60a97c1 commit c451cb6
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| |||
0 commit comments