forked from prometheus/prometheus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OCPBUGS-2873: fix certificate reloads after rotation
When the TLS certificate (used by Prometheus to authenticate to the scraped targets) gets rotated, Prometheus doesn't pick up the new certificate until the connection to the target is re-established. Because Prometheus uses keep-alive HTTP connections, the consequence is that the scrapes start failing after about 1 day and the TargetDown alert fires. There's an upstream pull request [1] to address the issue but it isn't merged yet. This commit pulls the changes from [1] into our downstream fork by adding a replace directive to go.mod for the github.com/prometheus/common. The replacement code is under patches/github.com/prometheus/common which is the same version as upstream (v0.37.0) + the upstream PR applied on top of it. As soon as upstream Prometheus depends on a version of github.com/prometheus/common that fixes the issue, the replace directive in go.mod and the code under the patches/ directory can be removed. [1] prometheus/common#345 Signed-off-by: Simon Pasquier <spasquie@redhat.com>
- Loading branch information
1 parent
c3cbff9
commit 05b3135
Showing
159 changed files
with
17,260 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
patches/github.com/prometheus/common/.circleci/config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
--- | ||
version: 2.1 | ||
|
||
orbs: | ||
go: circleci/go@0.2.0 | ||
|
||
jobs: | ||
test: | ||
parameters: | ||
go_version: | ||
type: string | ||
use_gomod_cache: | ||
type: boolean | ||
default: true | ||
docker: | ||
- image: cimg/go:<< parameters.go_version >> | ||
steps: | ||
- checkout | ||
- when: | ||
condition: << parameters.use_gomod_cache >> | ||
steps: | ||
- go/load-cache: | ||
key: v1-go<< parameters.go_version >> | ||
- run: make test | ||
- run: make -C sigv4 test | ||
- when: | ||
condition: << parameters.use_gomod_cache >> | ||
steps: | ||
- go/save-cache: | ||
key: v1-go<< parameters.go_version >> | ||
- store_test_results: | ||
path: test-results | ||
test-assets: | ||
parameters: | ||
go_version: | ||
type: string | ||
use_gomod_cache: | ||
type: boolean | ||
default: true | ||
docker: | ||
- image: cimg/go:<< parameters.go_version >> | ||
steps: | ||
- checkout | ||
- when: | ||
condition: << parameters.use_gomod_cache >> | ||
steps: | ||
- go/load-cache: | ||
key: v1-go<< parameters.go_version >> | ||
- run: make -C assets test | ||
- when: | ||
condition: << parameters.use_gomod_cache >> | ||
steps: | ||
- go/save-cache: | ||
key: v1-go<< parameters.go_version >> | ||
- store_test_results: | ||
path: test-results | ||
style: | ||
parameters: | ||
go_version: | ||
type: string | ||
use_gomod_cache: | ||
type: boolean | ||
default: true | ||
docker: | ||
- image: cimg/go:<< parameters.go_version >> | ||
steps: | ||
- checkout | ||
- when: | ||
condition: << parameters.use_gomod_cache >> | ||
steps: | ||
- go/load-cache: | ||
key: v1-go<< parameters.go_version >> | ||
- run: make style | ||
- run: make -C sigv4 style | ||
- run: make -C assets style | ||
- when: | ||
condition: << parameters.use_gomod_cache >> | ||
steps: | ||
- go/save-cache: | ||
key: v1-go<< parameters.go_version >> | ||
- store_test_results: | ||
path: test-results | ||
|
||
workflows: | ||
version: 2 | ||
tests: | ||
jobs: | ||
# Supported Go versions are synced with github.com/prometheus/client_golang. | ||
- test: | ||
name: go-<< matrix.go_version >> | ||
matrix: | ||
parameters: | ||
go_version: | ||
- "1.16" | ||
- "1.17" | ||
- "1.18" | ||
- test-assets: | ||
name: assets-go-<< matrix.go_version >> | ||
matrix: | ||
parameters: | ||
go_version: | ||
- "1.18" | ||
- style: | ||
name: style | ||
go_version: "1.18" |
27 changes: 27 additions & 0 deletions
27
patches/github.com/prometheus/common/.github/workflows/golangci-lint.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: golangci-lint | ||
on: | ||
push: | ||
paths: | ||
- "go.sum" | ||
- "go.mod" | ||
- "**.go" | ||
- "scripts/errcheck_excludes.txt" | ||
- ".github/workflows/golangci-lint.yml" | ||
- ".golangci.yml" | ||
pull_request: | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17.x | ||
- name: Lint | ||
uses: golangci/golangci-lint-action@v3.1.0 | ||
with: | ||
version: v1.44.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
extends: default | ||
|
||
rules: | ||
braces: | ||
max-spaces-inside: 1 | ||
level: error | ||
brackets: | ||
max-spaces-inside: 1 | ||
level: error | ||
commas: disable | ||
comments: disable | ||
comments-indentation: disable | ||
document-start: disable | ||
indentation: | ||
spaces: consistent | ||
key-duplicates: | ||
ignore: | | ||
config/testdata/section_key_dup.bad.yml | ||
line-length: disable | ||
truthy: | ||
ignore: | | ||
.github/workflows/codeql-analysis.yml | ||
.github/workflows/funcbench.yml | ||
.github/workflows/fuzzing.yml | ||
.github/workflows/prombench.yml | ||
.github/workflows/golangci-lint.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## Prometheus Community Code of Conduct | ||
|
||
Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Contributing | ||
|
||
Prometheus uses GitHub to manage reviews of pull requests. | ||
|
||
* If you have a trivial fix or improvement, go ahead and create a pull request, | ||
addressing (with `@...`) the maintainer of this repository (see | ||
[MAINTAINERS.md](MAINTAINERS.md)) in the description of the pull request. | ||
|
||
* If you plan to do something more involved, first discuss your ideas | ||
on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers). | ||
This will avoid unnecessary work and surely give you and us a good deal | ||
of inspiration. | ||
|
||
* Relevant coding style guidelines are the [Go Code Review | ||
Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) | ||
and the _Formatting and style_ section of Peter Bourgon's [Go: Best | ||
Practices for Production | ||
Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style). |
Oops, something went wrong.