Skip to content

cbscore: make signing optional#30

Merged
jecluis merged 3 commits intoclyso:mainfrom
UweSchwaeke:wip-cbsbuild-make-signing-optional
Mar 18, 2026
Merged

cbscore: make signing optional#30
jecluis merged 3 commits intoclyso:mainfrom
UweSchwaeke:wip-cbsbuild-make-signing-optional

Conversation

@UweSchwaeke
Copy link
Collaborator

  • what:
    check if the vault and transit keys are available in the secrets file.
    retrieve user credentials for the registry and transit. if all
    credentials are available, sign the image with cosign. otherwise,
    skip signing.

  • why:
    signing of rpm is already optional depending on the presence of a key.
    now signing of container images is optional too.

@UweSchwaeke UweSchwaeke force-pushed the wip-cbsbuild-make-signing-optional branch from ad92cea to c8ae0ab Compare February 23, 2026 19:39
@UweSchwaeke UweSchwaeke force-pushed the wip-cbsbuild-make-signing-optional branch from c8ae0ab to 5cb13ef Compare March 9, 2026 08:09
@jecluis
Copy link
Contributor

jecluis commented Mar 12, 2026

This PR seems to depend on #29 .

raise SkopeoError()

logger.info(f"signed image '{dst}': {out}")
if can_sign(dst_registry, dst, secrets, transit):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be simpler to do something like

if not can_sign(...):
  logger.info("can't sign, sorry, 🤷 ")
  return

[the code inside that block]

Alternatively, have an else branch with the log message, because otherwise we may not be signing the image and it's not clear why.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks, already changed with gemini

@UweSchwaeke UweSchwaeke force-pushed the wip-cbsbuild-make-signing-optional branch from 5cb13ef to 749275f Compare March 12, 2026 09:06
@UweSchwaeke UweSchwaeke requested a review from jecluis March 12, 2026 14:27
* what:
  if the return code of the rpm process is 2, check if the failure
  reason is that the package is already installed.

* why:
  when reusing a container, the package might already be present.
  this occurs when a build runner job must be debugged.

Signed-off-by: Uwe Schwaeke <uwe.schwaeke@clyso.com>
* what:
  add option --tls-verify to subcommands build and runner build.
  pass the tls-verify flag to skopeo when querying the registry.
  check if the return value from skopeo inspect equals
  "not found" (exit code 2).

* why:
  if the image is pushed to a local container registry with a
  self-signed certificate, skopeo must not verify the certificate
  to avoid errors. current versions of skopeo (1.20.0) return exit
  code 2 if an image is not found.

Signed-off-by: Uwe Schwaeke <uwe.schwaeke@clyso.com>
* what:
  check if the vault and transit key is available in the secrets file.
  retrieve user credentials for the registry and transit. if all
  credentials are available, sign the image with cosign; otherwise,
  skip signing.

* why:
  run cbsbuild locally for testing, the image signing step must be
  skipped if keys are missing.
  see clyso#24

Signed-off-by: Uwe Schwaeke <uwe.schwaeke@clyso.com>
@UweSchwaeke UweSchwaeke force-pushed the wip-cbsbuild-make-signing-optional branch from 749275f to c88a926 Compare March 16, 2026 09:20
@jecluis jecluis merged commit d2e8a91 into clyso:main Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants