Skip to content

Commit 1e119a0

Browse files
Fix shellcheck warnings
1 parent 01c34dc commit 1e119a0

3 files changed

Lines changed: 18 additions & 16 deletions

File tree

rust/operator-binary/src/controller/build/role_group_builder.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -666,13 +666,10 @@ cp --archive config/opensearch.keystore {OPENSEARCH_INITIALIZED_KEYSTORE_DIRECTO
666666
.expect("should be a valid container name"),
667667
)
668668
.image_from_product_image(&self.cluster.image)
669-
.command(vec![
670-
"/bin/bash".to_string(),
671-
"-euo".to_string(),
672-
"pipefail".to_string(),
673-
"-c".to_string(),
669+
.command(vec!["/bin/bash".to_string(), "-c".to_string()])
670+
.args(vec![
671+
include_str!("scripts/create-admin-certificate.sh").to_owned(),
674672
])
675-
.args(vec![include_str!("create-admin-certificate.sh").to_owned()])
676673
.add_env_vars(env_vars.into())
677674
.add_volume_mounts(volume_mounts)
678675
.expect("The mount paths are statically defined and there should be no duplicates.")
@@ -754,13 +751,10 @@ cp --archive config/opensearch.keystore {OPENSEARCH_INITIALIZED_KEYSTORE_DIRECTO
754751

755752
new_container_builder(&v1alpha1::Container::UpdateSecurityConfig.to_container_name())
756753
.image_from_product_image(&self.cluster.image)
757-
.command(vec![
758-
"/bin/bash".to_string(),
759-
"-uo".to_string(),
760-
"pipefail".to_string(),
761-
"-c".to_string(),
754+
.command(vec!["/bin/bash".to_string(), "-c".to_string()])
755+
.args(vec![
756+
include_str!("scripts/update-security-config.sh").to_owned(),
762757
])
763-
.args(vec![include_str!("update-security-config.sh").to_owned()])
764758
.add_env_vars(env_vars.into())
765759
.add_volume_mounts(volume_mounts)
766760
.expect("The mount paths are statically defined and there should be no duplicates.")

rust/operator-binary/src/controller/build/create-admin-certificate.sh renamed to rust/operator-binary/src/controller/build/scripts/create-admin-certificate.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
set -e -u -o pipefail
4+
15
function log () {
26
level="$1"
37
message="$2"
@@ -7,7 +11,7 @@ function log () {
711
}
812

913
function info () {
10-
message="$@"
14+
message="$*"
1115

1216
log INFO "$message"
1317
}
@@ -39,7 +43,7 @@ function create_admin_certificate () {
3943
openssl req \
4044
-x509 \
4145
-nodes \
42-
-subj=/$ADMIN_DN \
46+
-subj=/"$ADMIN_DN" \
4347
-out=/stackable/tls-admin-cert/tls.crt \
4448
-keyout=/stackable/tls-admin-cert/tls.key
4549
}

rust/operator-binary/src/controller/build/update-security-config.sh renamed to rust/operator-binary/src/controller/build/scripts/update-security-config.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
set -u -o pipefail
4+
15
function log () {
26
level="$1"
37
message="$2"
@@ -7,7 +11,7 @@ function log () {
711
}
812

913
function info () {
10-
message="$@"
14+
message="$*"
1115

1216
log INFO "$message"
1317
}
@@ -33,7 +37,7 @@ function wait_seconds () {
3337
mkdir --parents /stackable/log/_vector
3438
inotifywait \
3539
--quiet --quiet \
36-
--timeout $seconds \
40+
--timeout "$seconds" \
3741
--event create \
3842
/stackable/log/_vector
3943
fi

0 commit comments

Comments
 (0)