Commit 6f5aacc
test: e2e tests for status.url, k8s proxy access, and SSH edge URL (#73)
* test: add e2e tests for status.url, k8s proxy, and SSH edge URL
- Add EdgeURLSet: verifies edge.status.url populated for kubernetes-type
- Add K8sProxyAccess: verifies kubectl works against status.url
- Add SSHEdgeURLSet: verifies status.url set for server-type edges
- Fix AgentEdgeJoin: use status.url for proxy access assertion
- Add GetEdgeURL + KubectlWithURL framework helpers
- Fix mount_reconciler: set SSH URL for server-type edges instead of clearing
- Sync CRD YAML: update URL field description to match current types
Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt>
* test: fix e2e tests - verified passing locally
Fixes all failures in the SSH and standalone e2e suites.
## Root causes fixed
### 1. Port conflict: KEDGE_HUB_API_SERVER_PORT (framework/cluster.go)
Port 6443 was occupied by kcp on this host. Add
KEDGE_HUB_API_SERVER_PORT env-var support so can
be told to use a different API server port (e.g. 6444).
All SetupClusters* variants now forward the flag.
### 2. SSH WebSocket URL double-concatenation (pkg/cli/cmd/ssh.go)
buildSSHWebSocketURL was prepending the hub base path on top of the
full status.URL, producing nonsense URLs like:
wss://hub:8443/services/edges-proxyhttps://hub:8443/.../ssh/ssh
Now it simply parses status.URL (already the complete URL) and
converts the scheme to wss.
### 3. Cluster name mismatch for static-token agents (tunneler.go / agent.go)
extractClusterNameFromToken returned "default" for non-JWT static
tokens. The hub's mount_reconciler embeds the real kcp cluster name
(e.g. "1tww43gelbj45g0k") in status.URL; the agent was registering
its reverse-tunnel under the key edges/default/... causing the SSH
and k8s proxy handlers to return 502.
Fix: add SplitBaseAndCluster(hubURL) which extracts the cluster from
the kubeconfig server URL (set by static-token login as
https://hub:8443/clusters/<id>). Priority: explicit --cluster flag >
URL-embedded cluster > JWT claim > "default" fallback. Also add
--cluster flag to for the Docker container case.
### 4. ServerProcess uses hub kubeconfig (test/e2e/framework/server_process.go)
SSH server-mode agents were started with bare --hub-url (no cluster
path). Add HubKubeconfig field: when set, use --hub-kubeconfig +
--tunnel-url so the agent gets the cluster-scoped server URL and
SplitBaseAndCluster picks up the correct cluster ID.
### 5. DialSSH hardcoded /clusters/default (framework/ssh_client.go)
Look up edge.Status.URL (which has the correct cluster) then convert
https→wss instead of constructing the URL from scratch with a
hardcoded "default" cluster path.
### 6. VirtualWorkload siteSelector → edgeSelector (cases/multisite.go)
PlacementSpec.EdgeSelector is the actual field name; siteSelector
caused strict-decoding 400 errors for LabelBasedScheduling,
WorkloadIsolation, SiteFailoverIsolation, SiteReconnect tests.
Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt>
* test: add functional e2e tests for workload deployment and k8s proxy
- WorkloadDeployment: VirtualWorkload → Placement → resource on edge cluster
- K8sProxyWrite: kubectl apply via edges-proxy creates resource on edge
- K8sProxyExec: kubectl exec via edges-proxy (tests upgrade/hijack path)
Also fix a bug in edgesHandleK8sUpgrade: the request URL path was not
being rewritten to the /k8s/... form before forwarding to the agent,
causing the agent's mux to return 404 for exec/port-forward requests.
Now we call extractEdgeK8sPath before r.Write(deviceConn).
All tested locally against real kind clusters.
Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt>
* fix: rename TestOIDCUserCanListSites → TestOIDCUserCanListEdges, use kedge edge list
kedge site list was removed; the OIDC test must use kedge edge list.
Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt>
* fix: rename --site-name → --edge-name, PlacementSpec.SiteName → EdgeName
Addresses PR #73 review comment. Sites are gone; use edge terminology:
- CLI flag --site-name → --edge-name (deprecated alias kept)
- PlacementSpec.SiteName json:siteName → EdgeName json:edgeName
- All scheduler/aggregator/workload reconciler references updated
- Test framework updated
Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt>
* fix(e2e): use edgeName json field in WaitForPlacement kubectl query
.spec.siteName was renamed to .spec.edgeName when PlacementSpec was
migrated from Site to Edge CRD. Update both WaitForPlacement and
WaitForNoPlacement custom-columns queries to match.
Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt>
* refactor: remove all stale site/siteName references
- Drop --site-name and --mode deprecated CLI flags (no backward compat)
- Remove AgentModeSite, AgentMode, AgentModeServer compat constants/types
- Rename kedge.faros.sh/site label -> kedge.faros.sh/edge in scheduler
and agent workload reconciler
- Rename siteName fields/params -> edgeName throughout agent and test packages
- Fix kedge get placements: column SITE->EDGE, spec.siteName->spec.edgeName
- Fix WaitForPlacement/WaitForNoPlacement: custom-columns SITE->EDGE
- Fix Helm dev plugin examples: siteName->edgeName, site-kubeconfig->edge-kubeconfig
- Update 'kedge site list/get' examples -> 'kedge edge list/get'
Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt>
* refactor: replace remaining site references with edge throughout codebase
Update all remaining "site" references from the old Site CRD concept:
- Rename test data edge names (site-1 → edge-1, etc.)
- Rename functions SiteFailoverIsolation → EdgeFailoverIsolation, etc.
- Rename constants msSite1 → msEdge1, etc.
- Fix user-visible strings in dev plugin (site kubeconfig → edge kubeconfig)
- Update all comments and package docs
- Rename test functions NoMatchingSites → NoMatchingEdges, etc.
Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt>
* chore: regenerate CRD manifests after virtualworkload doc update
Update generated CRDs and APIResourceSchema to reflect description
changes: 'across sites' -> 'across edges'.
Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt>
---------
Co-authored-by: OpenClaw Bot <bot@openclaw.ai>
Co-authored-by: Mangirdas Judeikis <mangirdas@judeikis.lt>1 parent eea5d12 commit 6f5aacc
46 files changed
Lines changed: 1333 additions & 390 deletions
File tree
- apis/kedge/v1alpha1
- cmd/kedge-agent
- config
- crds
- kcp
- pkg
- agent
- reconciler
- tunnel
- cli/cmd
- dev/plugin
- hub
- bootstrap/crds
- controllers
- edge
- scheduler
- status
- virtual/builder
- test/e2e
- cases
- framework
- suites
- external_kcp
- oidc
- ssh
- standalone
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 63 | | |
70 | 64 | | |
71 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | | - | |
59 | | - | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
54 | | - | |
55 | | - | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
0 commit comments