Skip to content

Commit

Permalink
Merge pull request #14 from telekom-mms/renovate/python-3.x
Browse files Browse the repository at this point in the history
Update python Docker tag to v3.12
  • Loading branch information
rndmh3ro authored Dec 1, 2023
2 parents bf2d3ee + 027c97b commit 22ab025
Show file tree
Hide file tree
Showing 3 changed files with 256 additions and 199 deletions.
17 changes: 12 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
FROM python:3.11-slim@sha256:23f52205321f806c2cc742cefbf837e0d25101388c043e860c7817985230565c
FROM python:3.12 as build

WORKDIR /app

RUN pip install --no-cache-dir poetry

COPY poetry.lock pyproject.toml /
COPY poetry.lock pyproject.toml /app/

RUN poetry config virtualenvs.in-project true
RUN poetry install --no-ansi

FROM python:3.12-slim@sha256:eb6d3208444a54418be98f83f1006f6d78ef17144f1cd9eb4e5945d4851af355

RUN poetry install --no-dev --no-cache
COPY --from=build /app /app

COPY src/* /src/
COPY src/* /app/

CMD ["poetry", "run", "kopf", "run", "--liveness=http://0.0.0.0:8080/healthz", "/src/handlers.py", "--all-namespaces"]
CMD ["/app/.venv/bin/kopf", "run", "--liveness=http://0.0.0.0:8080/healthz", "/app/handlers.py", "--all-namespaces"]
14 changes: 7 additions & 7 deletions docs/LOCAL-DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ environment for this operator.
```bash
export DEFECT_DOJO_API_KEY="YOUR_API_KEY"
export DEFECT_DOJO_URL="http://localhost:8080"
export LABEL="trivy-operator.resource.name"; export LABEL_VALUE="your_label_value";
export LABEL="trivy-operator.resource.name"; export LABEL_VALUE="your-label-value";
export DEFECT_DOJO_ENGAGEMENT_NAME="test"
export DEFECT_DOJO_AUTO_CREATE_CONTEXT=true
export DEFECT_DOJO_ACTIVE=true
Expand All @@ -94,7 +94,7 @@ environment for this operator.
```bash
$ poetry run kopf run src/handlers.py --all-namespaces

[2023-11-06 15:56:49,610] settings [INFO ] Looking for resources with LABEL 'trivy-operator.resource.name' and LABEL_VALUE 'your_label_value'
[2023-11-06 15:56:49,610] settings [INFO ] Looking for resources with LABEL 'trivy-operator.resource.name' and LABEL_VALUE 'your-label-value'
[2023-11-06 15:56:49,646] kopf.activities.star [INFO ] Activity 'configure' succeeded.
[2023-11-06 15:56:49,647] kopf._core.engines.a [INFO ] Initial authentication has been initiated.
[2023-11-06 15:56:49,654] kopf.activities.auth [INFO ] Activity 'login_via_client' succeeded.
Expand All @@ -104,16 +104,16 @@ environment for this operator.
- Create a pod, thus a VulnerabilityReport

```bash
kubectl run --image debian:11 your_label_value bash
kubectl run --image debian:11 your-label-value bash
```

- Check the logs in kopf:

```bash
[2023-11-07 08:57:36,430] kopf.objects [INFO ] [default/pod-your_label_value] Working on pod-your_label_value
[2023-11-07 08:57:40,048] kopf.objects [INFO ] [default/pod-your_label_value] Finished pod-your_label_value
[2023-11-07 08:57:40,050] kopf.objects [INFO ] [default/pod-your_label_value] Handler 'send_to_dojo' succeeded.
[2023-11-07 08:57:40,051] kopf.objects [INFO ] [default/pod-your_label_value] Creation is processed: 1 succeeded; 0 failed.
[2023-11-07 08:57:36,430] kopf.objects [INFO ] [default/pod-your-label-value] Working on pod-your-label-value
[2023-11-07 08:57:40,048] kopf.objects [INFO ] [default/pod-your-label-value] Finished pod-your-label-value
[2023-11-07 08:57:40,050] kopf.objects [INFO ] [default/pod-your-label-value] Handler 'send_to_dojo' succeeded.
[2023-11-07 08:57:40,051] kopf.objects [INFO ] [default/pod-your-label-value] Creation is processed: 1 succeeded; 0 failed.
```

## Troubleshooting
Expand Down
Loading

0 comments on commit 22ab025

Please sign in to comment.