From 4bfb16cba67617c137a6e73a941504e41a7ebc47 Mon Sep 17 00:00:00 2001 From: pb Date: Tue, 1 Apr 2025 11:46:32 +0200 Subject: [PATCH] added node to the returned data when it was found --- controllers/admiralty.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/controllers/admiralty.go b/controllers/admiralty.go index c3acb21..7a9c65c 100644 --- a/controllers/admiralty.go +++ b/controllers/admiralty.go @@ -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() }