Skip to content

Commit e71e0ec

Browse files
authored
[SECCOMP-31582] - FIPS support
[SECCOMP-31582] - FIPS support
2 parents 0be31e1 + d3e0dc3 commit e71e0ec

File tree

8 files changed

+25
-5
lines changed

8 files changed

+25
-5
lines changed

.circleci/config.yml

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
environment:
3838
DATA_SOURCE_NAME: 'postgresql://postgres:test@localhost:5432/circle_test?sslmode=disable'
3939
GOOPTS: '-v -tags integration'
40+
CGO_ENABLED: 1
41+
GOEXPERIMENT: boringcrypto
4042

4143
steps:
4244
- checkout

.github/workflows/build.yaml

+4-1
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
@@ -38,4 +41,4 @@ jobs:
3841
sysdig_secure_token: ${{ secrets.SYSDIG_SECURE_TOKEN }}
3942
tag_name: dev
4043
target: ${{ matrix.docker }}
41-
repository: us-docker.pkg.dev
44+
repository: us-docker.pkg.dev

.github/workflows/golangci-lint.yml

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ jobs:
1616
golangci:
1717
name: lint
1818
runs-on: ubuntu-latest
19+
env:
20+
CGO_ENABLED: 1
21+
GOEXPERIMENT: boringcrypto
1922
steps:
2023
- name: Checkout repository
2124
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

.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.21
4+
cgo: true
45
repository:
56
path: github.com/prometheus-community/postgres_exporter
67
build:

Dockerfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ WORKDIR /go/src/github.com/prometheus-community/postgres_exporter
88

99
FROM base AS builder
1010
COPY . .
11+
12+
ENV CGO_ENABLED=1
13+
ENV GOEXPERIMENT=boringcrypto
14+
1115
RUN go mod tidy
1216
RUN make build
1317
RUN cp postgres_exporter /bin/postgres_exporter
@@ -22,4 +26,4 @@ FROM quay.io/sysdig/sysdig-stig-mini-ubi9:1.2.0 AS ubi
2226
COPY --from=builder /bin/postgres_exporter /bin/postgres_exporter
2327
EXPOSE 9187
2428
USER 59000:59000
25-
ENTRYPOINT [ "/bin/postgres_exporter" ]
29+
ENTRYPOINT [ "/bin/postgres_exporter" ]

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,21 @@ pipeline {
1111
environment {
1212
registryCredential = 'jenkins-artifactory'
1313
ARTIFACTORY_URL = 'docker.internal.sysdig.com'
14+
CGO_ENABLED = '1'
15+
GOEXPERIMENT = 'boringcrypto'
1416
}
1517

1618
parameters {
1719
booleanParam(name: 'DRY_RUN', defaultValue: true, description: 'Perform a dry run (does not push images)')
1820
string(name: 'EXPORTER', defaultValue: "exporter", description: 'Exporter name')
1921
}
20-
22+
2123
stages {
2224
stage('Pull image from artifactory') {
2325
agent any
2426
steps {
2527
script {
26-
docker.withRegistry("https://${env.ARTIFACTORY_URL}", registryCredential) {
28+
docker.withRegistry("https://${env.ARTIFACTORY_URL}", registryCredential) {
2729
sh """docker pull ${env.ARTIFACTORY_URL}/${env.EXPORTER}:latest"""
2830
env.VERSION = sh(script:"""docker inspect --format '{{ index .Config.Labels "release" }}' ${env.ARTIFACTORY_URL}/${env.EXPORTER}:latest""", returnStdout: true).trim()
2931
echo "VERSION = ${env.VERSION}"
@@ -53,4 +55,4 @@ pipeline {
5355
}
5456
}
5557
} //stages
56-
}
58+
}

cmd/postgres_exporter/main.go

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import (
1919
"os"
2020
"strings"
2121

22+
_ "crypto/tls/fipsonly"
23+
2224
"github.com/alecthomas/kingpin/v2"
2325
"github.com/go-kit/log"
2426
"github.com/go-kit/log/level"

0 commit comments

Comments
 (0)