Signed-off-by: d0zingcat <leewtang@gmail.com>
This commit is contained in:
d0zingcat
2024-02-23 16:51:21 +08:00
parent 033f260e60
commit 5912fbf60c
4 changed files with 21 additions and 1 deletions

7
.zshrc
View File

@@ -167,13 +167,18 @@ function bitnami_seal() {
then
echo 'Invalid parameter, should be like bitnami_seal <namespace> <filename>'
else
if [[ ! -f $2 ]]
then
echo "The file does not exist"
exit 1
fi
if [[ $2 != *".raw.yaml" ]]; then
echo "The variable does not have the .raw.yaml extension"
exit 1
fi
# parse *.raw.yaml to *.yaml
newname=${2//.raw/}
kubeseal --controller-namespace sealed-secrets --controller-name sealed-secrets -oyaml -n $1 < $2 > $newname
kubeseal --controller-namespace sealed-secrets --controller-name sealed-secrets -oyaml -n $1 -f $2 > $newname
fi
}