Compare commits
2 Commits
feature/mu
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
fd6186c6df | ||
|
5069b3455a |
@ -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)
|
||||||
|
@ -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){
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user