From 314022b4d2147f1984b9c02febeac644e3af0443 Mon Sep 17 00:00:00 2001 From: ISMAIL KABOUBI Date: Wed, 3 Jan 2024 19:22:23 +0100 Subject: [PATCH] feat(apis): adding logs apis --- apis/zz_register.go | 2 ++ config/external_name.go | 3 +++ config/logs/config.go | 20 ++++++++++++++++++++ config/provider.go | 3 +++ internal/controller/zz_setup.go | 4 ++++ 5 files changed, 32 insertions(+) create mode 100644 config/logs/config.go diff --git a/apis/zz_register.go b/apis/zz_register.go index c814c01..f9505fc 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -20,6 +20,7 @@ import ( v1alpha1dedicatedserver "github.com/edixos/provider-ovh/apis/dedicatedserver/v1alpha1" v1alpha1dns "github.com/edixos/provider-ovh/apis/dns/v1alpha1" v1alpha1lb "github.com/edixos/provider-ovh/apis/lb/v1alpha1" + v1alpha1logs "github.com/edixos/provider-ovh/apis/logs/v1alpha1" v1alpha1publiccloudnetwork "github.com/edixos/provider-ovh/apis/publiccloudnetwork/v1alpha1" v1alpha1apis "github.com/edixos/provider-ovh/apis/v1alpha1" v1beta1 "github.com/edixos/provider-ovh/apis/v1beta1" @@ -35,6 +36,7 @@ func init() { v1alpha1dedicatedserver.SchemeBuilder.AddToScheme, v1alpha1dns.SchemeBuilder.AddToScheme, v1alpha1lb.SchemeBuilder.AddToScheme, + v1alpha1logs.SchemeBuilder.AddToScheme, v1alpha1publiccloudnetwork.SchemeBuilder.AddToScheme, v1alpha1apis.SchemeBuilder.AddToScheme, v1beta1.SchemeBuilder.AddToScheme, diff --git a/config/external_name.go b/config/external_name.go index 22fd17d..791b555 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -50,6 +50,9 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "ovh_iploadbalancing_tcp_route": config.NameAsIdentifier, "ovh_iploadbalancing_tcp_route_rule": config.NameAsIdentifier, "ovh_iploadbalancing_vrack_network": config.NameAsIdentifier, + "ovh_dbaas_logs_cluster": config.NameAsIdentifier, + "ovh_dbaas_logs_graylog_output_stream": config.NameAsIdentifier, + "ovh_dbaas_logs_input": config.NameAsIdentifier, } // ExternalNameConfigurations applies all external name configs listed in the diff --git a/config/logs/config.go b/config/logs/config.go new file mode 100644 index 0000000..5ce5f67 --- /dev/null +++ b/config/logs/config.go @@ -0,0 +1,20 @@ +package logs + +import "github.com/crossplane/upjet/pkg/config" + +const ( + shortGroup = "logs" +) + +// Configure configures individual resources by adding custom ResourceConfigurators. +func Configure(p *config.Provider) { + p.AddResourceConfigurator("ovh_dbaas_logs_cluster", func(r *config.Resource) { + r.ShortGroup = shortGroup + }) + p.AddResourceConfigurator("ovh_dbaas_logs_graylog_output_stream", func(r *config.Resource) { + r.ShortGroup = shortGroup + }) + p.AddResourceConfigurator("ovh_dbaas_logs_input", func(r *config.Resource) { + r.ShortGroup = shortGroup + }) +} diff --git a/config/provider.go b/config/provider.go index db7e109..f63f358 100644 --- a/config/provider.go +++ b/config/provider.go @@ -8,6 +8,8 @@ import ( // Note(turkenh): we are importing this to embed provider schema document _ "embed" + "github.com/edixos/provider-ovh/config/logs" + "github.com/edixos/provider-ovh/config/lb" "github.com/edixos/provider-ovh/config/dns" @@ -56,6 +58,7 @@ func GetProvider() *ujconfig.Provider { dedicated_server.Configure, dns.Configure, lb.Configure, + logs.Configure, } { configure(pc) } diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 84f3aaf..5e0450f 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -46,6 +46,8 @@ import ( 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" + logscluster "github.com/edixos/provider-ovh/internal/controller/logs/logscluster" + logsinput "github.com/edixos/provider-ovh/internal/controller/logs/logsinput" 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" @@ -93,6 +95,8 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { tcproute.Setup, tcprouterule.Setup, vracknetwork.Setup, + logscluster.Setup, + logsinput.Setup, providerconfig.Setup, projectnetworkprivate.Setup, projectnetworkprivatesubnet.Setup,