diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 8367a057..60f6446b 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -4,7 +4,7 @@ description: Installs the given GardenLinux Python library inputs: version: description: GardenLinux Python library version - default: "0.10.12" + default: "0.10.13" python_version: description: Python version to setup default: "3.13" diff --git a/pyproject.toml b/pyproject.toml index 605f4650..454924d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "gardenlinux" -version = "0.10.12" +version = "0.10.13" description = "Contains tools to work with the features directory of gardenlinux, for example deducting dependencies from feature sets or validating cnames" authors = ["Garden Linux Maintainers "] license = "Apache-2.0" diff --git a/src/gardenlinux/s3/s3_artifacts.py b/src/gardenlinux/s3/s3_artifacts.py index 09a4b17c..afa1f895 100644 --- a/src/gardenlinux/s3/s3_artifacts.py +++ b/src/gardenlinux/s3/s3_artifacts.py @@ -169,18 +169,12 @@ def upload_from_directory( if commit_id_or_hash is None: commit_id_or_hash = cname_object.commit_id - version_epoch = str(cname_object.version_epoch) - - if version_epoch is None: - version_epoch = "" - metadata = { "platform": cname_object.feature_set_platform, "architecture": arch, "base_image": None, "build_committish": commit_id_or_hash, - "build_timestamp": datetime.fromtimestamp(release_timestamp).isoformat(), - "gardenlinux_epoch": version_epoch, + "build_timestamp": datetime.fromtimestamp(release_timestamp), "logs": None, "modifiers": feature_set_list, "require_uefi": require_uefi, @@ -193,6 +187,9 @@ def upload_from_directory( "paths": [], } + if cname_object.version_epoch is not None: + metadata["gardenlinux_epoch"] = cname_object.version_epoch + platform_variant = cname_object.platform_variant if platform_variant is not None: @@ -210,13 +207,11 @@ def upload_from_directory( md5sum = file_digest(fp, "md5").hexdigest() sha256sum = file_digest(fp, "sha256").hexdigest() - suffixes = "".join(artifact.name)[1 + base_name_length :] - artifact_metadata = { "name": artifact.name, "s3_bucket_name": self._bucket.name, "s3_key": s3_key, - "suffix": re_object.sub("+", suffixes), + "suffix": re_object.sub("+", artifact.name[base_name_length:]), "md5sum": md5sum, "sha256sum": sha256sum, } diff --git a/tests/s3/constants.py b/tests/s3/constants.py index 73cc5c7b..1bfecf6f 100644 --- a/tests/s3/constants.py +++ b/tests/s3/constants.py @@ -16,8 +16,7 @@ architecture: amd64 base_image: null build_committish: abc123lo -build_timestamp: '{build_timestamp}' -gardenlinux_epoch: '1234' +build_timestamp: {build_timestamp} logs: null modifiers: - _usi @@ -33,7 +32,8 @@ - name: container-amd64-1234.1-abc123lo.release s3_bucket_name: test-bucket s3_key: objects/container-amd64-1234.1-abc123lo/container-amd64-1234.1-abc123lo.release - suffix: release + suffix: .release md5sum: {md5sum} sha256sum: {sha256sum} +gardenlinux_epoch: 1234 """.strip() diff --git a/tests/s3/test_main.py b/tests/s3/test_main.py index a939f0ca..0d116bf5 100644 --- a/tests/s3/test_main.py +++ b/tests/s3/test_main.py @@ -96,8 +96,8 @@ def test_main_with_expected_result( result = capsys.readouterr().out.strip() result = re.sub( - "^(.*)build_timestamp\\: '.+'$", - "\\1build_timestamp: '{build_timestamp}'", + "^(.*)build_timestamp\\: .+$", + "\\1build_timestamp: {build_timestamp}", result, flags=re.M, )