Changed the return of the /kubeconfig to encoded kubeconfig
This commit is contained in:
parent
f75499d827
commit
ba3afc69be
@ -12,8 +12,8 @@ import (
|
|||||||
|
|
||||||
beego "github.com/beego/beego/v2/server/web"
|
beego "github.com/beego/beego/v2/server/web"
|
||||||
jwt "github.com/golang-jwt/jwt/v5"
|
jwt "github.com/golang-jwt/jwt/v5"
|
||||||
|
"gopkg.in/yaml.v2"
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/yaml"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type KubeInfo struct {
|
type KubeInfo struct {
|
||||||
@ -462,7 +462,19 @@ func (c *AdmiraltyController) GetAdmiraltyKubeconfig() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Data["json"] = kubeconfig
|
b, err := yaml.Marshal(kubeconfig)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Error while marshalling kubeconfig")
|
||||||
|
c.Ctx.Output.SetStatus(500)
|
||||||
|
c.Data["json"] = map[string]string{"error": err.Error()}
|
||||||
|
c.ServeJSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
encodedKubeconfig := base64.StdEncoding.EncodeToString(b)
|
||||||
|
c.Data["json"] = map[string]string{
|
||||||
|
"data": encodedKubeconfig,
|
||||||
|
}
|
||||||
|
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -7,13 +7,15 @@ boundary "remote oc-datacenter" as rocdc
|
|||||||
|
|
||||||
workflow --> locdc : POST /booking/ {booking object}
|
workflow --> locdc : POST /booking/ {booking object}
|
||||||
locdc --> locdc : create Namespace + ServiceAccount
|
locdc --> locdc : create Namespace + ServiceAccount
|
||||||
|
workflow --> rocdc : POST /boking/
|
||||||
|
rocdc --> rocdc : create \nNamespace + \nServiceAccount
|
||||||
monitord --> monitord : retrieves a Workflow to execute
|
monitord --> monitord : retrieves a Workflow to execute
|
||||||
monitord --> monitord : workflow needs repartited execution
|
monitord --> monitord : workflow needs repartited execution
|
||||||
monitord --> rocdc : POST /????? (route that use the same \nmethods as /booking/ to create NS & SA)
|
' monitord --> rocdc : POST /????? (route that use the same \nmethods as /booking/ to create NS & SA)
|
||||||
monitord --> rocdc : POST /admiralty/source
|
monitord --> rocdc : POST /admiralty/source
|
||||||
monitord --> rodc : GET /admiralty/token/:execution_id
|
monitord --> rocdc : GET /admiralty/kubeconfig/:execution_id
|
||||||
rocdc -> monitord : base64 encoded edited kubeconfig with token (**how to make it secure** ???)
|
rocdc -> monitord : base64 encoded edited kubeconfig with token (**how to make it secure** ???)
|
||||||
monitord --> locdc : POST /admiralty/secret/:execution_id
|
monitord --> locdc : POST /admiralty/secret/:execution_id
|
||||||
monitord --> locdc : POST /admiralty/target/:execution_id
|
monitord --> locdc : POST /admiralty/target/:execution_id
|
||||||
' locdc -> monitord : OK
|
monitord --> locdc : GET /admiralty/nodes/:execution_id \n(if the node is up it means ALL GOOD)
|
||||||
@enduml
|
@enduml
|
Loading…
Reference in New Issue
Block a user