Skip to content

Commit

Permalink
Merge pull request #47 from janeczku/parameterize-state
Browse files Browse the repository at this point in the history
Parameterize FQDN / Keep state on managed records
  • Loading branch information
Alena Prokharchyk authored Oct 23, 2016
2 parents 55ed9c4 + 07b8416 commit c6cc79e
Show file tree
Hide file tree
Showing 11 changed files with 462 additions and 24 deletions.
4 changes: 4 additions & 0 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions Godeps/_workspace/src/github.com/valyala/fasttemplate/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 85 additions & 0 deletions Godeps/_workspace/src/github.com/valyala/fasttemplate/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

175 changes: 175 additions & 0 deletions Godeps/_workspace/src/github.com/valyala/fasttemplate/template.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,29 @@ import (
"github.com/rancher/external-dns/utils"
)

const (
defaultNameTemplate = "%{{service_name}}.%{{stack_name}}.%{{environment_name}}"
)

var (
RootDomainName string
TTL int
CattleURL string
CattleAccessKey string
CattleSecretKey string
NameTemplate string
)

func SetFromEnvironment() {
CattleURL = getEnv("CATTLE_URL")
CattleAccessKey = getEnv("CATTLE_ACCESS_KEY")
CattleSecretKey = getEnv("CATTLE_SECRET_KEY")
RootDomainName = utils.Fqdn(getEnv("ROOT_DOMAIN"))
NameTemplate = os.Getenv("NAME_TEMPLATE")
if len(NameTemplate) == 0 {
NameTemplate = defaultNameTemplate
}

TTLEnv := os.Getenv("TTL")
i, err := strconv.Atoi(TTLEnv)
if err != nil {
Expand Down
Loading

0 comments on commit c6cc79e

Please sign in to comment.