UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects
Verified Commit 6c571921 authored by Micah Nagel's avatar Micah Nagel :moneybag:
Browse files

Add basic values translation script

parent ae83df72
No related branches found
No related tags found
1 merge request!2687Add basic values translation script, example 1.x defaults
Pipeline #1664661 canceled
---
revision_date: Last edited April 13, 2023
revision_date: Last edited April 14, 2023
tags:
- blog
---
......@@ -19,7 +19,7 @@ As mentioned in the first post, a number of values keys will be changing in orde
- `mattermostoperator` -> `mattermostOperator`
- `nexus` -> `nexusRepositoryManager`
Note that your upgrade to 2.0 will fail if you do not modify your values as seen above. Big Bang is now maintaining a [values schema](https://helm.sh/docs/topics/charts/#schema-files) to enforce strict adherence to the allowed/required keys within Big Bang. For reference Big Bang's values schema is located [here](https://repo1.dso.mil/big-bang/bigbang/-/blob/master/chart/values.schema.json).
Note that your upgrade to 2.0 will fail if you do not modify your values as seen above. Big Bang is now maintaining a [values schema](https://helm.sh/docs/topics/charts/#schema-files) to enforce strict adherence to the allowed/required keys within Big Bang. For reference Big Bang's values schema is located [here](https://repo1.dso.mil/big-bang/bigbang/-/blob/master/chart/values.schema.json). You can also leverage the script in `/scripts/values-translate-2-0.sh <values file path>` to perform these translations for you (note that is is a relatively simple script and may not work for your use case).
## Namespace Changes
......
values_file=$1
if [[ -z $values_file ]]; then
echo "This script requires one parameter, the path to your values file. Rerun the script with that parameter, ex: './scripts/values-translate-2-0.sh my-values-file.yaml'."
exit 1
fi
if [[ ! ( -f "$values_file" ) ]]; then
echo "Values file not found, verify that the correct path was provided for your values."
exit 1
fi
sed_gsed="sed"
# Verify sed version if on macOS
if [[ "$(uname -s)" == "Darwin" ]]; then
if [[ ! $(command -v gsed >/dev/null 2>&1) ]]; then
sed_gsed="gsed"
else
echo "The 'gnu-sed' tool is not installed, but if required when running on macOS. 'gnu-sed' can be installed with 'brew install gnu-sed'."
exit 1
fi
fi
if ! command -v $sed_gsed >/dev/null 2>&1; then
echo "The 'sed' tool is required to run this script. Please install 'sed' then re-run this script."
exit 1
fi
# Update core packages
$sed_gsed -i 's/^istiooperator:$/istioOperator:/' $values_file
$sed_gsed -i 's/^kyvernopolicies:$/kyvernoPolicies:/' $values_file
$sed_gsed -i 's/^kyvernoreporter:$/kyvernoReporter:/' $values_file
$sed_gsed -i 's/^logging:$/elasticsearchKibana:/' $values_file
$sed_gsed -i 's/^eckoperator:$/eckOperator:/' $values_file
# Update addon packages
$sed_gsed -i 's/^\(\s*\)mattermostoperator:$/\1mattermostOperator:/' $values_file
$sed_gsed -i 's/^\(\s*\)nexus:$/\1nexusRepositoryManager:/' $values_file
echo "Values translation completed successfully - validate that the below translations were completed as expected:"
cat << EOF
Core Packages:
istiooperator -> istioOperator
kyvernopolicies -> kyvernoPolicies
kyvernoreporter -> kyvernoReporter
logging -> elasticsearchKibana
eckoperator -> eckOperator
Addon Packages:
mattermostoperator -> mattermostOperator
nexus -> nexusRepositoryManager
EOF
echo "It is important to validate these and confirm that no other keys were affected."
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment