mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-01-11 23:49:30 -05:00
[node operator] Use environment variable to specify CSP
Signed-off-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
parent
50ed6777c8
commit
e267102c92
@ -36,6 +36,8 @@ var (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
defaultAzureCloudConfigPath = "/etc/azure/azure.json"
|
defaultAzureCloudConfigPath = "/etc/azure/azure.json"
|
||||||
|
// constellationCSP is the environment variable stating which Cloud Service Provider Constellation is running on.
|
||||||
|
constellationCSP = "CONSTEL_CSP"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -46,12 +48,10 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var csp string
|
|
||||||
var cloudConfigPath string
|
var cloudConfigPath string
|
||||||
var metricsAddr string
|
var metricsAddr string
|
||||||
var enableLeaderElection bool
|
var enableLeaderElection bool
|
||||||
var probeAddr string
|
var probeAddr string
|
||||||
flag.StringVar(&csp, "csp", "", "Cloud Service Provider the image is running on")
|
|
||||||
flag.StringVar(&cloudConfigPath, "cloud-config", "", "Path to provider specific cloud config. Optional.")
|
flag.StringVar(&cloudConfigPath, "cloud-config", "", "Path to provider specific cloud config. Optional.")
|
||||||
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
|
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
|
||||||
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
|
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
|
||||||
@ -68,7 +68,8 @@ func main() {
|
|||||||
|
|
||||||
var cspClient cspAPI
|
var cspClient cspAPI
|
||||||
var clientErr error
|
var clientErr error
|
||||||
switch strings.ToLower(csp) {
|
csp := strings.ToLower(os.Getenv(constellationCSP))
|
||||||
|
switch csp {
|
||||||
case "azure":
|
case "azure":
|
||||||
if cloudConfigPath == "" {
|
if cloudConfigPath == "" {
|
||||||
cloudConfigPath = defaultAzureCloudConfigPath
|
cloudConfigPath = defaultAzureCloudConfigPath
|
||||||
|
Loading…
Reference in New Issue
Block a user