Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR - gh-726 Initial support for basic ingress support #733

Merged
merged 6 commits into from
Jul 19, 2024
6 changes: 3 additions & 3 deletions api/models/loadbalance_entry.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/restapi/configure_loxilb_rest_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func configureAPI(api *operations.LoxilbRestAPIAPI) http.Handler {

// Load balancer add and delete and get
api.PostConfigLoadbalancerHandler = operations.PostConfigLoadbalancerHandlerFunc(handler.ConfigPostLoadbalancer)
api.DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandler = operations.DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc(handler.ConfigDeleteLoadbalancer)
api.DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandler = operations.DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc(handler.ConfigDeleteLoadbalancer)
api.DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandler = operations.DeleteConfigLoadbalancerExternalipaddressIPAddressPortPortProtocolProtoHandlerFunc(handler.ConfigDeleteLoadbalancerWithoutPath)
api.GetConfigLoadbalancerAllHandler = operations.GetConfigLoadbalancerAllHandlerFunc(handler.ConfigGetLoadbalancer)
api.DeleteConfigLoadbalancerAllHandler = operations.DeleteConfigLoadbalancerAllHandlerFunc(handler.ConfigDeleteAllLoadbalancer)
Expand Down
188 changes: 94 additions & 94 deletions api/restapi/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions api/restapi/handler/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func ConfigPostLoadbalancer(params operations.PostConfigLoadbalancerParams) midd
lbRules.Serv.ProbeRetries = int(params.Attr.ServiceArguments.ProbeRetries)
lbRules.Serv.Name = params.Attr.ServiceArguments.Name
lbRules.Serv.Oper = cmn.LBOp(params.Attr.ServiceArguments.Oper)
lbRules.Serv.Path = params.Attr.ServiceArguments.Path
lbRules.Serv.HostUrl = params.Attr.ServiceArguments.Host

if lbRules.Serv.Proto == "sctp" {
for _, data := range params.Attr.SecondaryIPs {
Expand Down Expand Up @@ -78,18 +78,18 @@ func ConfigPostLoadbalancer(params operations.PostConfigLoadbalancerParams) midd
return &ResultResponse{Result: "Success"}
}

func ConfigDeleteLoadbalancer(params operations.DeleteConfigLoadbalancerUrlpathUrlpathExternalipaddressIPAddressPortPortProtocolProtoParams) middleware.Responder {
func ConfigDeleteLoadbalancer(params operations.DeleteConfigLoadbalancerHosturlHosturlExternalipaddressIPAddressPortPortProtocolProtoParams) middleware.Responder {
tk.LogIt(tk.LogDebug, "[API] Load balancer %s API called. url : %s\n", params.HTTPRequest.Method, params.HTTPRequest.URL)

var lbServ cmn.LbServiceArg
var lbRules cmn.LbRuleMod
lbServ.ServIP = params.IPAddress
lbServ.ServPort = uint16(params.Port)
lbServ.Proto = params.Proto
if params.Urlpath == "any" {
lbServ.Path = ""
if params.Hosturl == "any" {
lbServ.HostUrl = ""
} else {
lbServ.Path = params.Urlpath
lbServ.HostUrl = params.Hosturl
}
if params.Block != nil {
lbServ.BlockNum = uint16(*params.Block)
Expand All @@ -116,7 +116,7 @@ func ConfigDeleteLoadbalancerWithoutPath(params operations.DeleteConfigLoadbalan
lbServ.ServIP = params.IPAddress
lbServ.ServPort = uint16(params.Port)
lbServ.Proto = params.Proto
lbServ.Path = ""
lbServ.HostUrl = ""
if params.Block != nil {
lbServ.BlockNum = uint16(*params.Block)
}
Expand Down Expand Up @@ -165,7 +165,7 @@ func ConfigGetLoadbalancer(params operations.GetConfigLoadbalancerAllParams) mid
tmpSvc.Probeport = lb.Serv.ProbePort
tmpSvc.Name = lb.Serv.Name
tmpSvc.Snat = lb.Serv.Snat
tmpSvc.Path = lb.Serv.Path
tmpSvc.Host = lb.Serv.HostUrl

tmpLB.ServiceArguments = &tmpSvc

Expand Down
Loading
Loading