Skip to content

Commit

Permalink
Merge pull request #56 from SEKOIA-IO/fix/docker_registry_http_header
Browse files Browse the repository at this point in the history
fix: HTTP headers to check if a docker image exists
  • Loading branch information
Darkheir authored Jun 21, 2023
2 parents 4ca147d + 6629204 commit 059d5c2
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.0.270'
rev: 'v0.0.274'
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.3.4] - 2023-06-21

### Fixed:

- Change HTTP header to check if an image exists in the registry

## [1.3.3] - 2023-06-13

### Fixed:
Expand Down
118 changes: 59 additions & 59 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "sekoia-automation-sdk"

version = "1.3.3"
version = "1.3.4"
description = "SDK to create SEKOIA.IO playbook modules"
license = "MIT"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion sekoia_automation/scripts/sync_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def check_image_on_registry(self, docker_image: str, version: str) -> bool:
f"https://{registry}/v2/{namespace}/{image_name}/manifests/{version}",
headers={
"Authorization": f"Bearer {token}",
"Accept": "application/vnd.docker.distribution.manifest.v2+json",
"Accept": "application/vnd.oci.image.index.v1+json",
},
)

Expand Down
3 changes: 2 additions & 1 deletion tests/test_trigger.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
from datetime import timedelta
from pathlib import Path
from typing import ClassVar
from unittest.mock import PropertyMock, mock_open, patch

# third parties
Expand All @@ -24,7 +25,7 @@


class DummyTrigger(Trigger):
event: dict = {}
event: ClassVar[dict] = {}

def run(self):
self.send_event("test", self.event)
Expand Down

0 comments on commit 059d5c2

Please sign in to comment.