Skip to content

Consolidate the definition and consumption of --sign* CLI options #26617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented Jul 11, 2025

Only define --sign* options once, to reduce repetition and simplify adding another one. This will help adding --sign-by-sq-fingerprint.

Also clean up some artifact code.

See individual commit messages for details.

Does this PR introduce a user-facing change?

None

@openshift-ci openshift-ci bot added release-note-none approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 11, 2025
CredentialsCLI string
signing common.SigningCLIOnlyOptions
EncryptionKeys []string
EncryptLayers []int
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More of this could probably be shared, but I don’t need to do that for my purposes now.

@TomSweeneyRedHat
Copy link
Member

Failing as there are no new tests. Should we add the flag to override that?

@mtrmac
Copy link
Collaborator Author

mtrmac commented Jul 14, 2025

I’ll just add a test for artifact push --creds — that’s not the core of the otherwise-pure-refactoring PR but it should have a test.

@mtrmac mtrmac force-pushed the common-signing branch 5 times, most recently from 28ba166 to 1ce6abb Compare July 14, 2025 13:18
Copy link

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

@mtrmac mtrmac force-pushed the common-signing branch 3 times, most recently from b93e021 to 344c4be Compare July 14, 2025 15:57
@mtrmac
Copy link
Collaborator Author

mtrmac commented Jul 14, 2025

b93e021 shows the new tests failing…

@mtrmac
Copy link
Collaborator Author

mtrmac commented Jul 14, 2025

… and tests are succeeding with the fix as intended. PTAL.

@@ -158,6 +160,47 @@ var _ = Describe("Podman artifact", func() {
Expect(a.Name).To(Equal(artifact1Name))
})

It("podman artifact push and pull with authorization", func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name says push and pull but this test only ever tries push

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!

mtrmac added 3 commits July 15, 2025 15:39
CLI options have no place in pkg/domain/entities, and these
are never set anyway.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
Actually use the parsed values.

Signed-off-by: Miloslav Trmač <[email protected]>
There are three copies of them, and already a shared utility, so
also define the options in a single place.

This will make it easier to add more options, and it reduces the risk
of incorrectly ordering the parameters to PrepareSigning.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

openshift-ci bot commented Jul 16, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99, mtrmac

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants