Skip to content

Commit c6cc79e

Browse files
author
Alena Prokharchyk
authored
Merge pull request #47 from janeczku/parameterize-state
Parameterize FQDN / Keep state on managed records
2 parents 55ed9c4 + 07b8416 commit c6cc79e

File tree

11 files changed

+462
-24
lines changed

11 files changed

+462
-24
lines changed

Diff for: Godeps/Godeps.json

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Godeps/_workspace/src/github.com/valyala/fasttemplate/LICENSE

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Godeps/_workspace/src/github.com/valyala/fasttemplate/README.md

+85
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Godeps/_workspace/src/github.com/valyala/fasttemplate/template.go

+175
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: config/config.go

+10
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,29 @@ import (
88
"github.com/rancher/external-dns/utils"
99
)
1010

11+
const (
12+
defaultNameTemplate = "%{{service_name}}.%{{stack_name}}.%{{environment_name}}"
13+
)
14+
1115
var (
1216
RootDomainName string
1317
TTL int
1418
CattleURL string
1519
CattleAccessKey string
1620
CattleSecretKey string
21+
NameTemplate string
1722
)
1823

1924
func SetFromEnvironment() {
2025
CattleURL = getEnv("CATTLE_URL")
2126
CattleAccessKey = getEnv("CATTLE_ACCESS_KEY")
2227
CattleSecretKey = getEnv("CATTLE_SECRET_KEY")
2328
RootDomainName = utils.Fqdn(getEnv("ROOT_DOMAIN"))
29+
NameTemplate = os.Getenv("NAME_TEMPLATE")
30+
if len(NameTemplate) == 0 {
31+
NameTemplate = defaultNameTemplate
32+
}
33+
2434
TTLEnv := os.Getenv("TTL")
2535
i, err := strconv.Atoi(TTLEnv)
2636
if err != nil {

0 commit comments

Comments
 (0)