Skip to content

Commit 9a2529a

Browse files
committed
[SECCOMP-31580] FIPS suport
1 parent c29e860 commit 9a2529a

File tree

7 files changed

+20
-3
lines changed

7 files changed

+20
-3
lines changed

.github/workflows/build.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
docker: ['scratch','ubi']
2222
# The type of runner that the job will run on
2323
runs-on: ubuntu-latest
24+
env:
25+
CGO_ENABLED: 1
26+
GOEXPERIMENT: boringcrypto
2427
name: ${{ matrix.docker }}
2528
steps:
2629
- name: Login to Quay.io

.github/workflows/golangci-lint.yml

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414
golangci:
1515
name: lint
1616
runs-on: ubuntu-latest
17+
env:
18+
CGO_ENABLED: 1
19+
GOEXPERIMENT: boringcrypto
1720
steps:
1821
- name: Checkout repository
1922
uses: actions/checkout@v3

.promu.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
go:
22
# This must match .circle/config.yml.
33
version: 1.18
4+
cgo: true
45
repository:
56
path: github.com/prometheus-community/elasticsearch_exporter
67
build:

Dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM quay.io/prometheus/golang-builder AS builder
22

3+
ENV CGO_ENABLED=1
4+
ENV GOEXPERIMENT=boringcrypto
5+
36
ARG PROMU_VERSION=0.13.0
47
ADD https://github.com/prometheus/promu/releases/download/v${PROMU_VERSION}/promu-${PROMU_VERSION}.linux-amd64.tar.gz ./
58
RUN tar -xvzf promu-${PROMU_VERSION}.linux-amd64.tar.gz && mv promu-${PROMU_VERSION}.linux-amd64/promu /go/bin
@@ -8,7 +11,7 @@ ADD . /go/src/github.com/prometheus-community/elasticsearch_exporter
811
WORKDIR /go/src/github.com/prometheus-community/elasticsearch_exporter
912

1013
RUN go mod download
11-
RUN make
14+
RUN make
1215

1316
FROM scratch AS scratch
1417

Makefile.common

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ GO_VERSION ?= $(shell $(GO) version)
3636
GO_VERSION_NUMBER ?= $(word 3, $(GO_VERSION))
3737
PRE_GO_111 ?= $(shell echo $(GO_VERSION_NUMBER) | grep -E 'go1\.(10|[0-9])\.')
3838

39+
export CGO_ENABLED := 1
40+
export GOEXPERIMENT := boringcrypto
41+
3942
PROMU := $(FIRST_GOPATH)/bin/promu
4043
pkgs = ./...
4144

build/Jenkinsfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ pipeline {
1212
ARTIFACTORY_URL = 'docker.internal.sysdig.com'
1313
EXPORTER = 'elasticsearch-exporter'
1414
VERSION = '1.2.1'
15+
CGO_ENABLED = '1'
16+
GOEXPERIMENT = 'boringcrypto'
1517
}
1618

1719
stages {
1820
stage('Pull image from artifactory') {
1921
steps {
2022
script {
21-
docker.withRegistry("https://${env.ARTIFACTORY_URL}", registryCredential) {
23+
docker.withRegistry("https://${env.ARTIFACTORY_URL}", registryCredential) {
2224
sh """docker pull ${env.ARTIFACTORY_URL}/${env.EXPORTER}:${env.VERSION}"""
2325
sh """docker pull ${env.ARTIFACTORY_URL}/${env.EXPORTER}:${env.VERSION}-ubi"""
2426
}
@@ -40,4 +42,4 @@ pipeline {
4042
}
4143
}
4244
}
43-
}
45+
}

main.go

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import (
2323

2424
"context"
2525

26+
_ "crypto/tls/fipsonly"
27+
2628
"github.com/go-kit/log/level"
2729
"github.com/prometheus-community/elasticsearch_exporter/collector"
2830
"github.com/prometheus-community/elasticsearch_exporter/pkg/clusterinfo"

0 commit comments

Comments
 (0)