Skip to content

Commit ee82c06

Browse files
committed
fix: subscription unstructured fix
1 parent 29575be commit ee82c06

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Taskfile.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ tasks:
4040
env:
4141
KUBEBUILDER_ASSETS:
4242
sh: $(pwd)/{{.LOCAL_BIN}}/setup-envtest use {{.ENVTEST_K8S_VERSION}} --bin-dir $(pwd)/{{.LOCAL_BIN}} -p path
43-
GO111MODULE: on
4443
cmds:
4544
- go test ./... {{.ADDITIONAL_COMMAND_ARGS}}
4645
test:

internal/resolver/subscription.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"errors"
66
"reflect"
7-
"sort"
87
"strings"
98

109
"github.com/graphql-go/graphql/language/ast"
@@ -149,17 +148,15 @@ func (r *Service) runWatch(
149148
select {
150149
case <-ctx.Done():
151150
return
152-
case resultChannel <- singleObj:
151+
case resultChannel <- singleObj.Object:
153152
}
154153
} else {
155154
// Multiple items mode
156-
items := make([]unstructured.Unstructured, 0, len(previousObjects))
155+
items := make([]map[string]any, 0, len(previousObjects))
157156
for _, item := range previousObjects {
158-
items = append(items, *item)
157+
items = append(items, item.DeepCopy().Object)
159158
}
160-
sort.Slice(items, func(i, j int) bool {
161-
return items[i].GetName() < items[j].GetName()
162-
})
159+
163160
select {
164161
case <-ctx.Done():
165162
return

0 commit comments

Comments
 (0)