From 5b000a0d327e8037369c7dd9150229342fa82af1 Mon Sep 17 00:00:00 2001 From: ISMAIL KABOUBI Date: Wed, 3 Jan 2024 20:00:31 +0100 Subject: [PATCH] feat(apis): adding nas apis --- config/external_name.go | 3 +++ config/nas/config.go | 20 ++++++++++++++++++++ config/provider.go | 2 ++ 3 files changed, 25 insertions(+) create mode 100644 config/nas/config.go diff --git a/config/external_name.go b/config/external_name.go index ba60134..0a5aa42 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -75,6 +75,9 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "ovh_cloud_project_containerregistry": config.NameAsIdentifier, "ovh_cloud_project_containerregistry_oidc": config.NameAsIdentifier, "ovh_cloud_project_containerregistry_user": config.NameAsIdentifier, + "ovh_dedicated_nasha_partition": config.NameAsIdentifier, + "ovh_dedicated_nasha_partition_access": config.NameAsIdentifier, + "ovh_dedicated_nasha_partition_snapshot": config.NameAsIdentifier, } // ExternalNameConfigurations applies all external name configs listed in the diff --git a/config/nas/config.go b/config/nas/config.go new file mode 100644 index 0000000..1a9dcb7 --- /dev/null +++ b/config/nas/config.go @@ -0,0 +1,20 @@ +package nas + +import "github.com/crossplane/upjet/pkg/config" + +const ( + shortGroup = "nas" +) + +// Configure configures individual resources by adding custom ResourceConfigurators. +func Configure(p *config.Provider) { + p.AddResourceConfigurator("ovh_dedicated_nasha_partition", func(r *config.Resource) { + r.ShortGroup = shortGroup + }) + p.AddResourceConfigurator("ovh_dedicated_nasha_partition_access", func(r *config.Resource) { + r.ShortGroup = shortGroup + }) + p.AddResourceConfigurator("ovh_dedicated_nasha_partition_snapshot", func(r *config.Resource) { + r.ShortGroup = shortGroup + }) +} diff --git a/config/provider.go b/config/provider.go index 1e2829e..90e4e23 100644 --- a/config/provider.go +++ b/config/provider.go @@ -7,6 +7,7 @@ package config import ( // Note(turkenh): we are importing this to embed provider schema document _ "embed" + "github.com/edixos/provider-ovh/config/nas" "github.com/edixos/provider-ovh/config/registry" @@ -68,6 +69,7 @@ func GetProvider() *ujconfig.Provider { databases.Configure, kube.Configure, registry.Configure, + nas.Configure, } { configure(pc) }