Compare commits

...

2 Commits

Author SHA1 Message Date
pb
fd6186c6df updated how we search for nodes 2025-05-15 10:28:55 +02:00
pb
5069b3455a updated how we search for nodes 2025-05-15 10:27:28 +02:00
3 changed files with 6 additions and 4 deletions

View File

@ -347,7 +347,7 @@ func (c *AdmiraltyController) GetNodeReady(){
return return
} }
node, err := serv.GetOneNode(c.Ctx.Request.Context(),execution) node, err := serv.GetOneNode(c.Ctx.Request.Context(),execution, peerId)
if err != nil { if err != nil {
// change code to 500 // change code to 500
c.Ctx.Output.SetStatus(500) c.Ctx.Output.SetStatus(500)

View File

@ -20,7 +20,7 @@ type Infrastructure interface {
CreateKubeconfigSecret(context context.Context, kubeconfig string, executionId string, peerId string) ([]byte, error) CreateKubeconfigSecret(context context.Context, kubeconfig string, executionId string, peerId string) ([]byte, error)
GetKubeconfigSecret(context context.Context, executionId string, peerId string) ([]byte, error) GetKubeconfigSecret(context context.Context, executionId string, peerId string) ([]byte, error)
CreateAdmiraltyTarget(context context.Context, executionId string, peerId string)([]byte,error) CreateAdmiraltyTarget(context context.Context, executionId string, peerId string)([]byte,error)
GetOneNode(context context.Context, executionID string) (*v1.Node, error) GetOneNode(context context.Context, executionID string, peerId string) (*v1.Node, error)
} }
var _service = map[string]func() (Infrastructure, error){ var _service = map[string]func() (Infrastructure, error){

View File

@ -510,7 +510,9 @@ func putCDRapiKube(client kubernetes.Clientset, ctx context.Context, path string
// Returns the Kubernetes' Node object corresponding to the executionID if it exists on this host // 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) // 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) { func (k *KubernetesService) GetOneNode(context context.Context, executionID string, peerId string) (*v1.Node, error) {
concatenatedName := getConcatenatedName(peerId, executionID)
res, err := k.Set.CoreV1(). res, err := k.Set.CoreV1().
Nodes(). Nodes().
List( List(
@ -524,7 +526,7 @@ func (k *KubernetesService) GetOneNode(context context.Context, executionID stri
} }
for _, node := range res.Items { for _, node := range res.Items {
if isNode := strings.Contains(node.Name, "admiralty-"+executionID+"-target-"+executionID+"-"); isNode { if isNode := strings.Contains(node.Name, "admiralty-"+ executionID +"-target-"+ concatenatedName + "-"); isNode {
return &node, nil return &node, nil
} }
} }