Skip to content

Commit

Permalink
feat(apis): adding lb apis
Browse files Browse the repository at this point in the history
  • Loading branch information
smileisak committed Jan 3, 2024
1 parent f6a042b commit 71a3fde
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apis/zz_register.go

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

13 changes: 13 additions & 0 deletions config/external_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ var ExternalNameConfigs = map[string]config.ExternalName{
"ovh_domain_zone": config.NameAsIdentifier,
"ovh_domain_zone_record": config.NameAsIdentifier,
"ovh_domain_zone_redirection": config.NameAsIdentifier,
"ovh_iploadbalancing": config.NameAsIdentifier,
"ovh_iploadbalancing_http_farm": config.NameAsIdentifier,
"ovh_iploadbalancing_http_farm_server": config.NameAsIdentifier,
"ovh_iploadbalancing_http_frontend": config.NameAsIdentifier,
"ovh_iploadbalancing_http_route": config.NameAsIdentifier,
"ovh_iploadbalancing_http_route_rule": config.NameAsIdentifier,
"ovh_iploadbalancing_refresh": config.NameAsIdentifier,
"ovh_iploadbalancing_tcp_farm": config.NameAsIdentifier,
"ovh_iploadbalancing_tcp_farm_server": config.NameAsIdentifier,
"ovh_iploadbalancing_tcp_frontend": config.NameAsIdentifier,
"ovh_iploadbalancing_tcp_route": config.NameAsIdentifier,
"ovh_iploadbalancing_tcp_route_rule": config.NameAsIdentifier,
"ovh_iploadbalancing_vrack_network": config.NameAsIdentifier,
}

// ExternalNameConfigurations applies all external name configs listed in the
Expand Down
50 changes: 50 additions & 0 deletions config/lb/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package lb

import "github.com/crossplane/upjet/pkg/config"

const (
shortGroup = "lb"
)

// Configure configures individual resources by adding custom ResourceConfigurators.
func Configure(p *config.Provider) {
p.AddResourceConfigurator("ovh_iploadbalancing", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_iploadbalancing_http_farm", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_iploadbalancing_http_farm_server", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_iploadbalancing_http_frontend", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_iploadbalancing_http_route", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_iploadbalancing_http_route_rule", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_iploadbalancing_refresh", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_iploadbalancing_tcp_farm", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_iploadbalancing_tcp_farm_server", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_iploadbalancing_tcp_frontend", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_iploadbalancing_tcp_route", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_iploadbalancing_tcp_route_rule", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_iploadbalancing_vrack_network", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
}
3 changes: 3 additions & 0 deletions config/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
// Note(turkenh): we are importing this to embed provider schema document
_ "embed"

"github.com/edixos/provider-ovh/config/lb"

"github.com/edixos/provider-ovh/config/dns"

"github.com/edixos/provider-ovh/config/dedicated_server"
Expand Down Expand Up @@ -53,6 +55,7 @@ func GetProvider() *ujconfig.Provider {
cloud_disk_array.Configure,
dedicated_server.Configure,
dns.Configure,
lb.Configure,
} {
configure(pc)
}
Expand Down
26 changes: 26 additions & 0 deletions internal/controller/zz_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ import (
zone "github.com/edixos/provider-ovh/internal/controller/dns/zone"
zonerecord "github.com/edixos/provider-ovh/internal/controller/dns/zonerecord"
zoneredirection "github.com/edixos/provider-ovh/internal/controller/dns/zoneredirection"
httpfarm "github.com/edixos/provider-ovh/internal/controller/lb/httpfarm"
httpfarmserver "github.com/edixos/provider-ovh/internal/controller/lb/httpfarmserver"
httpfrontend "github.com/edixos/provider-ovh/internal/controller/lb/httpfrontend"
httproute "github.com/edixos/provider-ovh/internal/controller/lb/httproute"
httprouterule "github.com/edixos/provider-ovh/internal/controller/lb/httprouterule"
iploadbalancing "github.com/edixos/provider-ovh/internal/controller/lb/iploadbalancing"
refresh "github.com/edixos/provider-ovh/internal/controller/lb/refresh"
tcpfarm "github.com/edixos/provider-ovh/internal/controller/lb/tcpfarm"
tcpfarmserver "github.com/edixos/provider-ovh/internal/controller/lb/tcpfarmserver"
tcpfrontend "github.com/edixos/provider-ovh/internal/controller/lb/tcpfrontend"
tcproute "github.com/edixos/provider-ovh/internal/controller/lb/tcproute"
tcprouterule "github.com/edixos/provider-ovh/internal/controller/lb/tcprouterule"
vracknetwork "github.com/edixos/provider-ovh/internal/controller/lb/vracknetwork"
providerconfig "github.com/edixos/provider-ovh/internal/controller/providerconfig"
projectnetworkprivate "github.com/edixos/provider-ovh/internal/controller/publiccloudnetwork/projectnetworkprivate"
projectnetworkprivatesubnet "github.com/edixos/provider-ovh/internal/controller/publiccloudnetwork/projectnetworkprivatesubnet"
Expand Down Expand Up @@ -67,6 +80,19 @@ func Setup(mgr ctrl.Manager, o controller.Options) error {
zone.Setup,
zonerecord.Setup,
zoneredirection.Setup,
httpfarm.Setup,
httpfarmserver.Setup,
httpfrontend.Setup,
httproute.Setup,
httprouterule.Setup,
iploadbalancing.Setup,
refresh.Setup,
tcpfarm.Setup,
tcpfarmserver.Setup,
tcpfrontend.Setup,
tcproute.Setup,
tcprouterule.Setup,
vracknetwork.Setup,
providerconfig.Setup,
projectnetworkprivate.Setup,
projectnetworkprivatesubnet.Setup,
Expand Down

0 comments on commit 71a3fde

Please sign in to comment.