Browse Source

Panic if we cannot set env var

Djordje Lukic 5 years ago
parent
commit
e992b4192c
1 changed files with 4 additions and 1 deletions
  1. 4 1
      azure/aci.go

+ 4 - 1
azure/aci.go

@@ -26,7 +26,10 @@ import (
 
 func init() {
 	// required to get auth.NewAuthorizerFromCLI() to work, otherwise getting "The access token has been obtained for wrong audience or resource 'https://vault.azure.net'."
-	_ = os.Setenv("AZURE_KEYVAULT_RESOURCE", "https://management.azure.com")
+	err := os.Setenv("AZURE_KEYVAULT_RESOURCE", "https://management.azure.com")
+	if err != nil {
+		panic("unable to set environment variable AZURE_KEYVAULT_RESOURCE")
+	}
 }
 
 func createACIContainers(ctx context.Context, aciContext store.AciContext, groupDefinition containerinstance.ContainerGroup) (c containerinstance.ContainerGroup, err error) {