Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/1246.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added compression type options to RPM repositories and publications.
2 changes: 2 additions & 0 deletions src/pulpcore/cli/rpm/common.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
LEGACY_CHECKSUM_CHOICES = ("md5", "sha1", "sha224", "sha256", "sha384", "sha512")

CHECKSUM_CHOICES = ("sha256", "sha384", "sha512")

COMPRESSION_CHOICES = ("zstd", "gz", "none")
8 changes: 7 additions & 1 deletion src/pulpcore/cli/rpm/publication.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
show_command,
type_option,
)
from pulpcore.cli.rpm.common import CHECKSUM_CHOICES
from pulpcore.cli.rpm.common import CHECKSUM_CHOICES, COMPRESSION_CHOICES

translation = get_translation(__package__)
_ = translation.gettext
Expand Down Expand Up @@ -64,6 +64,12 @@ def publication() -> None:
),
needs_plugins=[PluginRequirement("rpm", specifier=">=3.25.0")],
),
pulp_option(
"--compression-type",
type=click.Choice(COMPRESSION_CHOICES, case_sensitive=False),
help=_("Option specifying the compression type to use for metadata."),
needs_plugins=[PluginRequirement("rpm", specifier=">=3.25.0")],
),
pulp_option(
"--checkpoint",
is_flag=True,
Expand Down
8 changes: 7 additions & 1 deletion src/pulpcore/cli/rpm/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
version_command,
)
from pulpcore.cli.core.generic import task_command
from pulpcore.cli.rpm.common import CHECKSUM_CHOICES, LEGACY_CHECKSUM_CHOICES
from pulpcore.cli.rpm.common import CHECKSUM_CHOICES, COMPRESSION_CHOICES, LEGACY_CHECKSUM_CHOICES

translation = get_translation(__package__)
_ = translation.gettext
Expand Down Expand Up @@ -160,6 +160,12 @@ def repository() -> None:
),
needs_plugins=[PluginRequirement("rpm", specifier=">=3.25.0")],
),
pulp_option(
"--compression-type",
type=click.Choice(COMPRESSION_CHOICES, case_sensitive=False),
help=_("Option specifying the compression type to use for metadata."),
needs_plugins=[PluginRequirement("rpm", specifier=">=3.25.0")],
),
pulp_option(
"--gpgcheck",
type=click.Choice(("0", "1")),
Expand Down
4 changes: 4 additions & 0 deletions tests/scripts/pulp_rpm/test_rpm_sync_publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ else
expect_succ pulp rpm repository update --name "cli_test_rpm_sync_repository" --package-checksum-type sha1
fi

expect_succ pulp rpm repository update --repository "cli_test_rpm_sync_repository" --compression-type zstd
expect_succ pulp rpm publication create --repository "cli_test_rpm_sync_repository" --compression-type gz
expect_succ test "$(echo "$OUTPUT" | jq -r '.compression_type')" = "gz"

expect_succ pulp rpm distribution destroy --name "cli_test_rpm_sync_distro"
expect_succ pulp rpm publication destroy --href "$PUBLICATION_HREF"
expect_succ pulp rpm publication destroy --href "$PUBLICATION_VER_HREF"
Expand Down
Loading