From 3c692d2026bf5ccfa50c53246fa065472a6f459e Mon Sep 17 00:00:00 2001 From: pb Date: Mon, 10 Mar 2025 17:57:14 +0100 Subject: [PATCH] monitord is able to create an admiralty Source on remote peer --- controllers/admiralty.go | 4 +++- infrastructure/kubernetes.go | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/controllers/admiralty.go b/controllers/admiralty.go index c453fdc..11af077 100644 --- a/controllers/admiralty.go +++ b/controllers/admiralty.go @@ -95,7 +95,7 @@ func (c *AdmiraltyController) GetAllTargets() { // @Success 200 // @router /targets/:execution [get] func (c *AdmiraltyController) GetOneTarget() { - id := c.Ctx.Input.Param(":id") + id := c.Ctx.Input.Param(":execution") serv, err := infrastructure.NewService() if err != nil { // change code to 500 @@ -125,6 +125,8 @@ func (c *AdmiraltyController) GetOneTarget() { func (c *AdmiraltyController) CreateSource() { execution := c.Ctx.Input.Param(":execution") + fmt.Println("execution :: ", execution) + fmt.Println("input :: ", c.Ctx.Input) serv, err := infrastructure.NewKubernetesService() if err != nil { // change code to 500 diff --git a/infrastructure/kubernetes.go b/infrastructure/kubernetes.go index 07a0a03..81c9bd5 100644 --- a/infrastructure/kubernetes.go +++ b/infrastructure/kubernetes.go @@ -450,6 +450,9 @@ func postCDRapiKube(client kubernetes.Clientset, ctx context.Context, path strin return resp, nil } +// Returns the Kubernetes' Node object corresponding to the executionID if it exists on this host +// +// The node is created when an admiralty Target (on host) can connect to an admiralty Source (on remote) func (k *KubernetesService) GetOneNode(context context.Context,executionID string) (*v1.Node, error) { res, err := k.Set.CoreV1(). Nodes().