bcgov / bcgov/quickstart-openshift-helpers

Improve install_cert.sh: validation, backup, and UX enhancements

Open
#230 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
1
Forks
2
Avg merge
17m
Merged PRs (30d)
5

Description

## Suggestions for install_cert.sh improvements

1. **File existence and format validation**
- Check that ${DOMAIN}.pem, ${DOMAIN}.key, and ${DOMAIN}.ca-cert exist and are non-empty before proceeding.
- Optionally, use openssl to verify that the certificate and key match (modulus check).

2. **Automatic route backup**
- Before making any changes, export the current route YAML to a timestamped backup file (e.g., using: oc get route -o yaml > backup).
- This allows quick rollback if something goes wrong.

3. **Safer route replacement**
- If the route already exists, handle it gracefully (e.g., use oc replace, oc apply, or delete the old route first).
- Echo a clear error message if route creation fails.

4. **CA chain handling**
- If the CA chain is split across multiple files, concatenate them into ${DOMAIN}.ca-cert before running the script.

5. **User experience improvements**
- Echo the full oc command before running it so the user can see exactly what will be executed.
- Add clear error messages and confirmations at each step.

These changes will make the script safer, more robust, and easier to use and recover from errors.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading install_cert.sh and trace how it handles the ${DOMAIN}.pem, ${DOMAIN}.key, ${DOMAIN}.ca-cert files and the oc route command. Check the available openssl validation and route YAML export steps, then verify that existing routes, failures, backups, confirmations, and CA-chain inputs are handled clearly and safely.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.