Skip to content

Commit f2b0f46

Browse files
authored
Merge pull request #112 from mbaldessari/common-automatic-update
common automatic update
2 parents fd3b1ab + a4aebdf commit f2b0f46

15 files changed

Lines changed: 1413 additions & 439 deletions

common/golang-external-secrets/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ name: golang-external-secrets
66
version: 0.0.3
77
dependencies:
88
- name: external-secrets
9-
version: "0.9.10"
9+
version: "0.9.11"
1010
repository: "https://charts.external-secrets.io"
1111
#"https://external-secrets.github.io/kubernetes-external-secrets"
-84.3 KB
Binary file not shown.
Binary file not shown.

common/golang-external-secrets/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ clusterGroup:
2727

2828
external-secrets:
2929
image:
30-
tag: v0.9.10-ubi
30+
tag: v0.9.11-ubi
3131
webhook:
3232
image:
33-
tag: v0.9.10-ubi
33+
tag: v0.9.11-ubi
3434
certController:
3535
image:
36-
tag: v0.9.10-ubi
36+
tag: v0.9.11-ubi

common/scripts/pattern-util.sh

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,45 @@
11
#!/bin/bash
22

3+
function is_available {
4+
command -v $1 >/dev/null 2>&1 || { echo >&2 "$1 is required but it's not installed. Aborting."; exit 1; }
5+
}
6+
7+
function version {
8+
echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'
9+
}
10+
311
if [ -z "$PATTERN_UTILITY_CONTAINER" ]; then
412
PATTERN_UTILITY_CONTAINER="quay.io/hybridcloudpatterns/utility-container"
513
fi
614

15+
readonly commands=(podman)
16+
for cmd in ${commands[@]}; do is_available "$cmd"; done
17+
718
UNSUPPORTED_PODMAN_VERSIONS="1.6 1.5"
19+
PODMAN_VERSION_STR=$(podman --version)
820
for i in ${UNSUPPORTED_PODMAN_VERSIONS}; do
921
# We add a space
10-
if podman --version | grep -q -E "\b${i}"; then
11-
echo "Unsupported podman version. We recommend >= 4.2.0"
22+
if echo "${PODMAN_VERSION_STR}" | grep -q -E "\b${i}"; then
23+
echo "Unsupported podman version. We recommend > 4.3.0"
1224
podman --version
1325
exit 1
1426
fi
1527
done
1628

29+
# podman --version outputs:
30+
# podman version 4.8.2
31+
PODMAN_VERSION=$(echo "${PODMAN_VERSION_STR}" | awk '{ print $NF }')
32+
33+
# podman < 4.3.0 do not support keep-id:uid=...
34+
if [ $(version "${PODMAN_VERSION}") -lt $(version "4.3.0") ]; then
35+
PODMAN_ARGS="-v ${HOME}:/root"
36+
else
37+
# We do not rely on bash's $UID and $GID because on MacOSX $GID is not set
38+
MYUID=$(id -u)
39+
MYGID=$(id -g)
40+
PODMAN_ARGS="--user ${MYUID}:${MYGID} --userns keep-id:uid=${MYUID},gid=${MYGID}"
41+
fi
42+
1743
if [ -n "$KUBECONFIG" ]; then
1844
if [[ ! "${KUBECONFIG}" =~ ^$HOME* ]]; then
1945
echo "${KUBECONFIG} is pointing outside of the HOME folder, this will make it unavailable from the container."
@@ -25,15 +51,13 @@ fi
2551
# $HOME is mounted as itself for any files that are referenced with absolute paths
2652
# $HOME is mounted to /root because the UID in the container is 0 and that's where SSH looks for credentials
2753

28-
# Do not quote the ${KUBECONF_ENV} below, otherwise we will pass '' to podman
29-
# which will be confused
3054
podman run -it --rm --pull=newer \
3155
--security-opt label=disable \
3256
-e EXTRA_HELM_OPTS \
3357
-e KUBECONFIG \
3458
-v "${HOME}":"${HOME}" \
3559
-v "${HOME}":/pattern-home \
36-
-v "${HOME}":/root \
60+
${PODMAN_ARGS} \
3761
-w "$(pwd)" \
3862
"$PATTERN_UTILITY_CONTAINER" \
3963
$@

0 commit comments

Comments
 (0)