Skip to content

Commit d45f57d

Browse files
Eslam-NawaraOmarabdul3ziz
authored andcommitted
add list wg ports endpoint to zos-api-light
1 parent b4ec05f commit d45f57d

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

pkg/netlight/resource/resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ func (r *Resource) HasWireguard() (bool, error) {
489489

490490
// Namespace returns the name of the network namespace to create for the network resource
491491
func (r *Resource) Namespace() (string, error) {
492-
name := fmt.Sprintf("n-%s", r.name)
492+
name := fmt.Sprintf("n%s", r.name)
493493
if len(name) > 15 {
494494
return "", errors.Errorf("network namespace too long %s", name)
495495
}

pkg/zos_api_light/network.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ func (g *ZosAPI) networkListPrivateIPsHandler(ctx context.Context, payload []byt
3737
twin := peer.GetTwinID(ctx)
3838
return g.provisionStub.ListPrivateIPs(ctx, twin, args.NetworkName)
3939
}
40+
41+
func (g *ZosAPI) networkListWGPortsHandler(ctx context.Context, payload []byte) (interface{}, error) {
42+
return g.networkerLightStub.WireguardPorts(ctx)
43+
}

pkg/zos_api_light/routes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func (g *ZosAPI) SetupRoutes(router *peer.Router) {
2525
storage.WithHandler("pools", g.storagePoolsHandler)
2626

2727
network := root.SubRoute("network")
28-
// network.WithHandler("list_wg_ports", g.networkListWGPortsHandler)
28+
network.WithHandler("list_wg_ports", g.networkListWGPortsHandler)
2929
// network.WithHandler("public_config_get", g.networkPublicConfigGetHandler)
3030
network.WithHandler("interfaces", g.networkInterfacesHandler)
3131
network.WithHandler("has_ipv6", g.networkHasIPv6Handler)

0 commit comments

Comments
 (0)