Skip to content

Commit e638b0e

Browse files
fix(tkn): strip newlines from host/username only in AWS host-access secrets
1 parent aaa5c99 commit e638b0e

10 files changed

Lines changed: 36 additions & 36 deletions

tkn/infra-aws-fedora.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,14 @@ spec:
342342
cat <<EOF >> host-info.yaml
343343
type: Opaque
344344
data:
345-
host: $(cat /opt/host-info/host | base64 -w0)
346-
username: $(cat /opt/host-info/username | base64 -w0)
345+
host: $(cat /opt/host-info/host | tr -d '\n\r' | base64 -w0)
346+
username: $(cat /opt/host-info/username | tr -d '\n\r' | base64 -w0)
347347
id_rsa: $(cat /opt/host-info/id_rsa | base64 -w0)
348348
EOF
349349
if [[ "$(params.airgap)" == "true" ]]; then
350350
cat <<EOF >> host-info.yaml
351-
bastion-host: $(cat /opt/host-info/bastion_host | base64 -w0)
352-
bastion-username: $(cat /opt/host-info/bastion_username | base64 -w0)
351+
bastion-host: $(cat /opt/host-info/bastion_host | tr -d '\n\r' | base64 -w0)
352+
bastion-username: $(cat /opt/host-info/bastion_username | tr -d '\n\r' | base64 -w0)
353353
bastion-id_rsa: $(cat /opt/host-info/bastion_id_rsa | base64 -w0)
354354
EOF
355355
fi

tkn/infra-aws-mac.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,14 @@ spec:
294294
cat <<EOF >> host-info.yaml
295295
type: Opaque
296296
data:
297-
host: $(cat /opt/host-info/host | base64 -w0)
298-
username: $(cat /opt/host-info/username | base64 -w0)
297+
host: $(cat /opt/host-info/host | tr -d '\n\r' | base64 -w0)
298+
username: $(cat /opt/host-info/username | tr -d '\n\r' | base64 -w0)
299299
id_rsa: $(cat /opt/host-info/id_rsa | base64 -w0)
300300
EOF
301301
if [[ $(params.airgap) == "true" ]]; then
302302
cat <<EOF >> host-info.yaml
303-
bastion-host: $(cat /opt/host-info/bastion_host | base64 -w0)
304-
bastion-username: $(cat /opt/host-info/bastion_username | base64 -w0)
303+
bastion-host: $(cat /opt/host-info/bastion_host | tr -d '\n\r' | base64 -w0)
304+
bastion-username: $(cat /opt/host-info/bastion_username | tr -d '\n\r' | base64 -w0)
305305
bastion-id_rsa: $(cat /opt/host-info/bastion_id_rsa | base64 -w0)
306306
EOF
307307
fi

tkn/infra-aws-rhel-ai.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,8 @@ spec:
350350
cat <<EOF >> host-info.yaml
351351
type: Opaque
352352
data:
353-
host: $(cat /opt/host-info/host | base64 -w0)
354-
username: $(cat /opt/host-info/username | base64 -w0)
353+
host: $(cat /opt/host-info/host | tr -d '\n\r' | base64 -w0)
354+
username: $(cat /opt/host-info/username | tr -d '\n\r' | base64 -w0)
355355
id_rsa: $(cat /opt/host-info/id_rsa | base64 -w0)
356356
EOF
357357

tkn/infra-aws-rhel.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,14 +368,14 @@ spec:
368368
cat <<EOF >> host-info.yaml
369369
type: Opaque
370370
data:
371-
host: $(cat /opt/host-info/host | base64 -w0)
372-
username: $(cat /opt/host-info/username | base64 -w0)
371+
host: $(cat /opt/host-info/host | tr -d '\n\r' | base64 -w0)
372+
username: $(cat /opt/host-info/username | tr -d '\n\r' | base64 -w0)
373373
id_rsa: $(cat /opt/host-info/id_rsa | base64 -w0)
374374
EOF
375375
if [[ "$(params.airgap)" == "true" ]]; then
376376
cat <<EOF >> host-info.yaml
377-
bastion-host: $(cat /opt/host-info/bastion_host | base64 -w0)
378-
bastion-username: $(cat /opt/host-info/bastion_username | base64 -w0)
377+
bastion-host: $(cat /opt/host-info/bastion_host | tr -d '\n\r' | base64 -w0)
378+
bastion-username: $(cat /opt/host-info/bastion_username | tr -d '\n\r' | base64 -w0)
379379
bastion-id_rsa: $(cat /opt/host-info/bastion_id_rsa | base64 -w0)
380380
EOF
381381
fi

tkn/infra-aws-windows-server.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,14 +301,14 @@ spec:
301301
cat <<EOF >> host-info.yaml
302302
type: Opaque
303303
data:
304-
host: $(cat /opt/host-info/host | base64 -w0)
305-
username: $(cat /opt/host-info/username | base64 -w0)
304+
host: $(cat /opt/host-info/host | tr -d '\n\r' | base64 -w0)
305+
username: $(cat /opt/host-info/username | tr -d '\n\r' | base64 -w0)
306306
id_rsa: $(cat /opt/host-info/id_rsa | base64 -w0)
307307
EOF
308308
if [[ $(params.airgap) == "true" ]]; then
309309
cat <<EOF >> host-info.yaml
310-
bastion-host: $(cat /opt/host-info/bastion_host | base64 -w0)
311-
bastion-username: $(cat /opt/host-info/bastion_username | base64 -w0)
310+
bastion-host: $(cat /opt/host-info/bastion_host | tr -d '\n\r' | base64 -w0)
311+
bastion-username: $(cat /opt/host-info/bastion_username | tr -d '\n\r' | base64 -w0)
312312
bastion-id_rsa: $(cat /opt/host-info/bastion_id_rsa | base64 -w0)
313313
EOF
314314
fi

tkn/template/infra-aws-fedora.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,14 @@ spec:
342342
cat <<EOF >> host-info.yaml
343343
type: Opaque
344344
data:
345-
host: $(cat /opt/host-info/host | base64 -w0)
346-
username: $(cat /opt/host-info/username | base64 -w0)
345+
host: $(cat /opt/host-info/host | tr -d '\n\r' | base64 -w0)
346+
username: $(cat /opt/host-info/username | tr -d '\n\r' | base64 -w0)
347347
id_rsa: $(cat /opt/host-info/id_rsa | base64 -w0)
348348
EOF
349349
if [[ "$(params.airgap)" == "true" ]]; then
350350
cat <<EOF >> host-info.yaml
351-
bastion-host: $(cat /opt/host-info/bastion_host | base64 -w0)
352-
bastion-username: $(cat /opt/host-info/bastion_username | base64 -w0)
351+
bastion-host: $(cat /opt/host-info/bastion_host | tr -d '\n\r' | base64 -w0)
352+
bastion-username: $(cat /opt/host-info/bastion_username | tr -d '\n\r' | base64 -w0)
353353
bastion-id_rsa: $(cat /opt/host-info/bastion_id_rsa | base64 -w0)
354354
EOF
355355
fi

tkn/template/infra-aws-mac.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,14 @@ spec:
294294
cat <<EOF >> host-info.yaml
295295
type: Opaque
296296
data:
297-
host: $(cat /opt/host-info/host | base64 -w0)
298-
username: $(cat /opt/host-info/username | base64 -w0)
297+
host: $(cat /opt/host-info/host | tr -d '\n\r' | base64 -w0)
298+
username: $(cat /opt/host-info/username | tr -d '\n\r' | base64 -w0)
299299
id_rsa: $(cat /opt/host-info/id_rsa | base64 -w0)
300300
EOF
301301
if [[ $(params.airgap) == "true" ]]; then
302302
cat <<EOF >> host-info.yaml
303-
bastion-host: $(cat /opt/host-info/bastion_host | base64 -w0)
304-
bastion-username: $(cat /opt/host-info/bastion_username | base64 -w0)
303+
bastion-host: $(cat /opt/host-info/bastion_host | tr -d '\n\r' | base64 -w0)
304+
bastion-username: $(cat /opt/host-info/bastion_username | tr -d '\n\r' | base64 -w0)
305305
bastion-id_rsa: $(cat /opt/host-info/bastion_id_rsa | base64 -w0)
306306
EOF
307307
fi

tkn/template/infra-aws-rhel-ai.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,8 @@ spec:
350350
cat <<EOF >> host-info.yaml
351351
type: Opaque
352352
data:
353-
host: $(cat /opt/host-info/host | base64 -w0)
354-
username: $(cat /opt/host-info/username | base64 -w0)
353+
host: $(cat /opt/host-info/host | tr -d '\n\r' | base64 -w0)
354+
username: $(cat /opt/host-info/username | tr -d '\n\r' | base64 -w0)
355355
id_rsa: $(cat /opt/host-info/id_rsa | base64 -w0)
356356
EOF
357357

tkn/template/infra-aws-rhel.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,14 +368,14 @@ spec:
368368
cat <<EOF >> host-info.yaml
369369
type: Opaque
370370
data:
371-
host: $(cat /opt/host-info/host | base64 -w0)
372-
username: $(cat /opt/host-info/username | base64 -w0)
371+
host: $(cat /opt/host-info/host | tr -d '\n\r' | base64 -w0)
372+
username: $(cat /opt/host-info/username | tr -d '\n\r' | base64 -w0)
373373
id_rsa: $(cat /opt/host-info/id_rsa | base64 -w0)
374374
EOF
375375
if [[ "$(params.airgap)" == "true" ]]; then
376376
cat <<EOF >> host-info.yaml
377-
bastion-host: $(cat /opt/host-info/bastion_host | base64 -w0)
378-
bastion-username: $(cat /opt/host-info/bastion_username | base64 -w0)
377+
bastion-host: $(cat /opt/host-info/bastion_host | tr -d '\n\r' | base64 -w0)
378+
bastion-username: $(cat /opt/host-info/bastion_username | tr -d '\n\r' | base64 -w0)
379379
bastion-id_rsa: $(cat /opt/host-info/bastion_id_rsa | base64 -w0)
380380
EOF
381381
fi

tkn/template/infra-aws-windows-server.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,14 +301,14 @@ spec:
301301
cat <<EOF >> host-info.yaml
302302
type: Opaque
303303
data:
304-
host: $(cat /opt/host-info/host | base64 -w0)
305-
username: $(cat /opt/host-info/username | base64 -w0)
304+
host: $(cat /opt/host-info/host | tr -d '\n\r' | base64 -w0)
305+
username: $(cat /opt/host-info/username | tr -d '\n\r' | base64 -w0)
306306
id_rsa: $(cat /opt/host-info/id_rsa | base64 -w0)
307307
EOF
308308
if [[ $(params.airgap) == "true" ]]; then
309309
cat <<EOF >> host-info.yaml
310-
bastion-host: $(cat /opt/host-info/bastion_host | base64 -w0)
311-
bastion-username: $(cat /opt/host-info/bastion_username | base64 -w0)
310+
bastion-host: $(cat /opt/host-info/bastion_host | tr -d '\n\r' | base64 -w0)
311+
bastion-username: $(cat /opt/host-info/bastion_username | tr -d '\n\r' | base64 -w0)
312312
bastion-id_rsa: $(cat /opt/host-info/bastion_id_rsa | base64 -w0)
313313
EOF
314314
fi

0 commit comments

Comments
 (0)