-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Decouples setup routines from the init() funcs to prepare for unit testing * Adds Init() method to providers interface * Adds HealthCheck() method to providers interface for using least expensive API call * Moves providers to individual packages * Moves DNS types and helper funcs to utils package
- Loading branch information
janeczku
committed
Jul 17, 2016
1 parent
018825d
commit 4821418
Showing
17 changed files
with
654 additions
and
617 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package config | ||
|
||
import ( | ||
"os" | ||
"strconv" | ||
|
||
"github.com/Sirupsen/logrus" | ||
"github.com/rancher/external-dns/utils" | ||
) | ||
|
||
var ( | ||
RootDomainName string | ||
TTL int | ||
CattleURL string | ||
CattleAccessKey string | ||
CattleSecretKey string | ||
) | ||
|
||
func SetFromEnvironment() { | ||
CattleURL = getEnv("CATTLE_URL") | ||
CattleAccessKey = getEnv("CATTLE_ACCESS_KEY") | ||
CattleSecretKey = getEnv("CATTLE_SECRET_KEY") | ||
RootDomainName = utils.Fqdn(getEnv("ROOT_DOMAIN")) | ||
TTLEnv := os.Getenv("TTL") | ||
i, err := strconv.Atoi(TTLEnv) | ||
if err != nil { | ||
TTL = 300 | ||
} else { | ||
TTL = i | ||
} | ||
} | ||
|
||
func getEnv(name string) string { | ||
envVar := os.Getenv(name) | ||
if len(envVar) == 0 { | ||
logrus.Fatalf("Environment variable '%s' is not set", name) | ||
} | ||
return envVar | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.