Skip to content

Commit

Permalink
dhcp added
Browse files Browse the repository at this point in the history
  • Loading branch information
Umit Demirtas authored and Umit Demirtas committed Oct 19, 2023
1 parent 0a70735 commit 4afd6d9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
18 changes: 18 additions & 0 deletions config/dhcp/config.go
Original file line number Diff line number Diff line change
@@ -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"
})
}
3 changes: 3 additions & 0 deletions config/external_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion config/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
_ "embed"

ujconfig "github.com/upbound/upjet/pkg/config"

dhcp "github.com/ankasoftco/provider-vcd/config/dhcp"
)

const (
Expand All @@ -34,7 +36,7 @@ func GetProvider() *ujconfig.Provider {

for _, configure := range []func(provider *ujconfig.Provider){
// add custom config functions

dhcp.Configure,
} {
configure(pc)
}
Expand Down

0 comments on commit 4afd6d9

Please sign in to comment.