Skip to content

Commit 2cbf6c5

Browse files
committed
bump k8s.io to 1.24.15 and remove boskos client
1 parent 6b538a5 commit 2cbf6c5

File tree

1,932 files changed

+299349
-44111
lines changed

Some content is hidden

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

1,932 files changed

+299349
-44111
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ e2e-test: vet fmt build-tar
228228
-image=$(VM_IMAGE) -image-family=$(IMAGE_FAMILY) -image-project=$(IMAGE_PROJECT) \
229229
-ssh-user=$(SSH_USER) -ssh-key=$(SSH_KEY) \
230230
-npd-build-tar=`pwd`/$(TARBALL) \
231-
-boskos-project-type=$(BOSKOS_PROJECT_TYPE) -job-name=$(JOB_NAME) \
231+
-job-name=$(JOB_NAME) \
232232
-artifacts-dir=$(ARTIFACTS)
233233

234234
$(NPD_NAME_VERSION)-%.tar.gz: $(ALL_BINARIES) test/e2e-install.sh

cmd/nodeproblemdetector/node_problem_detector.go

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ limitations under the License.
1717
package main
1818

1919
import (
20+
"context"
21+
2022
"github.com/golang/glog"
2123

2224
_ "k8s.io/node-problem-detector/cmd/nodeproblemdetector/exporterplugins"
@@ -31,16 +33,7 @@ import (
3133
"k8s.io/node-problem-detector/pkg/version"
3234
)
3335

34-
func npdInteractive(npdo *options.NodeProblemDetectorOptions) {
35-
termCh := make(chan error, 1)
36-
defer close(termCh)
37-
38-
if err := npdMain(npdo, termCh); err != nil {
39-
glog.Fatalf("Problem detector failed with error: %v", err)
40-
}
41-
}
42-
43-
func npdMain(npdo *options.NodeProblemDetectorOptions, termCh <-chan error) error {
36+
func npdMain(ctx context.Context, npdo *options.NodeProblemDetectorOptions) error {
4437
if npdo.PrintVersion {
4538
version.PrintVersion()
4639
return nil
@@ -58,7 +51,7 @@ func npdMain(npdo *options.NodeProblemDetectorOptions, termCh <-chan error) erro
5851

5952
// Initialize exporters.
6053
defaultExporters := []types.Exporter{}
61-
if ke := k8sexporter.NewExporterOrDie(npdo); ke != nil {
54+
if ke := k8sexporter.NewExporterOrDie(ctx, npdo); ke != nil {
6255
defaultExporters = append(defaultExporters, ke)
6356
glog.Info("K8s exporter started.")
6457
}
@@ -79,5 +72,5 @@ func npdMain(npdo *options.NodeProblemDetectorOptions, termCh <-chan error) erro
7972

8073
// Initialize NPD core.
8174
p := problemdetector.NewProblemDetector(problemDaemons, npdExporters)
82-
return p.Run(termCh)
75+
return p.Run(ctx)
8376
}

cmd/nodeproblemdetector/node_problem_detector_linux.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ limitations under the License.
1717
package main
1818

1919
import (
20+
"context"
21+
22+
"github.com/golang/glog"
2023
"github.com/spf13/pflag"
2124
"k8s.io/node-problem-detector/cmd/options"
2225
)
@@ -26,5 +29,7 @@ func main() {
2629
npdo.AddFlags(pflag.CommandLine)
2730

2831
pflag.Parse()
29-
npdInteractive(npdo)
32+
if err := npdMain(context.Background(), npdo); err != nil {
33+
glog.Fatalf("Problem detector failed with error: %v", err)
34+
}
3035
}

cmd/nodeproblemdetector/node_problem_detector_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020
package main
2121

2222
import (
23-
"errors"
23+
"context"
2424
"fmt"
2525
"os"
2626
"strings"
@@ -81,11 +81,9 @@ func TestNPDMain(t *testing.T) {
8181
npdo, cleanup := setupNPD(t)
8282
defer cleanup()
8383

84-
termCh := make(chan error, 2)
85-
termCh <- errors.New("close")
86-
defer close(termCh)
87-
88-
if err := npdMain(npdo, termCh); err != nil {
84+
ctx, cancelFunc := context.WithCancel(context.Background())
85+
cancelFunc()
86+
if err := npdMain(ctx, npdo); err != nil {
8987
t.Errorf("termination signal should not return error got, %v", err)
9088
}
9189
}

cmd/nodeproblemdetector/node_problem_detector_windows.go

Lines changed: 28 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
package main
1818

1919
import (
20-
"errors"
20+
"context"
2121
"fmt"
2222
"sync"
2323
"time"
@@ -102,26 +102,20 @@ type npdService struct {
102102
}
103103

104104
func (s *npdService) Execute(args []string, r <-chan svc.ChangeRequest, changes chan<- svc.Status) (bool, uint32) {
105-
appTermCh := make(chan error, 1)
106-
svcLoopTermCh := make(chan error, 1)
107-
defer func() {
108-
close(appTermCh)
109-
close(svcLoopTermCh)
110-
}()
111-
112105
changes <- svc.Status{State: svc.StartPending}
113106
changes <- svc.Status{State: svc.Running, Accepts: svcCommandsAccepted}
114107
var appWG sync.WaitGroup
115108
var svcWG sync.WaitGroup
116109

117110
options := s.options
111+
ctx, cancelFunc := context.WithCancel(context.Background())
118112

119113
// NPD application goroutine.
120114
appWG.Add(1)
121115
go func() {
122116
defer appWG.Done()
123117

124-
if err := npdMain(options, appTermCh); err != nil {
118+
if err := npdMain(ctx, options); err != nil {
125119
elog.Warning(windowsEventLogID, err.Error())
126120
}
127121

@@ -132,16 +126,36 @@ func (s *npdService) Execute(args []string, r <-chan svc.ChangeRequest, changes
132126
svcWG.Add(1)
133127
go func() {
134128
defer svcWG.Done()
135-
136-
serviceLoop(r, changes, appTermCh, svcLoopTermCh)
129+
for {
130+
select {
131+
case <-ctx.Done():
132+
return
133+
case c := <-r:
134+
switch c.Cmd {
135+
case svc.Interrogate:
136+
changes <- c.CurrentStatus
137+
// Testing deadlock from https://code.google.com/p/winsvc/issues/detail?id=4
138+
time.Sleep(100 * time.Millisecond)
139+
changes <- c.CurrentStatus
140+
case svc.Stop, svc.Shutdown:
141+
elog.Info(windowsEventLogID, fmt.Sprintf("Stopping %s service, %v", svcName, c.Context))
142+
cancelFunc()
143+
case svc.Pause:
144+
elog.Info(windowsEventLogID, "ignoring pause command from Windows service control, not supported")
145+
changes <- svc.Status{State: svc.Paused, Accepts: svcCommandsAccepted}
146+
case svc.Continue:
147+
elog.Info(windowsEventLogID, "ignoring continue command from Windows service control, not supported")
148+
changes <- svc.Status{State: svc.Running, Accepts: svcCommandsAccepted}
149+
default:
150+
elog.Error(windowsEventLogID, fmt.Sprintf("unexpected control request #%d", c))
151+
}
152+
}
153+
}
137154
}()
138155

139156
// Wait for the application go routine to die.
140157
appWG.Wait()
141158

142-
// Ensure that the service control loop is killed.
143-
svcLoopTermCh <- nil
144-
145159
// Wait for the service control loop to terminate.
146160
// Otherwise it's possible that the channel closures cause the application to panic.
147161
svcWG.Wait()
@@ -151,31 +165,3 @@ func (s *npdService) Execute(args []string, r <-chan svc.ChangeRequest, changes
151165

152166
return false, uint32(0)
153167
}
154-
155-
func serviceLoop(r <-chan svc.ChangeRequest, changes chan<- svc.Status, appTermCh chan error, svcLoopTermCh chan error) {
156-
for {
157-
select {
158-
case <-svcLoopTermCh:
159-
return
160-
case c := <-r:
161-
switch c.Cmd {
162-
case svc.Interrogate:
163-
changes <- c.CurrentStatus
164-
// Testing deadlock from https://code.google.com/p/winsvc/issues/detail?id=4
165-
time.Sleep(100 * time.Millisecond)
166-
changes <- c.CurrentStatus
167-
case svc.Stop, svc.Shutdown:
168-
elog.Info(windowsEventLogID, fmt.Sprintf("Stopping %s service, %v", svcName, c.Context))
169-
appTermCh <- errors.New("stopping service")
170-
case svc.Pause:
171-
elog.Info(windowsEventLogID, "ignoring pause command from Windows service control, not supported")
172-
changes <- svc.Status{State: svc.Paused, Accepts: svcCommandsAccepted}
173-
case svc.Continue:
174-
elog.Info(windowsEventLogID, "ignoring continue command from Windows service control, not supported")
175-
changes <- svc.Status{State: svc.Running, Accepts: svcCommandsAccepted}
176-
default:
177-
elog.Error(windowsEventLogID, fmt.Sprintf("unexpected control request #%d", c))
178-
}
179-
}
180-
}
181-
}

cmd/nodeproblemdetector/node_problem_detector_windows_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ limitations under the License.
2020
package main
2121

2222
import (
23+
"context"
2324
"testing"
2425

2526
"golang.org/x/sys/windows/svc"

go.mod

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.20
55
require (
66
cloud.google.com/go/compute/metadata v0.2.3
77
code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c
8-
contrib.go.opencensus.io/exporter/prometheus v0.0.0-20190427222117-f6cda26f80a3
8+
contrib.go.opencensus.io/exporter/prometheus v0.4.0
99
contrib.go.opencensus.io/exporter/stackdriver v0.13.4
1010
github.com/acobaugh/osrelease v0.0.0-20181218015638-a93a0a55a249
1111
github.com/avast/retry-go v2.4.1+incompatible
@@ -28,54 +28,67 @@ require (
2828
golang.org/x/oauth2 v0.7.0
2929
golang.org/x/sys v0.8.0
3030
google.golang.org/api v0.114.0
31-
k8s.io/api v0.17.2
32-
k8s.io/apimachinery v0.17.2
33-
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
34-
k8s.io/component-base v0.17.2
31+
k8s.io/api v0.24.15
32+
k8s.io/apimachinery v0.24.15
33+
k8s.io/client-go v0.24.15
34+
k8s.io/component-base v0.24.15
3535
k8s.io/klog v1.0.0
36-
k8s.io/test-infra v0.0.0-20190914015041-e1cbc3ccd91c
36+
sigs.k8s.io/boskos v0.0.0-20230524062849-a7ef97ee445d
3737
)
3838

3939
require (
4040
cloud.google.com/go/compute v1.19.1 // indirect
4141
cloud.google.com/go/container v1.15.0 // indirect
4242
cloud.google.com/go/monitoring v1.13.0 // indirect
4343
cloud.google.com/go/trace v1.9.0 // indirect
44+
github.com/PuerkitoBio/purell v1.1.1 // indirect
45+
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
4446
github.com/StackExchange/wmi v1.2.1 // indirect
45-
github.com/aws/aws-sdk-go v1.23.20 // indirect
47+
github.com/aws/aws-sdk-go v1.44.72 // indirect
4648
github.com/beorn7/perks v1.0.1 // indirect
47-
github.com/blang/semver v3.5.1+incompatible // indirect
49+
github.com/blang/semver/v4 v4.0.0 // indirect
4850
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
4951
github.com/cespare/xxhash/v2 v2.2.0 // indirect
5052
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf // indirect
5153
github.com/davecgh/go-spew v1.1.1 // indirect
52-
github.com/fsnotify/fsnotify v1.4.9 // indirect
54+
github.com/emicklei/go-restful v2.15.0+incompatible // indirect
55+
github.com/fsnotify/fsnotify v1.5.1 // indirect
56+
github.com/go-kit/log v0.2.0 // indirect
57+
github.com/go-logfmt/logfmt v0.5.1 // indirect
58+
github.com/go-logr/logr v1.2.4 // indirect
5359
github.com/go-ole/go-ole v1.2.5 // indirect
60+
github.com/go-openapi/jsonpointer v0.19.5 // indirect
61+
github.com/go-openapi/jsonreference v0.19.6 // indirect
62+
github.com/go-openapi/swag v0.21.1 // indirect
5463
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
55-
github.com/gogo/protobuf v1.3.1 // indirect
56-
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
64+
github.com/gogo/protobuf v1.3.2 // indirect
65+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
5766
github.com/golang/protobuf v1.5.3 // indirect
67+
github.com/google/gnostic v0.5.7-v3refs // indirect
5868
github.com/google/go-cmp v0.5.9 // indirect
59-
github.com/google/gofuzz v1.0.0 // indirect
69+
github.com/google/gofuzz v1.2.1-0.20210504230335-f78f29fc09ea // indirect
6070
github.com/google/uuid v1.3.0 // indirect
6171
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
6272
github.com/googleapis/gax-go/v2 v2.7.1 // indirect
63-
github.com/googleapis/gnostic v0.3.1 // indirect
64-
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce // indirect
65-
github.com/hashicorp/go-multierror v0.0.0-20171204182908-b7773ae21874 // indirect
66-
github.com/imdario/mergo v0.3.7 // indirect
67-
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
73+
github.com/hashicorp/errwrap v1.1.0 // indirect
74+
github.com/hashicorp/go-multierror v1.1.1 // indirect
75+
github.com/imdario/mergo v0.3.12 // indirect
76+
github.com/jmespath/go-jmespath v0.4.0 // indirect
77+
github.com/josharian/intern v1.0.0 // indirect
6878
github.com/json-iterator/go v1.1.12 // indirect
69-
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
79+
github.com/mailru/easyjson v0.7.7 // indirect
7080
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
7181
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
7282
github.com/modern-go/reflect2 v1.0.2 // indirect
83+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
7384
github.com/nxadm/tail v1.4.8 // indirect
7485
github.com/onsi/ginkgo/v2 v2.9.4 // indirect
7586
github.com/pmezard/go-difflib v1.0.0 // indirect
7687
github.com/prometheus/client_golang v1.12.1 // indirect
77-
github.com/sirupsen/logrus v1.6.0 // indirect
88+
github.com/prometheus/statsd_exporter v0.21.0 // indirect
89+
github.com/sirupsen/logrus v1.9.0 // indirect
7890
github.com/tedsuo/ifrit v0.0.0-20230516164442-7862c310ad26 // indirect
91+
go4.org v0.0.0-20201209231011-d4a079459e60 // indirect
7992
golang.org/x/net v0.10.0 // indirect
8093
golang.org/x/sync v0.1.0 // indirect
8194
golang.org/x/term v0.8.0 // indirect
@@ -92,14 +105,18 @@ require (
92105
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
93106
gopkg.in/yaml.v2 v2.4.0 // indirect
94107
gopkg.in/yaml.v3 v3.0.1 // indirect
95-
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a // indirect
96-
k8s.io/utils v0.0.0-20200122174043-1e243dd1a584 // indirect
97-
sigs.k8s.io/yaml v1.1.0 // indirect
108+
k8s.io/klog/v2 v2.70.0 // indirect
109+
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect
110+
k8s.io/test-infra v0.0.0-20220913174101-46ac1a6cf806 // indirect
111+
k8s.io/utils v0.0.0-20220725171434-9bab9ef40391 // indirect
112+
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
113+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
114+
sigs.k8s.io/yaml v1.3.0 // indirect
98115
)
99116

100117
replace (
101-
k8s.io/api => k8s.io/api v0.17.2
102-
k8s.io/apimachinery => k8s.io/apimachinery v0.17.2
103-
k8s.io/client-go => k8s.io/client-go v0.17.2
104-
k8s.io/component-base => k8s.io/component-base v0.17.2
118+
k8s.io/api => k8s.io/api v0.24.15
119+
k8s.io/apimachinery => k8s.io/apimachinery v0.24.15
120+
k8s.io/client-go => k8s.io/client-go v0.24.15
121+
k8s.io/component-base => k8s.io/component-base v0.24.15
105122
)

0 commit comments

Comments
 (0)