messed this up during merge with master, secretClient needs to exist before eventhubClient
@@ -86,18 +86,6 @@ func main() {
os.Exit(1)
}
- resourceGroupManager := resourcemanagerresourcegroup.NewAzureResourceGroupManager()
- eventhubManagers := resourcemanagereventhub.AzureEventHubManagers
- eventhubNamespaceClient := resourcemanagereventhub.NewEventHubNamespaceClient(ctrl.Log.WithName("controllers").WithName("EventhubNamespace"))
- storageManagers := resourcemanagerstorage.AzureStorageManagers
- keyVaultManager := resourcemanagerkeyvault.AzureKeyVaultManager
- eventhubClient := resourcemanagereventhub.NewEventhubClient(secretClient, scheme)
- sqlServerManager := resourcemanagersql.NewAzureSqlServerManager(ctrl.Log.WithName("sqlservermanager").WithName("AzureSqlServer"))
- sqlDBManager := resourcemanagersql.NewAzureSqlDbManager(ctrl.Log.WithName("sqldbmanager").WithName("AzureSqlDb"))
- sqlFirewallRuleManager := resourcemanagersql.NewAzureSqlFirewallRuleManager(ctrl.Log.WithName("sqlfirewallrulemanager").WithName("AzureSqlFirewallRule"))
- sqlFailoverGroupManager := resourcemanagersql.NewAzureSqlFailoverGroupManager(ctrl.Log.WithName("sqlfailovergroupmanager").WithName("AzureSqlFailoverGroup"))
- sqlUserManager := resourcemanagersql.NewAzureSqlUserManager(ctrl.Log.WithName("sqlusermanager").WithName("AzureSqlUser"))
-
err = resourcemanagerconfig.ParseEnvironment()
if err != nil {
setupLog.Error(err, "unable to parse settings required to provision resources in Azure")
@@ -111,6 +99,18 @@ func main() {
secretClient = keyvaultSecrets.New(keyvaultName)
}
+ resourceGroupManager := resourcemanagerresourcegroup.NewAzureResourceGroupManager()
+ eventhubManagers := resourcemanagereventhub.AzureEventHubManagers
+ eventhubNamespaceClient := resourcemanagereventhub.NewEventHubNamespaceClient(ctrl.Log.WithName("controllers").WithName("EventhubNamespace"))
+ storageManagers := resourcemanagerstorage.AzureStorageManagers
+ keyVaultManager := resourcemanagerkeyvault.AzureKeyVaultManager
+ eventhubClient := resourcemanagereventhub.NewEventhubClient(secretClient, scheme)
+ sqlServerManager := resourcemanagersql.NewAzureSqlServerManager(ctrl.Log.WithName("sqlservermanager").WithName("AzureSqlServer"))
+ sqlDBManager := resourcemanagersql.NewAzureSqlDbManager(ctrl.Log.WithName("sqldbmanager").WithName("AzureSqlDb"))
+ sqlFirewallRuleManager := resourcemanagersql.NewAzureSqlFirewallRuleManager(ctrl.Log.WithName("sqlfirewallrulemanager").WithName("AzureSqlFirewallRule"))
+ sqlFailoverGroupManager := resourcemanagersql.NewAzureSqlFailoverGroupManager(ctrl.Log.WithName("sqlfailovergroupmanager").WithName("AzureSqlFailoverGroup"))
+ sqlUserManager := resourcemanagersql.NewAzureSqlUserManager(ctrl.Log.WithName("sqlusermanager").WithName("AzureSqlUser"))
+
err = (&controllers.StorageReconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("controllers").WithName("Storage"),
