Skip to content

Commit

Permalink
fixing execution
Browse files Browse the repository at this point in the history
Signed-off-by: Rajat <[email protected]>
  • Loading branch information
Rajat0002 committed Dec 13, 2023
1 parent 0316ab1 commit 406cb5f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 20 deletions.
8 changes: 1 addition & 7 deletions community_images/fluent-bit/bitnami/dc_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ CONTAINER_NAME="${PROJECT_NAME}"-fluent-bit-1

# Wait
sleep 10

docker cp "${SCRIPTPATH}"/config/plugins.config "${CONTAINER_NAME}":/opt/bitnami/fluent-bit/conf/plugins.conf
# log for debugging
docker inspect "${CONTAINER_NAME}"
docker cp "${SCRIPTPATH}"/config/plugins.config "${CONTAINER_NAME}":/opt/bitnami/fluent-bit/conf/plugins.conf
sleep 5
docker cp "${SCRIPTPATH}"/config/fluent-bit.config "${CONTAINER_NAME}":/tmp/fluent-bit.config
sleep 10
docker cp "${SCRIPTPATH}"/scripts/fluent-bit_coverage_script.sh "${CONTAINER_NAME}":/tmp/fluent-bit_coverage_script.sh
docker exec -i "${CONTAINER_NAME}" bash -c "bash /tmp/fluent-bit_coverage_script.sh"
2 changes: 1 addition & 1 deletion community_images/fluent-bit/bitnami/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
cap_add:
- SYS_PTRACE
ports:
- '8020:8020'
- '2020:2020'

prometheus:
image: docker.io/rapidfort/prometheus
Expand Down
6 changes: 3 additions & 3 deletions community_images/fluent-bit/bitnami/k8s_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ JSON_PARAMS="$1"
NAMESPACE=$(jq -r '.namespace_name' < "$JSON_PARAMS")
RELEASE_NAME=$(jq -r '.release_name' < "$JSON_PARAMS")

sleep 60
CONTAINER_NAME="${RELEASE_NAME}-0"
sleep 10
CONTAINER_NAME=$(kubectl get pods -n "$NAMESPACE" -l "app.kubernetes.io/instance=$RELEASE_NAME" -o jsonpath='{.items[0].metadata.name}')

kubectl cp "${SCRIPTPATH}"/config/fluent-bit.config "${CONTAINER_NAME}":/tmp/fluent-bit.config -n "${NAMESPACE}"
sleep 10
# copy over the script to the pod
kubectl cp "${SCRIPTPATH}"/scripts/fluent-bit_coverage_script.sh "${CONTAINER_NAME}":/tmp/cvoverage_script.sh -n "${NAMESPACE}"

test_fluent-bit "${CONTAINER_NAME}" "${NAMESPACE}" "yes"
2 changes: 2 additions & 0 deletions community_images/fluent-bit/ironbank/config/plugins.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[PLUGINS]
# Path /path/to/out_gstdout.so
4 changes: 1 addition & 3 deletions community_images/fluent-bit/ironbank/dc_coverage.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@ sleep 10

# log for debugging
docker inspect "${CONTAINER_NAME}"
docker cp "${SCRIPTPATH}"/scripts/fluent-bit_coverage_script.sh "${CONTAINER_NAME}":/tmp/fluent-bit_coverage_script.sh
sleep 10
docker exec -i "${CONTAINER_NAME}" bash -c "bash /tmp/fluent-bit_coverage_script.sh"

4 changes: 1 addition & 3 deletions community_images/fluent-bit/ironbank/docker-compose.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ version: '2'

services:
fluent-bit:
# image: 'registry1.dso.mil/ironbank/opensource/fluent/fluent-bit'
image: ${FLUENT_BIT_IMAGE_REPOSITORY}:${FLUENT_BIT_IMAGE_TAG}
volumes:
- ./scripts/fluent-bit_coverage_script.sh:/tmp/coverage_script.sh

cap_add:
- SYS_PTRACE
ports:
Expand Down
5 changes: 2 additions & 3 deletions community_images/fluent-bit/ironbank/k8s_coverage.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ RELEASE_NAME=$(jq -r '.release_name' < "$JSON_PARAMS")
echo "NAMESPACE: $NAMESPACE"
echo "RELEASE_NAME: $RELEASE_NAME"

sleep 60
CONTAINER_NAME="${RELEASE_NAME}-0"
sleep 10
CONTAINER_NAME=$(kubectl get pods -n "$NAMESPACE" -l "app.kubernetes.io/instance=$RELEASE_NAME" -o jsonpath='{.items[0].metadata.name}')
# copy over the script to the pod
kubectl cp "${SCRIPTPATH}"/config/fluent-bit.config "${CONTAINER_NAME}":/tmp/fluent-bit.config -n "${NAMESPACE}"
sleep 10
kubectl cp "${SCRIPTPATH}"/scripts/fluent-bit_coverage_script.sh "${CONTAINER_NAME}":/tmp/fluent-bit_cvoverage_script.sh -n "${NAMESPACE}"

test_fluent-bit "${CONTAINER_NAME}" "${NAMESPACE}" "yes"

0 comments on commit 406cb5f

Please sign in to comment.