Skip to content

Commit e0b400e

Browse files
authored
build(deps): bump argocd-operator version (#1124)
* build(deps): bump argocd-operator version Signed-off-by: Jayendra Parsai <jparsai@redhat.com> * fix: change log level Signed-off-by: Jayendra Parsai <jparsai@redhat.com> --------- Signed-off-by: Jayendra Parsai <jparsai@redhat.com>
1 parent ddee831 commit e0b400e

23 files changed

+320
-250
lines changed

build/redis/haproxy.cfg.tpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ backend check_if_redis_is_master_0
2424
{{- else}}
2525
tcp-check connect ssl
2626
{{- end}}
27-
tcp-check send "AUTH replace-with-redis-auth"\r\n
27+
tcp-check send "AUTH __REPLACE_DEFAULT_AUTH__"\r\n
2828
tcp-check expect string +OK
2929
tcp-check send PING\r\n
3030
tcp-check expect string +PONG
@@ -50,7 +50,7 @@ backend check_if_redis_is_master_1
5050
{{- else}}
5151
tcp-check connect ssl
5252
{{- end}}
53-
tcp-check send "AUTH replace-with-redis-auth"\r\n
53+
tcp-check send "AUTH __REPLACE_DEFAULT_AUTH__"\r\n
5454
tcp-check expect string +OK
5555
tcp-check send PING\r\n
5656
tcp-check expect string +PONG
@@ -76,7 +76,7 @@ backend check_if_redis_is_master_2
7676
{{- else}}
7777
tcp-check connect ssl
7878
{{- end}}
79-
tcp-check send "AUTH replace-with-redis-auth"\r\n
79+
tcp-check send "AUTH __REPLACE_DEFAULT_AUTH__"\r\n
8080
tcp-check expect string +OK
8181
tcp-check send PING\r\n
8282
tcp-check expect string +PONG
@@ -108,7 +108,7 @@ backend bk_redis_master
108108
{{- else}}
109109
tcp-check connect ssl
110110
{{- end}}
111-
tcp-check send "AUTH replace-with-redis-auth"\r\n
111+
tcp-check send "AUTH __REPLACE_DEFAULT_AUTH__"\r\n
112112
tcp-check expect string +OK
113113
tcp-check send PING\r\n
114114
tcp-check expect string +PONG

build/redis/haproxy_init.sh.tpl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ if [ -z "$ANNOUNCE_IP2" ]; then
3333
fi
3434
sed -i "s/REPLACE_ANNOUNCE2/$ANNOUNCE_IP2/" "$HAPROXY_CONF"
3535

36-
auth=$(cat /redis-initial-pass/admin.password)
37-
sed -i "s/replace-with-redis-auth/$auth/" "$HAPROXY_CONF"
36+
AUTH="$(cat /app/config/redis-auth/auth)"
37+
if [ -z "${AUTH}" ]; then
38+
echo "Error: Redis password not mounted correctly"
39+
exit 1
40+
fi
41+
echo "Setting redis auth values.."
42+
ESCAPED_AUTH=$(echo "${AUTH}" | sed -e 's/[\/&]/\\&/g');
43+
sed -i "s/__REPLACE_DEFAULT_AUTH__/${ESCAPED_AUTH}/" "$HAPROXY_CONF"
3844

build/redis/init.sh.tpl

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,15 @@ setup_defaults() {
132132

133133
redis_ping() {
134134
set +e
135+
AUTH="$(cat /app/config/redis-auth/auth)"
136+
if [ -z "$AUTH" ]; then
137+
echo "Error: Redis password not mounted correctly"
138+
exit 1
139+
fi
135140
if [ "$REDIS_PORT" -eq 0 ]; then
136-
redis-cli -h "${MASTER}" -a "${AUTH}" --no-auth-warning -p "${REDIS_TLS_PORT}" --tls --cacert /app/config/redis/tls/tls.crt ping
141+
env REDISCLI_AUTH="${AUTH}" redis-cli -h "${MASTER}" -p "${REDIS_TLS_PORT}" --tls --cacert /app/config/redis/tls/tls.crt ping
137142
else
138-
redis-cli -h "${MASTER}" -a "${AUTH}" --no-auth-warning -p "${REDIS_PORT}" ping
143+
env REDISCLI_AUTH="${AUTH}" redis-cli -h "${MASTER}" -p "${REDIS_PORT}" ping
139144
fi
140145
set -e
141146
}
@@ -170,7 +175,7 @@ find_master() {
170175
if [ "$SENTINEL_PORT" -eq 0 ]; then
171176
echo " on sentinel (${SERVICE}:${SENTINEL_TLS_PORT}), sentinel grp (${MASTER_GROUP})"
172177
echo " $(date).."
173-
if redis-cli -h "${SERVICE}" -p "${SENTINEL_TLS_PORT}" --tls --cacert /app/config/redis/tls/tls.crt sentinel failover "${MASTER_GROUP}" | grep -q 'NOGOODSLAVE' ; then
178+
if redis-cli -h "${SERVICE}" -p "${SENTINEL_TLS_PORT}" --tls --cacert /app/config/redis/tls/tls.crt sentinel failover "${MASTER_GROUP}" | grep -q 'NOGOODSLAVE' ; then
174179
echo " $(date) Failover returned with 'NOGOODSLAVE'"
175180
echo "Setting defaults for this pod.."
176181
setup_defaults
@@ -179,7 +184,7 @@ find_master() {
179184
else
180185
echo " on sentinel (${SERVICE}:${SENTINEL_PORT}), sentinel grp (${MASTER_GROUP})"
181186
echo " $(date).."
182-
if redis-cli -h "${SERVICE}" -p "${SENTINEL_PORT}" sentinel failover "${MASTER_GROUP}" | grep -q 'NOGOODSLAVE' ; then
187+
if redis-cli -h "${SERVICE}" -p "${SENTINEL_PORT}" sentinel failover "${MASTER_GROUP}" | grep -q 'NOGOODSLAVE'; then
183188
echo " $(date) Failover returned with 'NOGOODSLAVE'"
184189
echo "Setting defaults for this pod.."
185190
setup_defaults
@@ -252,16 +257,19 @@ else
252257
setup_defaults
253258
fi
254259

255-
if [ "${AUTH:-}" ]; then
256-
echo "Setting redis auth values.."
257-
ESCAPED_AUTH=$(echo "${AUTH}" | sed -e 's/[\/&]/\\&/g');
258-
sed -i "s/replace-default-auth/${ESCAPED_AUTH}/" "${REDIS_CONF}" "${SENTINEL_CONF}"
260+
AUTH="$(cat /app/config/redis-auth/auth)"
261+
if [ -z "${AUTH}" ]; then
262+
echo "Error: Redis password not mounted correctly"
263+
exit 1
259264
fi
265+
echo "Setting redis auth values.."
266+
ESCAPED_AUTH=$(echo "${AUTH}" | sed -e 's/[\/&]/\\&/g');
267+
sed -i "s/__REPLACE_DEFAULT_AUTH__/${ESCAPED_AUTH}/" "${REDIS_CONF}" "${SENTINEL_CONF}"
260268

261269
if [ "${SENTINELAUTH:-}" ]; then
262270
echo "Setting sentinel auth values"
263271
ESCAPED_AUTH_SENTINEL=$(echo "$SENTINELAUTH" | sed -e 's/[\/&]/\\&/g');
264-
sed -i "s/replace-default-sentinel-auth/${ESCAPED_AUTH_SENTINEL}/" "$SENTINEL_CONF"
272+
sed -i "s/__REPLACE_DEFAULT_SENTINEL_AUTH__/${ESCAPED_AUTH_SENTINEL}/" "$SENTINEL_CONF"
265273
fi
266274

267275
echo "$(date) Ready..."

build/redis/redis.conf.tpl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,4 @@ rdbcompression yes
2020
repl-diskless-sync yes
2121
save ""
2222
protected-mode no
23-
requirepass replace-default-auth
24-
masterauth replace-default-auth
25-
26-
23+
aclfile /app/config/redis-auth/users.acl

build/redis/redis_liveness.sh.tpl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
redis_pwd="$(cat /app/config/redis-auth/auth)"
2+
if [ -z "$redis_pwd" ]; then
3+
echo "Error: Redis password not mounted correctly"
4+
exit 1
5+
fi
16
response=$(
2-
redis-cli \
3-
-a "${AUTH}" --no-auth-warning \
7+
env REDISCLI_AUTH="${redis_pwd}" redis-cli \
48
-h localhost \
59
-p 6379 \
610
{{- if eq .UseTLS "true"}}

build/redis/redis_readiness.sh.tpl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
redis_pwd="$(cat /app/config/redis-auth/auth)"
2+
if [ -z "$redis_pwd" ]; then
3+
echo "Error: Redis password not mounted correctly"
4+
exit 1
5+
fi
16
response=$(
2-
redis-cli \
3-
-a "${AUTH}" --no-auth-warning \
7+
env REDISCLI_AUTH="${redis_pwd}" redis-cli \
48
-h localhost \
59
-p 6379 \
610
{{- if eq .UseTLS "true"}}
@@ -9,7 +13,7 @@ response=$(
913
{{- end}}
1014
ping
1115
)
12-
if [ "$response" != "PONG" ] ; then
16+
if [ "$response" != "PONG" ]; then
1317
echo "$response"
1418
exit 1
1519
fi

build/redis/sentinel.conf.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ bind 0.0.0.0
1515
sentinel failover-timeout argocd 180000
1616
maxclients 10000
1717
sentinel parallel-syncs argocd 5
18-
sentinel auth-pass argocd replace-default-auth
18+
sentinel auth-pass argocd __REPLACE_DEFAULT_AUTH__

cmd/main.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,11 @@ func main() {
258258
argocdprovisioner.Register(openshift.ReconcilerHook, openshift.BuilderHook)
259259

260260
if err = (&argocdprovisioner.ReconcileArgoCD{
261-
Client: client,
262-
Scheme: mgr.GetScheme(),
263-
LabelSelector: labelSelectorFlag,
264-
K8sClient: k8sClient,
265-
LocalUsers: &argocdprovisioner.LocalUsersInfo{
266-
TokenRenewalTimers: map[string]*argocdprovisioner.TokenRenewalTimer{},
267-
},
261+
Client: client,
262+
Scheme: mgr.GetScheme(),
263+
LabelSelector: labelSelectorFlag,
264+
K8sClient: k8sClient,
265+
LocalUsers: argocdprovisioner.NewLocalUsersInfo(),
268266
FipsConfigChecker: argoutil.NewLinuxFipsConfigChecker(),
269267
}).SetupWithManager(mgr); err != nil {
270268
setupLog.Error(err, "unable to create controller", "controller", "Argo CD")

0 commit comments

Comments
 (0)