-
Notifications
You must be signed in to change notification settings - Fork 230
Cert-manager create ca-bundle configmap for trust-manager #6605
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [Service] | ||
| ExecStartPre=/usr/bin/microshift-cert-manager-update-ca-bundle |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,15 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Copy the system CA bundle into the cert-manager manifests directory | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # so kustomize can use it to create the trusted-ca-bundle ConfigMap. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This script runs as ExecStartPre before MicroShift starts. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set -euo pipefail | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SRC="/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DST="/usr/lib/microshift/manifests.d/060-microshift-cert-manager/manager/tls-ca-bundle.pem" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Only copy if the cert-manager manifests directory exists (package installed) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -d "$(dirname "${DST}")" ] && [ -f "${SRC}" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cp -f "${SRC}" "${DST}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1
to
+15
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fail fast if the CA bundle is missing. Silently skipping the copy leaves the manifest still pointing at 🔧 Suggested guard-if [ -d "$(dirname "${DST}")" ] && [ -f "${SRC}" ]; then
- cp -f "${SRC}" "${DST}"
+if [ -d "$(dirname "${DST}")" ]; then
+ if [ -f "${SRC}" ]; then
+ cp -f "${SRC}" "${DST}"
+ else
+ echo "Missing CA bundle at ${SRC}" >&2
+ exit 1
+ fi
fi📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/microshift
Length of output: 375
🏁 Script executed:
Repository: openshift/microshift
Length of output: 4016
🏁 Script executed:
Repository: openshift/microshift
Length of output: 608
Add a
cert-managerpost scriptlet to reload systemd drop-ins.The cert-manager subpackage installs
/etc/systemd/system/microshift.service.d/microshift-cert-manager-ca-bundle.confbut lacks a cert-manager-scoped%posthook to run daemon reload. The existing%systemd_post microshift.serviceis part of the main package post hook and won't execute when cert-manager is installed independently, leaving the drop-in unconfigured until manual reload/reboot.Add:
🤖 Prompt for AI Agents