Skip to content

Commit 0e4ca6b

Browse files
committed
Merge remote-tracking branch 'google/master' into avoid_scanning
2 parents 5814a54 + 89f779d commit 0e4ca6b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+982
-442
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@ jobs:
44
test:
55
strategy:
66
matrix:
7-
go-versions: ['1.20', '1.19']
8-
platform: [ubuntu-20.04]
7+
go-versions: ['1.22', '1.21']
8+
platform: [ubuntu-22.04]
99
environment-variables: [build/config/plain.sh, build/config/libpfm4.sh, build/config/libipmctl.sh]
1010
runs-on: ${{ matrix.platform }}
1111
timeout-minutes: 30
1212
steps:
1313
- name: Install Go
14-
uses: actions/setup-go@v2
14+
uses: actions/setup-go@v5
1515
with:
1616
go-version: ${{ matrix.go-versions }}
17+
check-latest: true
1718
- name: Checkout code
18-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
1920
- name: Run presubmit checks
2021
run: |
2122
source ${{ matrix.environment-variables }}
@@ -30,14 +31,14 @@ jobs:
3031
test-integration:
3132
strategy:
3233
matrix:
33-
go-versions: ['1.20', '1.19']
34-
platform: [ubuntu-20.04]
34+
go-versions: ['1.22', '1.21']
35+
platform: [ubuntu-22.04]
3536
environment-variables: [build/config/plain.sh, build/config/libpfm4.sh, build/config/libipmctl.sh]
3637
runs-on: ${{ matrix.platform }}
3738
timeout-minutes: 30
3839
steps:
3940
- name: Checkout code
40-
uses: actions/checkout@v2
41+
uses: actions/checkout@v4
4142
- name: Run integration tests
4243
env:
4344
GOLANG_VERSION: ${{ matrix.go-versions }}
@@ -46,7 +47,7 @@ jobs:
4647
source ${{ matrix.environment-variables }}
4748
make docker-test-integration
4849
- name: Upload cAdvisor log file
49-
uses: actions/upload-artifact@v1
50+
uses: actions/upload-artifact@v4
5051
if: failure()
5152
with:
5253
name: cadvisor.log

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
GO := go
16-
GOLANGCI_VER := v1.51.2
16+
GOLANGCI_VER := v1.56.2
1717
GO_TEST ?= $(GO) test $(or $(GO_FLAGS),-race)
1818
arch ?= $(shell go env GOARCH)
1919

@@ -72,7 +72,7 @@ docker-%:
7272
@docker build -t cadvisor:$(shell git rev-parse --short HEAD) -f deploy/Dockerfile .
7373

7474
docker-build:
75-
@docker run --rm -w /go/src/github.com/google/cadvisor -v ${PWD}:/go/src/github.com/google/cadvisor golang:1.20 make build
75+
@docker run --rm -w /go/src/github.com/google/cadvisor -v ${PWD}:/go/src/github.com/google/cadvisor golang:1.22 make build
7676

7777
presubmit: lint
7878
@echo ">> checking go mod tidy"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ cAdvisor has native support for [Docker](https://github.com/docker/docker) conta
1111
To quickly tryout cAdvisor on your machine with Docker, we have a Docker image that includes everything you need to get started. You can run a single cAdvisor to monitor the whole machine. Simply run:
1212

1313
```
14-
VERSION=v0.36.0 # use the latest release version from https://github.com/google/cadvisor/releases
14+
VERSION=v0.49.1 # use the latest release version from https://github.com/google/cadvisor/releases
1515
sudo docker run \
1616
--volume=/:/rootfs:ro \
1717
--volume=/var/run:/var/run:ro \

build/check_container.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
target_image=$1
2929

3030
# Architectures officially supported by cadvisor
31-
arches=( "amd64" "arm" "arm64" "s390x" )
31+
arches=( "amd64" "arm" "arm64" )
3232

3333
# Docker doesn't handle images with different architectures but the same tag.
3434
# Remove the container and the image use by it to avoid problems.

build/config/libipmctl.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
# limitations under the License.
1414

1515
export GO_FLAGS="-tags=libipmctl,cgo -race"
16-
export PACKAGES="sudo libipmctl4"
17-
export BUILD_PACKAGES="libipmctl4 libipmctl-dev"
16+
export PACKAGES="sudo libipmctl5"
17+
export BUILD_PACKAGES="libipmctl5 libipmctl-dev"
1818
export CADVISOR_ARGS="-perf_events_config=perf/testing/perf-non-hardware.json"

build/integration-in-docker.sh

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ function run_tests() {
3636
env GOOS=linux GOFLAGS='$GO_FLAGS' go test -c github.com/google/cadvisor/integration/tests/healthz"
3737

3838
if [ "$BUILD_PACKAGES" != "" ]; then
39-
BUILD_CMD="echo 'deb http://deb.debian.org/debian buster-backports main'>/etc/apt/sources.list.d/buster.list && \
40-
apt update && \
41-
apt install -y -t buster-backports $BUILD_PACKAGES && \
39+
BUILD_CMD="apt update && apt install -y $BUILD_PACKAGES && \
4240
$BUILD_CMD"
4341
fi
4442
docker run --rm \
4543
-w /go/src/github.com/google/cadvisor \
4644
-v ${PWD}:/go/src/github.com/google/cadvisor \
47-
golang:"$GOLANG_VERSION-buster" \
45+
golang:"$GOLANG_VERSION-bookworm" \
4846
bash -c "$BUILD_CMD"
4947

5048
EXTRA_DOCKER_OPTS="-e DOCKER_IN_DOCKER_ENABLED=true"
@@ -60,17 +58,16 @@ function run_tests() {
6058
--privileged \
6159
--cap-add="sys_admin" \
6260
--entrypoint="" \
63-
gcr.io/k8s-testimages/bootstrap \
64-
bash -c "echo 'deb http://deb.debian.org/debian buster-backports main'>/etc/apt/sources.list.d/buster.list && \
65-
cat /etc/apt/sources.list.d/buster.list && \
61+
gcr.io/k8s-staging-test-infra/bootstrap \
62+
bash -c "export DEBIAN_FRONTEND=noninteractive && \
6663
apt update && \
67-
apt install -y -t buster-backports $PACKAGES && \
68-
CADVISOR_ARGS="$CADVISOR_ARGS" /usr/local/bin/runner.sh build/integration.sh"
64+
apt install -y $PACKAGES && \
65+
CADVISOR_ARGS=$CADVISOR_ARGS /usr/local/bin/runner.sh build/integration.sh"
6966
}
7067

7168
GO_FLAGS=${GO_FLAGS:-"-tags=netgo -race"}
7269
PACKAGES=${PACKAGES:-"sudo"}
7370
BUILD_PACKAGES=${BUILD_PACKAGES:-}
7471
CADVISOR_ARGS=${CADVISOR_ARGS:-}
75-
GOLANG_VERSION=${GOLANG_VERSION:-"1.20"}
72+
GOLANG_VERSION=${GOLANG_VERSION:-"1.22"}
7673
run_tests "$GO_FLAGS" "$PACKAGES" "$BUILD_PACKAGES" "$CADVISOR_ARGS"

build/release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ docker buildx inspect cadvisor-builder > /dev/null \
5555
# Build binaries
5656

5757
# A mapping of the docker arch name to the qemu arch name
58-
declare -A arches=( ["amd64"]="x86_64" ["arm"]="arm" ["arm64"]="aarch64" ["s390x"]="s390x")
58+
declare -A arches=( ["amd64"]="x86_64" ["arm"]="arm" ["arm64"]="aarch64" )
5959

6060
for arch in "${arches[@]}"; do
6161
if ! hash "qemu-${arch}-static"; then
@@ -71,7 +71,7 @@ done
7171
for arch in "${!arches[@]}"; do
7272
GOARCH="$arch" GO_CGO_ENABLED="0" OUTPUT_NAME_WITH_ARCH="true" build/build.sh
7373
arch_specific_image="${image_name}-${arch}:${VERSION}"
74-
docker buildx build --platform "linux/${arch}" --build-arg VERSION="$VERSION" -f deploy/Dockerfile -t "$arch_specific_image" --progress plain --push .
74+
docker buildx build --platform "linux/${arch}" --provenance=false --build-arg VERSION="$VERSION" -f deploy/Dockerfile -t "$arch_specific_image" --progress plain --push .
7575
docker manifest create --amend "$final_image" "$arch_specific_image"
7676
docker manifest annotate --os=linux --arch="$arch" "$final_image" "$arch_specific_image"
7777
done

build/unit-in-container.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ function run_tests() {
4040

4141
GO_FLAGS=${GO_FLAGS:-"-tags=netgo -race"}
4242
BUILD_PACKAGES=${BUILD_PACKAGES:-}
43-
GOLANG_VERSION=${GOLANG_VERSION:-"1.20"}
43+
GOLANG_VERSION=${GOLANG_VERSION:-"1.22"}
4444
run_tests

cmd/cadvisor.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,13 @@ func init() {
100100
optstr := container.AllMetrics.String()
101101
flag.Var(&ignoreMetrics, "disable_metrics", fmt.Sprintf("comma-separated list of `metrics` to be disabled. Options are %s.", optstr))
102102
flag.Var(&enableMetrics, "enable_metrics", fmt.Sprintf("comma-separated list of `metrics` to be enabled. If set, overrides 'disable_metrics'. Options are %s.", optstr))
103-
104-
// Default logging verbosity to V(2)
105-
_ = flag.Set("v", "2")
106103
}
107104

108105
func main() {
109106
klog.InitFlags(nil)
110107
defer klog.Flush()
108+
// Default logging verbosity to V(2)
109+
_ = flag.Set("v", "2")
111110
flag.Parse()
112111

113112
if *versionFlag {

cmd/go.mod

Lines changed: 45 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/google/cadvisor/cmd
22

3-
go 1.19
3+
go 1.21
44

55
// Record that the cmd module requires the cadvisor library module.
66
// The github.com/google/cadvisor/cmd module is built using the Makefile
@@ -23,47 +23,51 @@ require (
2323
github.com/onsi/gomega v1.24.1 // indirect
2424
github.com/pquerna/ffjson v0.0.0-20190930134022-aa0246cd15f7 // indirect
2525
github.com/prometheus/client_golang v1.14.0
26-
github.com/stretchr/testify v1.8.2
27-
golang.org/x/oauth2 v0.4.0
28-
google.golang.org/api v0.104.0
26+
github.com/stretchr/testify v1.9.0
27+
golang.org/x/oauth2 v0.18.0
28+
google.golang.org/api v0.169.0
2929
gopkg.in/olivere/elastic.v2 v2.0.61
3030
k8s.io/klog/v2 v2.100.1
3131
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
3232
)
3333

3434
require (
35-
cloud.google.com/go/compute v1.15.1 // indirect
35+
cloud.google.com/go/compute v1.25.1 // indirect
3636
cloud.google.com/go/compute/metadata v0.2.3 // indirect
3737
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
38-
github.com/Microsoft/go-winio v0.4.15 // indirect
38+
github.com/Microsoft/go-winio v0.6.2 // indirect
3939
github.com/aws/aws-sdk-go v1.35.24 // indirect
4040
github.com/beorn7/perks v1.0.1 // indirect
4141
github.com/blang/semver/v4 v4.0.0 // indirect
42+
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
4243
github.com/cespare/xxhash/v2 v2.2.0 // indirect
4344
github.com/checkpoint-restore/go-criu/v5 v5.3.0 // indirect
4445
github.com/cilium/ebpf v0.7.0 // indirect
4546
github.com/containerd/console v1.0.3 // indirect
46-
github.com/containerd/ttrpc v1.2.2 // indirect
47+
github.com/containerd/ttrpc v1.2.4 // indirect
4748
github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534 // indirect
48-
github.com/cyphar/filepath-securejoin v0.2.3 // indirect
49+
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
4950
github.com/davecgh/go-spew v1.1.1 // indirect
50-
github.com/docker/distribution v2.8.1+incompatible // indirect
51-
github.com/docker/docker v20.10.21+incompatible // indirect
52-
github.com/docker/go-connections v0.4.0 // indirect
51+
github.com/distribution/reference v0.6.0 // indirect
52+
github.com/docker/docker v26.1.4+incompatible // indirect
53+
github.com/docker/go-connections v0.5.0 // indirect
5354
github.com/docker/go-units v0.5.0 // indirect
5455
github.com/eapache/go-resiliency v1.3.0 // indirect
5556
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
5657
github.com/eapache/queue v1.1.0 // indirect
5758
github.com/euank/go-kmsg-parser v2.0.0+incompatible // indirect
58-
github.com/go-logr/logr v1.2.3 // indirect
59+
github.com/felixge/httpsnoop v1.0.4 // indirect
60+
github.com/go-logr/logr v1.4.1 // indirect
61+
github.com/go-logr/stdr v1.2.2 // indirect
5962
github.com/godbus/dbus/v5 v5.0.6 // indirect
6063
github.com/gogo/protobuf v1.3.2 // indirect
61-
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
62-
github.com/golang/protobuf v1.5.2 // indirect
64+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
65+
github.com/golang/protobuf v1.5.4 // indirect
6366
github.com/golang/snappy v0.0.4 // indirect
64-
github.com/google/uuid v1.3.0 // indirect
65-
github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect
66-
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
67+
github.com/google/s2a-go v0.1.7 // indirect
68+
github.com/google/uuid v1.6.0 // indirect
69+
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
70+
github.com/googleapis/gax-go/v2 v2.12.2 // indirect
6771
github.com/hashicorp/errwrap v1.0.0 // indirect
6872
github.com/hashicorp/go-multierror v1.1.1 // indirect
6973
github.com/hashicorp/go-uuid v1.0.3 // indirect
@@ -75,15 +79,16 @@ require (
7579
github.com/jmespath/go-jmespath v0.4.0 // indirect
7680
github.com/karrick/godirwalk v1.17.0 // indirect
7781
github.com/klauspost/compress v1.15.11 // indirect
78-
github.com/kr/text v0.2.0 // indirect
82+
github.com/kr/pretty v0.3.1 // indirect
7983
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
8084
github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible // indirect
81-
github.com/moby/sys/mountinfo v0.6.2 // indirect
82-
github.com/mrunalp/fileutils v0.5.0 // indirect
85+
github.com/moby/docker-image-spec v1.3.1 // indirect
86+
github.com/moby/sys/mountinfo v0.7.1 // indirect
87+
github.com/mrunalp/fileutils v0.5.1 // indirect
8388
github.com/opencontainers/go-digest v1.0.0 // indirect
8489
github.com/opencontainers/image-spec v1.0.2 // indirect
85-
github.com/opencontainers/runc v1.1.7 // indirect
86-
github.com/opencontainers/runtime-spec v1.0.3-0.20220909204839-494a5a6aca78 // indirect
90+
github.com/opencontainers/runc v1.1.13 // indirect
91+
github.com/opencontainers/runtime-spec v1.2.0 // indirect
8792
github.com/opencontainers/selinux v1.10.0 // indirect
8893
github.com/pierrec/lz4/v4 v4.1.17 // indirect
8994
github.com/pkg/errors v0.9.1 // indirect
@@ -92,22 +97,28 @@ require (
9297
github.com/prometheus/common v0.37.0 // indirect
9398
github.com/prometheus/procfs v0.8.0 // indirect
9499
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
95-
github.com/rogpeppe/go-internal v1.6.1 // indirect
100+
github.com/rogpeppe/go-internal v1.12.0 // indirect
96101
github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646 // indirect
97-
github.com/sirupsen/logrus v1.8.1 // indirect
98-
github.com/stretchr/objx v0.5.0 // indirect
102+
github.com/sirupsen/logrus v1.9.3 // indirect
103+
github.com/stretchr/objx v0.5.2 // indirect
99104
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
100105
github.com/vishvananda/netlink v1.1.0 // indirect
101106
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect
102107
go.opencensus.io v0.24.0 // indirect
103-
golang.org/x/crypto v0.1.0 // indirect
104-
golang.org/x/net v0.8.0 // indirect
105-
golang.org/x/sys v0.6.0 // indirect
106-
golang.org/x/text v0.8.0 // indirect
107-
golang.org/x/time v0.1.0 // indirect
108-
google.golang.org/appengine v1.6.7 // indirect
109-
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
110-
google.golang.org/grpc v1.54.0 // indirect
111-
google.golang.org/protobuf v1.28.1 // indirect
108+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect
109+
go.opentelemetry.io/otel v1.27.0 // indirect
110+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect
111+
go.opentelemetry.io/otel/metric v1.27.0 // indirect
112+
go.opentelemetry.io/otel/trace v1.27.0 // indirect
113+
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
114+
golang.org/x/crypto v0.24.0 // indirect
115+
golang.org/x/net v0.26.0 // indirect
116+
golang.org/x/sys v0.21.0 // indirect
117+
golang.org/x/text v0.16.0 // indirect
118+
google.golang.org/appengine v1.6.8 // indirect
119+
google.golang.org/genproto/googleapis/api v0.0.0-20240513163218-0867130af1f8 // indirect
120+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect
121+
google.golang.org/grpc v1.64.0 // indirect
122+
google.golang.org/protobuf v1.34.1 // indirect
112123
gopkg.in/yaml.v3 v3.0.1 // indirect
113124
)

0 commit comments

Comments
 (0)