From 4afd6d9caec8425941b837960b18add470ae3bff Mon Sep 17 00:00:00 2001 From: Umit Demirtas Date: Thu, 19 Oct 2023 15:34:02 +0300 Subject: [PATCH] dhcp added --- config/dhcp/config.go | 18 ++++++++++++++++++ config/external_name.go | 3 +++ config/provider.go | 4 +++- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 config/dhcp/config.go diff --git a/config/dhcp/config.go b/config/dhcp/config.go new file mode 100644 index 0000000..d5cb467 --- /dev/null +++ b/config/dhcp/config.go @@ -0,0 +1,18 @@ +package apitoken + +import "github.com/upbound/upjet/pkg/config" + +// Configure configures individual resources by adding custom ResourceConfigurators. +func Configure(p *config.Provider) { + p.AddResourceConfigurator("nsxt_policy_dhcp_relay", func(r *config.Resource) { + r.ShortGroup = "dhcp" + r.Kind = "PolicyDhcpRelay" + r.Version = "v1alpha1" + }) + + p.AddResourceConfigurator("nsxt_policy_dhcp_server", func(r *config.Resource) { + r.ShortGroup = "dhcp" + r.Kind = "PolicyDhcpServer" + r.Version = "v1alpha1" + }) +} diff --git a/config/external_name.go b/config/external_name.go index e0d6fc0..f55497e 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -10,6 +10,9 @@ import "github.com/upbound/upjet/pkg/config" // provider. var ExternalNameConfigs = map[string]config.ExternalName{ // Import requires using a randomly generated ID from provider: nl-2e21sda + + "nsxt_policy_dhcp_relay": config.IdentifierFromProvider, + "nsxt_policy_dhcp_server": config.IdentifierFromProvider, } // ExternalNameConfigurations applies all external name configs listed in the diff --git a/config/provider.go b/config/provider.go index 2646695..a6380e4 100644 --- a/config/provider.go +++ b/config/provider.go @@ -9,6 +9,8 @@ import ( _ "embed" ujconfig "github.com/upbound/upjet/pkg/config" + + dhcp "github.com/ankasoftco/provider-vcd/config/dhcp" ) const ( @@ -34,7 +36,7 @@ func GetProvider() *ujconfig.Provider { for _, configure := range []func(provider *ujconfig.Provider){ // add custom config functions - + dhcp.Configure, } { configure(pc) }