config namespacing (#12)

This commit is contained in:
Michael Quigley 2022-08-15 15:08:58 -04:00
parent 6fcd952d68
commit 01ffe50889
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -67,7 +67,7 @@ func (self *tunnelHandler) Handle(params tunnel.TunnelParams, principal *rest_mo
logrus.Error(err)
return tunnel.NewTunnelInternalServerError().WithPayload(rest_model_zrok.ErrorMessage(err.Error()))
}
cfgId, err := self.createConfig(edge)
cfgId, err := self.createConfig(svcName, edge)
if err != nil {
logrus.Error(err)
return tunnel.NewTunnelInternalServerError().WithPayload(rest_model_zrok.ErrorMessage(err.Error()))
@ -117,13 +117,12 @@ func (self *tunnelHandler) Handle(params tunnel.TunnelParams, principal *rest_mo
})
}
func (self *tunnelHandler) createConfig(edge *rest_management_api_client.ZitiEdgeManagement) (cfgID string, err error) {
func (self *tunnelHandler) createConfig(svcName string, edge *rest_management_api_client.ZitiEdgeManagement) (cfgID string, err error) {
cfg := &model.ZrokAuth{Hello: "World"}
name := "zrok.auth.v1"
cfgCrt := &rest_model.ConfigCreate{
ConfigTypeID: &zrokAuthV1Id,
Data: cfg,
Name: &name,
Name: &svcName,
}
cfgReq := &config.CreateConfigParams{
Config: cfgCrt,