Skip to content

Commit f304f27

Browse files
authored
gather-sysinfo: update debug-tools to v0.2.3 (#1347)
remove some (most?) technical debt related to gather-sysinfo and debug-tools, bumping to v0.2.z. This allows us to bump the cadvisor dep removing the pin. Signed-off-by: Francesco Romani <fromani@redhat.com>
1 parent 00baa03 commit f304f27

File tree

426 files changed

+17847
-82920
lines changed

Some content is hidden

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

426 files changed

+17847
-82920
lines changed

cmd/gather-sysinfo/gather-sysinfo.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"sort"
99

1010
"github.com/jaypipes/ghw/pkg/snapshot"
11-
"github.com/openshift-kni/debug-tools/pkg/knit/cmd"
12-
"github.com/openshift-kni/debug-tools/pkg/knit/cmd/k8s"
11+
"github.com/openshift-kni/debug-tools/pkg/cli/knit"
12+
"github.com/openshift-kni/debug-tools/pkg/cli/knit/k8s"
1313
"github.com/openshift-kni/debug-tools/pkg/machineinformer"
1414
"github.com/spf13/cobra"
1515
)
@@ -23,7 +23,7 @@ type snapshotOptions struct {
2323
}
2424

2525
func main() {
26-
root := cmd.NewRootCommand(newSnapshotCommand,
26+
root := knit.NewRootCommand(newSnapshotCommand,
2727
k8s.NewPodResourcesCommand,
2828
k8s.NewPodInfoCommand,
2929
)
@@ -34,7 +34,7 @@ func main() {
3434
}
3535
}
3636

37-
func newSnapshotCommand(knitOpts *cmd.KnitOptions) *cobra.Command {
37+
func newSnapshotCommand(knitOpts *knit.KnitOptions) *cobra.Command {
3838
opts := &snapshotOptions{}
3939
snap := &cobra.Command{
4040
Use: "snapshot",
@@ -51,7 +51,7 @@ func newSnapshotCommand(knitOpts *cmd.KnitOptions) *cobra.Command {
5151
return snap
5252
}
5353

54-
func collectMachineinfo(knitOpts *cmd.KnitOptions, destPath string) error {
54+
func collectMachineinfo(knitOpts *knit.KnitOptions, destPath string) error {
5555
outfile, err := os.Create(destPath)
5656
if err != nil {
5757
return err
@@ -66,7 +66,7 @@ func collectMachineinfo(knitOpts *cmd.KnitOptions, destPath string) error {
6666
return nil
6767
}
6868

69-
func makeSnapshot(cmd *cobra.Command, knitOpts *cmd.KnitOptions, opts *snapshotOptions, args []string) error {
69+
func makeSnapshot(cmd *cobra.Command, knitOpts *knit.KnitOptions, opts *snapshotOptions, args []string) error {
7070
fileSpecs := dedupExpectedContent(kniExpectedCloneContent(), snapshot.ExpectedCloneContent())
7171
if opts.dumpList {
7272
for _, fileSpec := range fileSpecs {

cmd/gather-sysinfo/gather-sysinfo_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import (
55
"strings"
66
"testing"
77

8-
"github.com/openshift-kni/debug-tools/pkg/knit/cmd"
98
"github.com/spf13/cobra"
109
"k8s.io/utils/strings/slices"
10+
11+
"github.com/openshift-kni/debug-tools/pkg/cli/knit"
1112
)
1213

1314
var kniEntries = []string{
@@ -29,7 +30,7 @@ var kniEntries = []string{
2930

3031
func TestCollectMachineInfo(t *testing.T) {
3132
//Check if collect machine info file is created correctly
32-
knitOpts := &cmd.KnitOptions{}
33+
knitOpts := &knit.KnitOptions{}
3334
knitOpts.SysFSRoot = "/host/sys"
3435

3536
destFile := "./output"
@@ -61,7 +62,7 @@ func TestChroot(t *testing.T) {
6162
}
6263

6364
func TestSnapshot(t *testing.T) {
64-
knitOpts := &cmd.KnitOptions{}
65+
knitOpts := &knit.KnitOptions{}
6566

6667
opts := &snapshotOptions{}
6768
cmd := &cobra.Command{}

go.mod

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
github.com/kevinburke/go-bindata v3.24.0+incompatible
1717
github.com/onsi/ginkgo/v2 v2.22.1
1818
github.com/onsi/gomega v1.36.2
19-
github.com/openshift-kni/debug-tools v0.1.12
19+
github.com/openshift-kni/debug-tools v0.2.3
2020
github.com/openshift-kni/k8sreporter v1.0.6
2121
github.com/openshift/api v0.0.0-20250407083304-00e6260bd8b8
2222
github.com/openshift/build-machinery-go v0.0.0-20250211133638-a00a772ae1a2
@@ -32,14 +32,14 @@ require (
3232
gopkg.in/fsnotify.v1 v1.4.7
3333
gopkg.in/ini.v1 v1.67.0
3434
gopkg.in/yaml.v2 v2.4.0
35-
k8s.io/api v0.32.3
35+
k8s.io/api v0.32.6
3636
k8s.io/apiextensions-apiserver v0.32.3
37-
k8s.io/apimachinery v0.32.3
38-
k8s.io/client-go v0.32.3
37+
k8s.io/apimachinery v0.32.6
38+
k8s.io/client-go v0.32.6
3939
k8s.io/code-generator v0.32.3
4040
k8s.io/klog v1.0.0
4141
k8s.io/klog/v2 v2.130.1
42-
k8s.io/kubelet v0.32.3
42+
k8s.io/kubelet v0.32.6
4343
k8s.io/kubernetes v1.32.3
4444
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e
4545
kubevirt.io/qe-tools v0.1.8
@@ -61,14 +61,16 @@ require (
6161
github.com/blang/semver/v4 v4.0.0 // indirect
6262
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
6363
github.com/cespare/xxhash/v2 v2.3.0 // indirect
64-
github.com/checkpoint-restore/go-criu/v6 v6.3.0 // indirect
65-
github.com/containerd/console v1.0.4 // indirect
64+
github.com/containerd/containerd/api v1.8.0 // indirect
65+
github.com/containerd/errdefs v1.0.0 // indirect
66+
github.com/containerd/errdefs/pkg v0.3.0 // indirect
6667
github.com/containerd/log v0.1.0 // indirect
67-
github.com/containerd/ttrpc v1.2.5 // indirect
68+
github.com/containerd/ttrpc v1.2.6 // indirect
69+
github.com/containerd/typeurl/v2 v2.2.2 // indirect
6870
github.com/coreos/go-semver v0.3.1 // indirect
6971
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
7072
github.com/coreos/vcontext v0.0.0-20231102161604-685dc7299dc5 // indirect
71-
github.com/cyphar/filepath-securejoin v0.3.4 // indirect
73+
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
7274
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
7375
github.com/distribution/reference v0.6.0 // indirect
7476
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
@@ -98,7 +100,7 @@ require (
98100
github.com/gogo/protobuf v1.3.2 // indirect
99101
github.com/golang/protobuf v1.5.4 // indirect
100102
github.com/google/btree v1.1.3 // indirect
101-
github.com/google/cadvisor v0.51.0 // indirect
103+
github.com/google/cadvisor v0.52.1 // indirect
102104
github.com/google/cel-go v0.22.0 // indirect
103105
github.com/google/gnostic-models v0.6.8 // indirect
104106
github.com/google/gofuzz v1.2.0 // indirect
@@ -123,28 +125,24 @@ require (
123125
github.com/mitchellh/mapstructure v1.5.0 // indirect
124126
github.com/moby/spdystream v0.5.0 // indirect
125127
github.com/moby/sys/mountinfo v0.7.2 // indirect
126-
github.com/moby/sys/user v0.3.0 // indirect
127128
github.com/moby/sys/userns v0.1.0 // indirect
128129
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
129130
github.com/modern-go/reflect2 v1.0.2 // indirect
130-
github.com/mrunalp/fileutils v0.5.1 // indirect
131131
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
132132
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
133133
github.com/oklog/ulid v1.3.1 // indirect
134+
github.com/opencontainers/cgroups v0.0.1 // indirect
134135
github.com/opencontainers/go-digest v1.0.0 // indirect
135-
github.com/opencontainers/runc v1.2.1 // indirect
136+
github.com/opencontainers/image-spec v1.1.1 // indirect
137+
github.com/opencontainers/runc v1.2.5 // indirect
136138
github.com/opencontainers/runtime-spec v1.2.0 // indirect
137139
github.com/opencontainers/selinux v1.11.1 // indirect
138140
github.com/prometheus/client_model v0.6.1 // indirect
139141
github.com/prometheus/common v0.62.0 // indirect
140142
github.com/prometheus/procfs v0.15.1 // indirect
141143
github.com/robfig/cron v1.2.0 // indirect
142-
github.com/seccomp/libseccomp-golang v0.10.0 // indirect
143144
github.com/stoewer/go-strcase v1.3.0 // indirect
144-
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
145145
github.com/vincent-petithory/dataurl v1.0.0 // indirect
146-
github.com/vishvananda/netlink v1.3.1-0.20250206174618-62fb240731fa // indirect
147-
github.com/vishvananda/netns v0.0.4 // indirect
148146
github.com/x448/float16 v0.8.4 // indirect
149147
go.etcd.io/etcd/api/v3 v3.5.17 // indirect
150148
go.etcd.io/etcd/client/pkg/v3 v3.5.17 // indirect
@@ -236,7 +234,3 @@ replace (
236234
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.32.3
237235
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.32.3
238236
)
239-
240-
// Technical debt of NTO and its dependencies.
241-
// openshift/openshift-kni/debug-tools@v0.2.1 needs pinning of cadvisor; also gather-sysinfo.go needs to be fixed to allow usage of latest debug-tools
242-
replace github.com/google/cadvisor => github.com/google/cadvisor v0.49.1

0 commit comments

Comments
 (0)