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

CLOUD-4745: ensure certificates are up to date #104

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

pb-dod
Copy link
Contributor

@pb-dod pb-dod commented Dec 18, 2024

The certificates step wasn't detecting when updates were needed on existing systems. This became apparent when @hochdave encountered issues where his system had outdated certificates, but ih-setup's test function wasn't detecting this and triggering an update.

Specifically, this manifested as an issue @hochdave had with NODE_EXTRA_CA_CERTS pointing to an outdated certificate path, causing npm install failures.

Solution

Added file comparison checks to ensure both the certificates and their configuration files match their source versions. If either is out of date, the step will trigger a reinstall.

Changes include:

  • Moving path variables to the top level for consistency and reuse
  • Adding diff checks in the test() function to compare installed files with their sources
  • Using consistent variable names throughout the script
  • Ensuring both the CA certificate and the configuration script are checked

Testing

Tested using the isolated environment test script. Verified that:

  • Out-of-date certificates trigger a reinstall
  • Modified configuration files trigger a reinstall
  • Up-to-date installations pass normally

@pb-dod pb-dod requested a review from a team as a code owner December 18, 2024 23:11
# The directory where IH shell default files are to be installed
# These are files that may be overwritten during an upgrade
export IH_DEFAULT_DIR="$IH_DIR/default"

if [ ! -d "$IH_DEFAULT_DIR" ]; then
mkdir "$IH_DEFAULT_DIR"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this to fix this error while testing with ./meta/test-isolated:

cp: /tmp/ih-core-test/.ih/default/11_certificates.sh: No such file or directory

@pb-dod pb-dod merged commit 27b835d into master Dec 19, 2024
@pb-dod pb-dod deleted the feature/CLOUD-4745-cert_checks branch December 19, 2024 00:09
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