Commit graph

590 commits

Author SHA1 Message Date
KubeEdge Bot
a940fcfe83
Merge pull request #6884 from RedZapdos123/fix/message-type-closeconnect-string
fix: return CLOSE_CONNECT for MessageTypeCloseConnect
2026-08-06 10:29:26 +08:00
KubeEdge Bot
ee0f03ed90
Merge pull request #6900 from Priyanshubhartistm/fix/ws-handleRawData-panic
fix: pkg/viaduct: WSConnection.handleRawData uses ProtocolTypeWS instead of ProtocolTypeQuic
2026-08-04 17:33:26 +08:00
Priyanshubhartistm
9ecafd38a6
pkg/viaduct: fix gofmt formatting in ws_test.go
Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
2026-08-04 14:13:35 +05:30
Chuanhao Jin
d3763ffcc9 fix: limit viaduct packer payload size
Signed-off-by: Chuanhao Jin <15221580643@163.com>
2026-07-15 15:02:45 +08:00
Chuanhao Jin
ea2eba3348 fix: avoid shell command execution in NodeUpgradeJob
Signed-off-by: Chuanhao Jin <15221580643@163.com>
2026-07-15 15:02:35 +08:00
KubeEdge Bot
b44966924c
Merge pull request #6949 from Priyanshubhartistm/pkg/add-filter-unit-tests
pkg/viaduct/filter: add unit tests for MessageFilter
2026-07-08 18:54:17 +08:00
KubeEdge Bot
e42da94312
Merge pull request #6940 from Priyanshubhartistm/fix/quic-typo
pkg/viaduct/conn/quic: fix "steam" typo in serveSession doc comment
2026-07-08 18:53:18 +08:00
KubeEdge Bot
5f4b2a28ad
Merge pull request #6934 from Priyanshu6968/fixes/#6933
pkg/security/certs: return error from ReadPEMFile when no PEM block is found
2026-07-08 18:52:17 +08:00
Priyanshubhartistm
54eadeea47
pkg/viaduct/filter: add unit tests for MessageFilter
Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
2026-07-03 19:03:09 +05:30
Priyanshubhartistm
70da4ae710
pkg/viaduct/conn/quic: fix "steam" typo in serveSession doc comment
Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
2026-07-01 15:55:53 +05:30
Priyanshubhartistm
f5c301a992
pkg/util: fix typo in GetLocalIP comment
Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
2026-06-30 14:02:45 +05:30
Priyanshu6968
5785098236 pkg/security/certs: use t.TempDir in ReadPEMFile test
Signed-off-by: Priyanshu6968 <priyanshunigam469@gmail.com>
2026-06-30 11:18:45 +05:30
Priyanshu6968
823de877ba pkg/security/certs: return error from ReadPEMFile when no PEM block is found
Signed-off-by: Priyanshu6968 <priyanshunigam469@gmail.com>
2026-06-30 11:03:45 +05:30
Priyanshubhartistm
d5c2e71fea
pkg/viaduct: close server-side conn and verify exact payload in test
- Register t.Cleanup to close the server-side *websocket.Conn from
  serverChan, preventing resource leaks after the test finishes.
- Use bytes.Equal to assert the exact forwarded payload instead of
  only checking consumer.Len() > 0.

Signed-off-by: Priyanshu Bharti <priyanshubharti.stm@gmail.com>
Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
2026-06-24 03:02:26 +05:30
Priyanshubhartistm
6b4947ff5b
pkg/viaduct: fix data race in wsTestPair test helper
wsTestPair wrote to the server variable inside the HTTP handler
goroutine and read it from the main goroutine without synchronization,
causing a data race detectable with go test -race.

Replace the shared variable + time.Sleep(50ms) with a buffered channel:
the handler sends the *websocket.Conn into serverChan, and the caller
receives it with a 2-second timeout. This eliminates both the race and
the arbitrary sleep, making the test faster and deterministic.

Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
2026-06-22 20:42:52 +05:30
Priyanshubhartistm
783f8613ed
pkg/viaduct: fix WSConnection.handleRawData using wrong protocol type
handleRawData passed api.ProtocolTypeQuic to lane.NewLane instead of
api.ProtocolTypeWS. NewLane dispatches to NewQuicLane, which asserts
the van to quic.Stream — a type that *websocket.Conn never satisfies.
NewQuicLane logs "oops! bad type of van" and returns nil, causing the
subsequent io.Copy(conn.consumer, nil) to panic with a nil interface
dereference.

Every other call in ws.go correctly uses api.ProtocolTypeWS. This was
almost certainly a copy/paste from the QUIC implementation.

Fix: pass api.ProtocolTypeWS so NewLane builds a WSLane over conn.wsConn.

Add a regression test using an httptest WebSocket pair that verifies
handleRawData does not panic and forwards data to the consumer.

Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
2026-06-22 20:16:44 +05:30
KubeEdge Bot
823c2eeda5
Merge pull request #6759 from tushar743-ui/test/improve_test_coverage-exec.go
test: add 100% test coverage for pkg/util/execs
2026-06-22 15:46:13 +08:00
KubeEdge Bot
32b8824059
Merge pull request #6767 from sakkshm/test-container-runtime-6758
test: add unit tests for pkg/containers ContainerRuntime
2026-06-22 15:42:13 +08:00
KubeEdge Bot
78675c001b
Merge pull request #6823 from Divyansh200102/patch-jsonpatch-tests
refactor(test): consolidate jsonpatch edge cases into table-driven suite
2026-06-22 14:39:13 +08:00
Mridankan Mandal
34d08133d1
fix: return CLOSE_CONNECT string
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
2026-06-19 02:52:15 +05:30
Lars Lehtonen
3c9d81c5b8 pkg/viaduct/pkg/conn: fix dropped error
Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
2026-05-26 15:33:06 -07:00
Divyansh Khatri
d1d40fe989 refactor(test): consolidate jsonpatch edge cases into table-driven suite
Signed-off-by: Divyansh Khatri <divyanshkhatri200102@gmail.com>
2026-05-26 17:01:47 +00:00
tushar743-ui
ff9c0a0595 test: add 100% test coverage for pkg/util/execs
Signed-off-by: tushar743-ui <tusharpatle743@gmail.com>
2026-05-08 15:54:05 +05:30
sakkshm
ed80b1ebcc pkg/containers: add unit tests for ContainerRuntime
Signed-off-by: sakkshm <saksham.saxena404@gmail.com>
2026-05-07 10:44:17 +05:30
KubeEdge Bot
e9d7517d46
Merge pull request #6744 from tushar743-ui/test/add-jsonpatch-unit-tests
improved test coverage of jsonpatch.go in pkg
2026-05-06 14:14:58 +08:00
Pierluigi Lenoci
26d8d8c1be
honor -stderrthreshold by opting out of legacy klog behavior
klog v2 defaults -logtostderr to true, which silently masks the -stderrthreshold flag. klog v2.130.0 introduced the legacy_stderr_threshold_behavior flag (kubernetes/klog#432) so callers can opt into the corrected behavior.

One call site (keadm) already carried the fix; apply the same pattern to the remaining six klog.InitFlags call sites: edgesite-server, edgesite-agent, viaduct/chat, viaduct/mirror, edgecore Windows init, and the mapper-framework template.

After this change every binary that registers klog flags will honor -stderrthreshold regardless of the -logtostderr default.

Ref: kubernetes/klog#212, kubernetes/klog#432
Signed-off-by: Pierluigi Lenoci <pierluigilenoci@gmail.com>
2026-04-23 17:32:10 +02:00
tushar743-ui
80e799aec7 improved test coverage of jsonpatch
Signed-off-by: tushar743-ui <tusharpatle743@gmail.com>
2026-04-20 23:10:31 +05:30
tushar743-ui
617d810447 test(upgrade): add unit tests for upgrade_reporter_taskevent.go
Signed-off-by: tushar743-ui <tusharpatle743@gmail.com>
2026-04-04 23:34:41 +05:30
ming.tang
aadf81bd55 [WIP] Reconstruct the metaserver db and replace beego with gorm
Signed-off-by: ming.tang <ming.tang@daocloud.io>
2026-03-02 10:48:53 +08:00
KubeEdge Bot
a4926f0c9a
Merge pull request #6613 from Abirdcfly/master
feat: support anonymous access for discovery paths in metaserver
2026-01-22 11:51:17 +08:00
KubeEdge Bot
9a9837141f
Merge pull request #6584 from ddc-baiye/add-test-for-pkg-util-flag
Add unit tests for pkg/util/flag
2026-01-21 11:50:17 +08:00
Abirdcfly
018ffc20bf feat: support anonymous access for discovery paths in metaserver
1. Update metaserver to support anonymous authentication for discovery paths (e.g., /api, /apis, /version), aligning with K8s API Server behavior.
2. Implement `AlwaysAllowDiscoveryAuthorizer` to bypass RBAC for non-resource discovery requests.
3. Refactor `pkg/util/pass-through` to centralize discovery path logic and improve path matching.
4. Add comprehensive unit tests for discovery path identification.

Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2026-01-21 09:20:20 +08:00
KubeEdge Bot
1f79455e27
Merge pull request #6604 from ddc-baiye/add-test-for-pkg-util-fsm
Add test for pkg util fsm
2026-01-04 17:12:10 +08:00
KubeEdge Bot
227bbe5606
Merge pull request #6605 from ddc-baiye/add-test-for-pkg-version-verflag
Add unit tests for pkg/version/verflag
2026-01-04 16:41:11 +08:00
ddc-baiye
29461e8fbe Add unit tests for pkg/viaduct/pkg/fifo
Signed-off-by: ddc-baiye <dongdong.chen@bluedotai.cn>
2025-12-30 10:46:52 +08:00
ddc-baiye
0a48be9205 Add unit tests for pkg/version/verflag
Signed-off-by: ddc-baiye <dongdong.chen@bluedotai.cn>
2025-12-30 10:31:16 +08:00
ddc-baiye
b9a4de132b Add unit tests for pkg/util/fsm
Signed-off-by: ddc-baiye <dongdong.chen@bluedotai.cn>
2025-12-30 10:07:59 +08:00
ddc-baiye
44b36ea505 Update pkg/util/flag/flags_test.go
Co-authored-by: Shelley Bao <48788150+Shelley-BaoYue@users.noreply.github.com>
Signed-off-by: ddc-baiye <dongdong.chen@bluedotai.cn>
2025-12-26 10:25:12 +08:00
ddc-baiye
92fc3ae353 Add unit tests for pkg/util/flag
Signed-off-by: ddc-baiye <dongdong.chen@bluedotai.cn>
2025-12-18 17:01:03 +08:00
Haojie Zhang
99b4a8bccf refactor: extract dmicache into a seperate module and add unit tests
Signed-off-by: Haojie Zhang <hjzhang6848@163.com>
2025-12-08 07:07:54 +00:00
Tomoya Fujita
6fa03053e9 address review comments and CI failures.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
2025-11-17 13:29:20 +09:00
Tomoya Fujita
a9ecd50244 fixing up typo fixes under /pkg detected by codespell.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
2025-11-17 13:27:29 +09:00
KubeEdge Bot
2a5c05995d
Merge pull request #6490 from brinker-tbaker/fix-leases-unsafe-to-kind
fixes "Leases" being parsed as "Leas"
2025-10-30 10:38:29 +08:00
Travis Baker
e11d48ebc2 fixes "Leases" being parsed as "Leas"
Signed-off-by: Travis Baker <travis.baker@brinker.com>
2025-10-17 16:15:12 -05:00
WillardHu
0bfd872b3a Revert "feat: Add DisableCSIVolumePlugin feature gate to disable CSI support in edged"
This reverts commit f5651fdbc9.

Signed-off-by: WillardHu <wei.hu@daocloud.io>
2025-09-12 10:34:25 +08:00
Shelley-BaoYue
211eaf6fc2 fix compile error for k8s 1.31.11
Signed-off-by: Shelley-BaoYue <baoyue2@huawei.com>
2025-08-26 15:45:58 +08:00
Shelley-BaoYue
2ca17bc49c update go.mod for k8s v1.31.11
Signed-off-by: Shelley-BaoYue <baoyue2@huawei.com>
2025-08-26 15:34:41 +08:00
Zishan Ahmad
e9dafc2231 fixed lint issues
Signed-off-by: Zishan Ahmad <zishan.barun@gmail.com>
2025-06-25 07:48:52 +05:30
Zishan Ahmad
55e69f3fd1 added a blank line
Signed-off-by: Zishan Ahmad <zishan.barun@gmail.com>
2025-06-25 07:37:02 +05:30
Zishan Ahmad
c984a99f8b added unit tests for ConvToCRIImage function
Signed-off-by: Zishan Ahmad <zishan.barun@gmail.com>
2025-06-24 21:45:00 +05:30