Skip to content

Commit

Permalink
Merge tag 'refs/tags/v1.8.2' into PMM-12116-update-from-upstream
Browse files Browse the repository at this point in the history
v1.8.2

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEoFiTUofnXYMugU5GxkayPJ4yRfEFAmaTvA0ACgkQxkayPJ4y
# RfFwLA//Scg51x8eagp8Cfr8jDbd4+cJiaoxPzzLejgRUr3iGXJcLojhPQjYom3V
# GbXSzdW3N1+Dy97aJaUFxBDhBoIWq3OO3qJo5oTntaOeCD3CVjTEmV5DXBgMZWyz
# V2wvle09fTLeCwXYFpfMgrI/3dkwEmqj5giV71YNMxg4Iy90x8Yx0HKIigBBRBnk
# oQoii30bky5qKZ2QN0Nv70ot0OdiupA977KzckC7Ep+uEOkvbjU//bqcxXZ94RBA
# 8l+vCkdLX7Rv/Y258zPDiy1FWQds9VpcvabvbL11cS6O0Dx7sv+ijtpdOTXrg+0n
# Yd+1inNbz04GANWfxwzCVwccT51OBkKWf7r/fa/Nw8/U8R+zOEtVPz5xB556w0ch
# NpMmQPY8hp4KAQpxyaCPjXVmMwOiKXq8m9xJ3XVCzVl2Z5ur9r9kfpGtPz0CkBO5
# DCZh1IBrLuLmN3FgYFTqI2gVzxsKO5GY5Q7N7uUmeN0RRARJZutTHZzDX0AKzfhT
# P4uyjR/T0JM5oYQGE1N5uMpsCpm40n78lD2tYHENKKHuP6J6TGB5J9YfKTXojPHt
# jG+4JIHDsnPHXDdWv7UYva/6RaLhi3rck+VOL9cc6zrNNDz+6+ATBDO0tlCQFaRa
# xGBio0mn9/L50Ov4kFGyrr9HwdUH/xCkqTUOTh7j1syBjaMmViw=
# =vEy9
# -----END PGP SIGNATURE-----
# gpg: Signature made Sun Jul 14 17:52:45 2024 +06
# gpg:                using RSA key A058935287E75D832E814E46C646B23C9E3245F1
# gpg: Can't check signature: No public key

# Conflicts:
#	go.mod
#	go.sum
#	node_exporter.go
  • Loading branch information
BupycHuk committed Aug 19, 2024
2 parents f0aecfa + f1e0e83 commit 65a733e
Show file tree
Hide file tree
Showing 135 changed files with 4,123 additions and 1,444 deletions.
35 changes: 17 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
version: 2.1
orbs:
prometheus: prometheus/prometheus@0.16.0
prometheus: prometheus/prometheus@0.17.1
executors:
# Whenever the Go version is updated here, .promu.yml and .promu-cgo.yml
# should also be updated.
golang:
docker:
- image: cimg/go:1.19
- image: cimg/go:1.22
arm:
machine:
image: ubuntu-2004:current
image: ubuntu-2204:current
resource_class: arm.medium

jobs:
Expand All @@ -28,13 +28,6 @@ jobs:
- checkout
- run: uname -a
- run: make test-e2e
codespell:
docker:
- image: circleci/python
steps:
- checkout
- run: sudo pip install codespell
- run: codespell --skip=".git,./vendor,ttar,go.mod,go.sum,*pem,./collector/fixtures" -I scripts/codespell_ignore.txt
test_mixins:
executor: golang
steps:
Expand All @@ -49,13 +42,23 @@ jobs:
- run: git diff --exit-code
build:
machine:
image: ubuntu-2004:202101-01
image: ubuntu-2204:current
parallelism: 3
steps:
- prometheus/setup_environment
- run: docker run --privileged linuxkit/binfmt:v0.8
- run: docker run --privileged linuxkit/binfmt:af88a591f9cc896a52ce596b9cf7ca26a061ef97
- run: promu crossbuild -v --parallelism $CIRCLE_NODE_TOTAL --parallelism-thread $CIRCLE_NODE_INDEX
- run: promu --config .promu-cgo.yml crossbuild -v --parallelism $CIRCLE_NODE_TOTAL --parallelism-thread $CIRCLE_NODE_INDEX
# sign the darwin build so it doesn't get SIGKILLed on start, see: https://github.com/prometheus/node_exporter/issues/2539
- run:
command: |
if [[ -f "$(pwd)/.build/darwin-arm64/node_exporter" ]]; then
promu codesign "$(pwd)/.build/darwin-arm64/node_exporter"
fi
if [[ -f "$(pwd)/.build/darwin-amd64/node_exporter" ]]; then
promu codesign "$(pwd)/.build/darwin-amd64/node_exporter"
fi
- persist_to_workspace:
root: .
paths:
Expand All @@ -65,9 +68,9 @@ jobs:
destination: /build
test_docker:
machine:
image: ubuntu-2204:2022.04.2
image: ubuntu-2204:current
environment:
DOCKER_TEST_IMAGE_NAME: quay.io/prometheus/golang-builder:1.18-base
DOCKER_TEST_IMAGE_NAME: quay.io/prometheus/golang-builder:1.22-base
REPO_PATH: github.com/prometheus/node_exporter
steps:
- prometheus/setup_environment
Expand Down Expand Up @@ -105,10 +108,6 @@ workflows:
filters:
tags:
only: /.*/
- codespell:
filters:
tags:
only: /.*/
- test_docker:
requires:
- test
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Before filing a bug report, note that running node_exporter in Docker is
not recommended, for the reasons detailed in the README:
https://github.com/prometheus/node_exporter#using-docker
https://github.com/prometheus/node_exporter#docker
Finally, also note that node_exporter is focused on *NIX kernels, and the
WMI exporter should be used instead on Windows.
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/container_description.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: Push README to Docker Hub
on:
push:
paths:
- "README.md"
- ".github/workflows/container_description.yml"
branches: [ main, master ]

permissions:
contents: read

jobs:
PushDockerHubReadme:
runs-on: ubuntu-latest
name: Push README to Docker Hub
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
steps:
- name: git checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Set docker hub repo name
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
- name: Push README to Dockerhub
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
env:
DOCKER_USER: ${{ secrets.DOCKER_HUB_LOGIN }}
DOCKER_PASS: ${{ secrets.DOCKER_HUB_PASSWORD }}
with:
destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
provider: dockerhub
short_description: ${{ env.DOCKER_REPO_NAME }}
readme_file: 'README.md'

PushQuayIoReadme:
runs-on: ubuntu-latest
name: Push README to quay.io
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
steps:
- name: git checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Set quay.io org name
run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV
- name: Set quay.io repo name
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
- name: Push README to quay.io
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
env:
DOCKER_APIKEY: ${{ secrets.QUAY_IO_API_TOKEN }}
with:
destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
provider: quay
readme_file: 'README.md'
18 changes: 13 additions & 5 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
# This action is synced from https://github.com/prometheus/prometheus
name: golangci-lint
on:
push:
Expand All @@ -10,21 +12,27 @@ on:
- ".golangci.yml"
pull_request:

permissions: # added using https://github.com/step-security/secure-repo
contents: read

jobs:
golangci:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: install Go
uses: actions/setup-go@v2
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.18.x
go-version: 1.22.x
- name: Install snmp_exporter/generator dependencies
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
if: github.repository == 'prometheus/snmp_exporter'
- name: Lint
uses: golangci/golangci-lint-action@v3.2.0
uses: golangci/golangci-lint-action@9d1e0624a798bb64f6c3cea93db47765312263dc # v5.1.0
with:
version: v1.45.2
version: v1.56.2
22 changes: 21 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
linters:
enable:
- depguard
- misspell
- revive
disable:
# Disable soon to deprecated[1] linters that lead to false
Expand All @@ -18,5 +20,23 @@ issues:
- errcheck

linters-settings:
depguard:
rules:
no_exec_policy:
files:
- "!$test"
deny:
- pkg: "os/exec"
desc: "Using os/exec to run sub processes it not allowed by policy"
errcheck:
exclude: scripts/errcheck_excludes.txt
exclude-functions:
# Used in HTTP handlers, any error is handled by the server itself.
- (net/http.ResponseWriter).Write
# Never check for logger errors.
- (github.com/go-kit/log.Logger).Log
revive:
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
- name: unused-parameter
severity: warning
disabled: true
3 changes: 1 addition & 2 deletions .promu-cgo.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
go:
# Whenever the Go version is updated here, .circle/config.yml and
# .promu.yml should also be updated.
version: 1.19
version: 1.22
cgo: true
repository:
path: github.com/prometheus/node_exporter
build:
binaries:
- name: node_exporter
flags: -a -tags 'netgo osusergo static_build'
ldflags: |
-X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
Expand Down
3 changes: 1 addition & 2 deletions .promu.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
go:
# Whenever the Go version is updated here, .circle/config.yml and
# .promu-cgo.yml should also be updated.
version: 1.19
version: 1.22
repository:
path: github.com/prometheus/node_exporter
build:
binaries:
- name: node_exporter
flags: -a -tags 'netgo osusergo static_build'
ldflags: |
-X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
Expand Down
9 changes: 3 additions & 6 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
extends: default
ignore: |
ui/react-app/node_modules

rules:
braces:
Expand All @@ -20,9 +22,4 @@ rules:
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
check-keys: false
Loading

0 comments on commit 65a733e

Please sign in to comment.