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

Link Host certificates if available in Control Container #70

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

sumukhballal
Copy link

Description of changes:

This change links host certificates if it has been updated on the Bottlerocket host. It checks if the path /.bottlerocket/certs exists, if so links the certs to the ca-trust source.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

declare -r HOST_CERTS="/.bottlerocket/certs"

# Link host certs if present into container & run update-ca-trust
if [ -e "${HOST_CERTS}" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if [ -e "${HOST_CERTS}" ]; then
if [[ -d "${HOST_CERTS}" ]]; then

@@ -6,6 +6,16 @@ declare -r PERSISTENT_STORAGE_BASE_DIR="/.bottlerocket/host-containers/current"
declare -r USER_DATA="${PERSISTENT_STORAGE_BASE_DIR}/user-data"
declare -r SSM_AGENT_PERSISTENT_STATE_DIR="${PERSISTENT_STORAGE_BASE_DIR}/ssm"
declare -r SSM_AGENT_LOCAL_STATE_DIR="/var/lib/amazon/ssm"
declare -r HOST_CERTS="/.bottlerocket/certs"

# Link host certs if present into container & run update-ca-trust
Copy link
Member

Choose a reason for hiding this comment

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

Can we move this block to after the function declarations, or make it a function itself, to remain consistent with the rest of the script?

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