Skip to content

Commit

Permalink
chore: test if controller type is supported when parsing config for u…
Browse files Browse the repository at this point in the history
…nifi
  • Loading branch information
kashalls committed Oct 16, 2024
1 parent 3324dcb commit 45fb92d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/webhook/init/dnsprovider/dnsprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,9 @@ func Init(config configuration.Config) (provider.Provider, error) {
return nil, fmt.Errorf("reading unifi configuration failed: %v", err)
}

if unifiConfig.ControllerType != "gateway" && unifiConfig.ControllerType != "standalone" {
return nil, fmt.Errorf("unsupported controller type: %s", unifiConfig.ControllerType)
}

return unifi.NewUnifiProvider(domainFilter, &unifiConfig)
}

0 comments on commit 45fb92d

Please sign in to comment.