Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ require (
github.com/spf13/afero v1.14.0
github.com/spf13/cobra v1.9.1
github.com/spf13/pflag v1.0.10
github.com/stretchr/testify v1.10.0
github.com/stretchr/testify v1.11.1
github.com/ti-mo/conntrack v0.5.2
github.com/vishvananda/netlink v1.3.1
github.com/vmware/go-ipfix v0.16.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -755,8 +755,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
github.com/ti-mo/conntrack v0.5.2 h1:PQ7MCdFjniEiTJT+qsAysREUsT5iH62/VNyhkB06HOI=
Expand Down
2 changes: 2 additions & 0 deletions pkg/agent/ipassigner/linkmonitor/link_monitor_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ func Test_linkMonitor_listAndWatchLinks(t *testing.T) {
for _, l := range tt.eventHandlers {
assert.Equal(t, l.expectedLinkEvents, l.getReceivedLinkEvents())
}
d.mutex.RLock()
defer d.mutex.RUnlock()
assert.ElementsMatch(t, tt.expectedExistingLinks, d.linkNames.UnsortedList())
},
1*time.Second, 100*time.Millisecond, "timeout waiting for link events",
Expand Down
13 changes: 10 additions & 3 deletions pkg/apiserver/registry/system/supportbundle/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ type supportBundleREST struct {
mode string
statusLocker sync.RWMutex
cancelFunc context.CancelFunc
cache *systemv1beta1.SupportBundle
// cache stores the "current" or most recent SupportBundle resource. Because Get returns
// this value directly, it is important for the supportBundleREST implementation *not* to
// mutate fields in the SupportBundle object once it has been assigned to cache, in order to
// ensure thread-safety. Otherwise, we would have a race with Get callers.
cache *systemv1beta1.SupportBundle

ovsCtlClient ovsctl.OVSCtlClient
aq agentquerier.AgentQuerier
Expand Down Expand Up @@ -154,8 +158,11 @@ func (r *supportBundleREST) Create(ctx context.Context, obj runtime.Object, _ re
r.statusLocker.Lock()
defer r.statusLocker.Unlock()
if err != nil {
klog.Errorf("Error when collecting supportBundle: %v", err)
r.cache.Status = systemv1beta1.SupportBundleStatusNone
klog.ErrorS(err, "Error when collecting supportBundle")
r.cache = &systemv1beta1.SupportBundle{
ObjectMeta: metav1.ObjectMeta{Name: r.mode},
Status: systemv1beta1.SupportBundleStatusNone,
}
return
}
select {
Expand Down
Loading