mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2026-05-05 06:36:11 +02:00
Auto-detect google-project if provider is Google and no project is su… (#492)
* Auto-detect google-project if provider is Google and no project is supplied. * Add changelog entry.
This commit is contained in:
parent
8989032e85
commit
f2a4efbcb4
@ -1,3 +1,4 @@
|
||||
- Google Provider: Add auto-detection of Google Project when running on GCP (#492) @drzero42
|
||||
- Add custom TTL support for DNSimple (#477) @jbowes
|
||||
- Fix docker build and delete vendor files which were not deleted (#473) @njuettner
|
||||
- DigitalOcean: DigitalOcean creates entries with host in them twice (#459) @njuettner
|
||||
|
||||
@ -21,6 +21,7 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"cloud.google.com/go/compute/metadata"
|
||||
"github.com/linki/instrumented_http"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
@ -133,6 +134,14 @@ func NewGoogleProvider(project string, domainFilter DomainFilter, zoneIDFilter Z
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if project == "" {
|
||||
mProject, mErr := metadata.ProjectID()
|
||||
if mErr == nil {
|
||||
log.Infof("Google project auto-detected: %s", mProject)
|
||||
project = mProject
|
||||
}
|
||||
}
|
||||
|
||||
provider := &GoogleProvider{
|
||||
project: project,
|
||||
domainFilter: domainFilter,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user