Skip to content
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

Fix docker-compose add_signing_service script #648

Closed
wants to merge 1 commit into from
Closed
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/647.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed default docker compose file not launching when PULP_SIGNING_KEY_FINGERPRINT was unset.
2 changes: 1 addition & 1 deletion images/assets/add_signing_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/usr/bin/wait_on_postgres.py
/usr/bin/wait_on_database_migrations.sh

if [ -n "${PULP_SIGNING_KEY_FINGERPRINT}" ]; then
if [ -n "${PULP_SIGNING_KEY_FINGERPRINT-}" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

Isn't that:

Suggested change
if [ -n "${PULP_SIGNING_KEY_FINGERPRINT-}" ]; then
if [ -n "${PULP_SIGNING_KEY_FINGERPRINT:-}" ]; then

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding the colon makes it also a nullity check. Do you think we need to check also if the value is null, since the default I am setting it to is null? (I am actually not sure how null works in bash land)

https://devhints.io/bash#parameter-expansions

Copy link
Member

Choose a reason for hiding this comment

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

Well, I'd say if the variable was not set or set to "" it is safe to assume we cannot configure a signing service from it.
But honestly i didn't know about "-" alone.
But now reading up, i think both produce the same result here, as we replace with "".

/usr/local/bin/pulpcore-manager add-signing-service "${COLLECTION_SIGNING_SERVICE}" /var/lib/pulp/scripts/collection_sign.sh "${PULP_SIGNING_KEY_FINGERPRINT}"
/usr/local/bin/pulpcore-manager add-signing-service "${CONTAINER_SIGNING_SERVICE}" /var/lib/pulp/scripts/container_sign.sh "${PULP_SIGNING_KEY_FINGERPRINT}" --class container:ManifestSigningService
fi
Loading