Skip to content

Commit

Permalink
Tweaks to support (internal-use-only) omit image keys flag
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmith-sas committed Jan 8, 2025
1 parent 7f49b6c commit 7094266
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,11 @@ function generateImageKeysFile {

#arg1 Full container image
#arg2 name of template file
#arg3 prefix to insert in placeholders (optional)
#arg3 prefix to insert in placeholders (optional; defaults to "")
#arg4 flag to override omit_image_key logic (optional; defaults to "false")

#NOTE: arg4 is required to handle 2 initContainers (for OpenSearch and Fluent Bit)
# for which the template file contains settings other than image specs

local pullsecret_text

Expand All @@ -299,6 +303,7 @@ function generateImageKeysFile {
fi

prefix=${3:-""}
ignoreOmitImageKeys=${4:-"false"}

imageKeysFile="$TMP_DIR/imageKeysFile.yaml"
template_file=$2
Expand All @@ -310,7 +315,7 @@ function generateImageKeysFile {
log_debug "Modifying an existing imageKeysFile"
fi

if [ "$V4M_OMIT_IMAGE_KEYS" == "true" ]; then
if [ "$V4M_OMIT_IMAGE_KEYS" == "true" ] && [ "$ignoreOmitImageKeys" != "true" ]; then
cp $TMP_DIR/empty.yaml $imageKeysFile
return 0
fi
Expand Down
2 changes: 1 addition & 1 deletion logging/bin/deploy_fluentbit_azmonitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ log_info "Deploying Fluent Bit (Azure Monitor)"

#Generate yaml file with all container-related keys#Generate yaml file with all container-related keys
generateImageKeysFile "$FB_FULL_IMAGE" "logging/fb/fb_container_image.template"
generateImageKeysFile "$FB_INITCONTAINER_FULL_IMAGE" "logging/fb/fb_initcontainer_image.template"
generateImageKeysFile "$FB_INITCONTAINER_FULL_IMAGE" "logging/fb/fb_initcontainer_image.template" "" "true"

# Fluent Bit user customizations
FB_AZMONITOR_USER_YAML="${FB_AZMONITOR_USER_YAML:-$USER_DIR/logging/user-values-fluent-bit-azmonitor.yaml}"
Expand Down
2 changes: 1 addition & 1 deletion logging/bin/deploy_fluentbit_opensearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fi

#Generate yaml file with all container-related keys
generateImageKeysFile "$FB_FULL_IMAGE" "logging/fb/fb_container_image.template"
generateImageKeysFile "$FB_INITCONTAINER_FULL_IMAGE" "logging/fb/fb_initcontainer_image.template"
generateImageKeysFile "$FB_INITCONTAINER_FULL_IMAGE" "logging/fb/fb_initcontainer_image.template" "" "true"

# Fluent Bit user customizations
FB_OPENSEARCH_USER_YAML="${FB_OPENSEARCH_USER_YAML:-$USER_DIR/logging/user-values-fluent-bit-opensearch.yaml}"
Expand Down
2 changes: 1 addition & 1 deletion logging/bin/deploy_opensearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fi
#Generate yaml files with all container-related keys
generateImageKeysFile "$OS_FULL_IMAGE" "logging/opensearch/os_container_image.template"
generateImageKeysFile "$OS_SYSCTL_FULL_IMAGE" "$imageKeysFile" "OS_SYSCTL_"
generateImageKeysFile "$OS_FULL_IMAGE" "logging/opensearch/os_initcontainer_image.template"
generateImageKeysFile "$OS_FULL_IMAGE" "logging/opensearch/os_initcontainer_image.template" "" "true"

# get credentials
export ES_ADMIN_PASSWD=${ES_ADMIN_PASSWD}
Expand Down

0 comments on commit 7094266

Please sign in to comment.