added node to the returned data when it was found
This commit is contained in:
parent
b08e6a1e70
commit
4bfb16cba6
@ -345,6 +345,8 @@ func (c *AdmiraltyController) GetNodeReady(){
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
|
||||
resp, err := serv.GetKubeconfigSecret(c.Ctx.Request.Context(),execution)
|
||||
if err != nil {
|
||||
// change code to 500
|
||||
@ -359,7 +361,6 @@ func (c *AdmiraltyController) GetNodeReady(){
|
||||
c.ServeJSON()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// Extract JWT token RS265 encoded
|
||||
var editedKubeconfig map[string]interface{}
|
||||
@ -393,14 +394,15 @@ func (c *AdmiraltyController) GetNodeReady(){
|
||||
}
|
||||
|
||||
if *isExpired {
|
||||
c.Data["json"] = map[string]string{
|
||||
c.Data["json"] = map[string]interface{}{
|
||||
"token" : "token in the secret is expired and must be regenerated",
|
||||
"node": node,
|
||||
}
|
||||
c.Ctx.Output.SetStatus(410)
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
||||
c.Data["json"] = map[string]bool{"ok": true}
|
||||
c.Data["json"] = map[string]interface{}{"node": node,"token": true}
|
||||
c.ServeJSON()
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user