Skip to content

Mle 21676/HAProxy image can only be define in the subchart values.yaml file #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 26, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import groovy.json.JsonSlurperClassic

emailList = '[email protected], [email protected], [email protected], [email protected], [email protected], [email protected]'
emailSecList = '[email protected], [email protected]'
emailSecList = '[email protected]'
gitCredID = 'marklogic-builder-github'
JIRA_ID = ''
JIRA_ID_PATTERN = /(?i)(MLE)-\d{3,6}/
Expand Down Expand Up @@ -103,7 +103,7 @@ def getReviewState() {
return reviewState
}

void resultNotification(message) {
void resultNotification(status) {
def author, authorEmail, emailList
if (env.CHANGE_AUTHOR) {
author = env.CHANGE_AUTHOR.toString().trim().toLowerCase()
Expand All @@ -117,11 +117,11 @@ void resultNotification(message) {
jira_email_body = "${email_body} <br><br><b>Jira URL: </b><br><a href='${jira_link}'>${jira_link}</a>"

if (JIRA_ID) {
def comment = [ body: "Jenkins pipeline build result: ${message}" ]
def comment = [ body: "Jenkins pipeline build result: ${status}" ]
jiraAddComment site: 'JIRA', idOrKey: JIRA_ID, failOnError: false, input: comment
mail charset: 'UTF-8', mimeType: 'text/html', to: "${emailList}", body: "${jira_email_body}", subject: "${message}: ${env.JOB_NAME} #${env.BUILD_NUMBER} - ${JIRA_ID}"
mail charset: 'UTF-8', mimeType: 'text/html', to: "${emailList}", body: "${jira_email_body}", subject: "🥷 ${status}: ${env.JOB_NAME} #${env.BUILD_NUMBER} - ${JIRA_ID}"
} else {
mail charset: 'UTF-8', mimeType: 'text/html', to: "${emailList}", body: "${email_body}", subject: "${message}: ${env.JOB_NAME} #${env.BUILD_NUMBER}"
mail charset: 'UTF-8', mimeType: 'text/html', to: "${emailList}", body: "${email_body}", subject: "🥷 ${status}: ${env.JOB_NAME} #${env.BUILD_NUMBER}"
}
}

Expand All @@ -147,6 +147,11 @@ void imageScan() {
}

sh '''rm -f dep-image-scan.txt'''

// trigger BlackDuck scan
def rawImageList = readFile(file: 'helm_image.list').trim()
def imageList = rawImageList.endsWith(',') ? rawImageList[0..-2] : rawImageList
build job: 'securityscans/Blackduck/KubeNinjas/kubernetes-helm', wait: false, parameters: [ string(name: 'branch', value: "${env.BRANCH_NAME}"), string(name: 'CONTAINER_IMAGES', value: "${imageList}") ]
}

void publishTestResults() {
Expand Down Expand Up @@ -261,13 +266,16 @@ pipeline {
sh "rm -rf $WORKSPACE/test/test_results/"
}
success {
resultNotification('BUILD SUCCESS ✅')
resultNotification('✅ Success')
}
failure {
resultNotification('BUILD ERROR ❌')
resultNotification('❌ Failure')
}
unstable {
resultNotification('BUILD UNSTABLE ❌')
resultNotification('⚠️ Unstable')
}
aborted {
resultNotification('🚫 Aborted')
}
}
}
4 changes: 4 additions & 0 deletions charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ logCollection:
## It also support multi-statement transaction and ODBC connections.
haproxy:
enabled: false
Copy link
Preview

Copilot AI May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a comment block describing the purpose and acceptable values for the new image keys (repository, tag, pullPolicy) so that users understand how to override them.

Suggested change
enabled: false
enabled: false
## Configuration for the HAProxy container image
## repository: The container image repository for HAProxy. Default is "haproxytech/haproxy-alpine".
## tag: The specific version of the HAProxy image to use. Default is "2.9.4".
## pullPolicy: The image pull policy. Acceptable values are "Always", "IfNotPresent", and "Never". Default is "IfNotPresent".

Copilot uses AI. Check for mistakes.

image:
repository: haproxytech/haproxy-alpine
tag: "2.9.4"
pullPolicy: IfNotPresent
Comment on lines +353 to +354
Copy link
Preview

Copilot AI May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using a specific image tag is fine, but consider documenting or automating tag updates (e.g., via Dependabot or a chart version matrix) to avoid stale versions.

Suggested change
tag: "2.9.4"
pullPolicy: IfNotPresent
tag: "{{ .Values.haproxy.image.tag }}"
pullPolicy: IfNotPresent
# Consider automating updates using Dependabot or a version matrix.

Copilot uses AI. Check for mistakes.


## Name of an existing configmap with configuration for HAProxy
existingConfigmap: marklogic-haproxy
Expand Down
2 changes: 2 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,10 @@ upgrade-test: prepare
.PHONY: image-scan
image-scan:

@rm -f helm_image.list dep-image-scan.txt
@echo "=====Scan dependent Docker images in charts/values.yaml" $(if $(saveOutput), | tee -a dep-image-scan.txt,)
@for depImage in $(shell grep -E "^\s*\bimage:\s+(.*)" charts/values.yaml | sed 's/image: //g' | sed 's/"//g'); do\
echo -n "$${depImage}," >> helm_image.list ; \
echo "= $${depImage}:" $(if $(saveOutput), | tee -a dep-image-scan.txt,) ; \
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock anchore/grype:latest --output json $${depImage} | jq -r '[(.matches[] | [.artifact.name, .artifact.version, .vulnerability.id, .vulnerability.severity])] | .[] | @tsv' | sort -k4 | column -t $(if $(saveOutput), | tee -a dep-image-scan.txt,);\
echo $(if $(saveOutput), | tee -a dep-image-scan.txt,) ;\
Expand Down