diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4291ce10..1bd6bcb15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,8 @@ on: jobs: ci: uses: upbound/uptest/.github/workflows/provider-ci.yml@main + with: + go-version: 1.21 secrets: UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }} UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }} diff --git a/.github/workflows/native-provider-bump.yml b/.github/workflows/native-provider-bump.yml index 5e7377346..d140c4b4b 100644 --- a/.github/workflows/native-provider-bump.yml +++ b/.github/workflows/native-provider-bump.yml @@ -8,6 +8,6 @@ jobs: uses: upbound/uptest/.github/workflows/native-provider-bump.yml@main with: provider-source: hashicorp/azurerm - go-version: 1.19 + go-version: 1.21 secrets: TOKEN: ${{ secrets.OFFICIAL_PROVIDERS_GA_TOKEN }} diff --git a/.github/workflows/publish-service-artifacts.yml b/.github/workflows/publish-service-artifacts.yml index 59481c1c0..ec4f2aaff 100644 --- a/.github/workflows/publish-service-artifacts.yml +++ b/.github/workflows/publish-service-artifacts.yml @@ -23,6 +23,7 @@ jobs: subpackages: ${{ github.event.inputs.subpackages }} size: ${{ github.event.inputs.size }} concurrency: ${{ github.event.inputs.concurrency }} + go-version: 1.21 secrets: UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR_RC }} UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW_RC }} diff --git a/.github/workflows/updoc.yml b/.github/workflows/updoc.yml index 9cbde3c9f..767495349 100644 --- a/.github/workflows/updoc.yml +++ b/.github/workflows/updoc.yml @@ -8,5 +8,6 @@ jobs: uses: upbound/uptest/.github/workflows/provider-updoc.yml@main with: providers: "monolith config" + go-version: 1.21 secrets: UPBOUND_CI_PROD_BUCKET_SA: ${{ secrets.UPBOUND_CI_PROD_BUCKET_SA }} diff --git a/.github/workflows/uptest-all.yml b/.github/workflows/uptest-all.yml index ebb6eae9c..1ef8be4cd 100644 --- a/.github/workflows/uptest-all.yml +++ b/.github/workflows/uptest-all.yml @@ -5,7 +5,7 @@ on: env: # Common versions - GO_VERSION: '1.19' + GO_VERSION: '1.21' DOCKER_BUILDX_VERSION: 'v0.8.2' jobs: diff --git a/Makefile b/Makefile index 74b579e0e..c5e78d546 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ GO_TEST_PARALLEL := $(shell echo $$(( $(NPROCS) / 2 ))) # correctly. export GOPRIVATE = github.com/upbound/* -GO_REQUIRED_VERSION ?= 1.19 +GO_REQUIRED_VERSION ?= 1.21 # GOLANGCILINT_VERSION is inherited from build submodule by default. # Uncomment below if you need to override the version. # GOLANGCILINT_VERSION ?= 1.54.0 @@ -67,7 +67,7 @@ export SUBPACKAGES := $(SUBPACKAGES) KIND_VERSION = v0.15.0 UP_VERSION = v0.20.0 UP_CHANNEL = stable -UPTEST_VERSION = v0.6.1 +UPTEST_VERSION = v0.8.0 export UP_VERSION := $(UP_VERSION) export UP_CHANNEL := $(UP_CHANNEL) @@ -212,8 +212,8 @@ family-e2e: for m in $$(tr ',' ' ' <<< $${UPTEST_EXAMPLE_LIST}); do \ $(INFO) Processing the example manifest "$${m}"; \ for api in $$(sed -nE 's/^apiVersion: *(.+)/\1/p' "$${m}" | cut -d. -f1); do \ - if [[ $${api} == "v1" ]]; then \ - $(INFO) v1 is not a valid provider. Skipping...; \ + if [[ $${api} == "v1" || $${api} == "azure" ]]; then \ + $(INFO) $${api} is not a valid provider. Skipping...; \ continue; \ fi; \ if [[ $${INSTALL_APIS} =~ " $${api} " ]]; then \ @@ -242,7 +242,7 @@ crddiff: $(UPTEST) continue ; \ fi ; \ echo "Checking $${crd} for breaking API changes..." ; \ - changes_detected=$$($(UPTEST) crddiff revision <(git cat-file -p "$${GITHUB_BASE_REF}:$${crd}") "$${crd}" 2>&1) ; \ + changes_detected=$$($(UPTEST) crddiff revision --enable-upjet-extensions <(git cat-file -p "$${GITHUB_BASE_REF}:$${crd}") "$${crd}" 2>&1) ; \ if [[ $$? != 0 ]] ; then \ printf "\033[31m"; echo "Breaking change detected!"; printf "\033[0m" ; \ echo "$${changes_detected}" ; \ diff --git a/cmd/generator/main.go b/cmd/generator/main.go index 0e7f1781f..3092c5c43 100644 --- a/cmd/generator/main.go +++ b/cmd/generator/main.go @@ -15,6 +15,7 @@ package main import ( + "context" "encoding/json" "fmt" "os" @@ -42,7 +43,8 @@ func main() { if err != nil { panic(fmt.Sprintf("cannot calculate the absolute path with %s", *repoRoot)) } - p := config.GetProvider() + p, err := config.GetProvider(context.Background(), true) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") dumpGeneratedResourceList(p, generatedResourceList) dumpSkippedResourcesCSV(p, skippedResourcesCSV) pipeline.Run(p, absRootDir) diff --git a/cmd/provider/alertsmanagement/zz_main.go b/cmd/provider/alertsmanagement/zz_main.go index 23811c12e..63d38505b 100644 --- a/cmd/provider/alertsmanagement/zz_main.go +++ b/cmd/provider/alertsmanagement/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_alertsmanagement(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/analysisservices/zz_main.go b/cmd/provider/analysisservices/zz_main.go index beb90ba24..4b0ebf8e5 100644 --- a/cmd/provider/analysisservices/zz_main.go +++ b/cmd/provider/analysisservices/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_analysisservices(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/apimanagement/zz_main.go b/cmd/provider/apimanagement/zz_main.go index c7156043d..fd60a4d29 100644 --- a/cmd/provider/apimanagement/zz_main.go +++ b/cmd/provider/apimanagement/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_apimanagement(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/appconfiguration/zz_main.go b/cmd/provider/appconfiguration/zz_main.go index 7d34ef324..730390de6 100644 --- a/cmd/provider/appconfiguration/zz_main.go +++ b/cmd/provider/appconfiguration/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_appconfiguration(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/appplatform/zz_main.go b/cmd/provider/appplatform/zz_main.go index cfffd16ca..6a63d5909 100644 --- a/cmd/provider/appplatform/zz_main.go +++ b/cmd/provider/appplatform/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_appplatform(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/attestation/zz_main.go b/cmd/provider/attestation/zz_main.go index a7c7df289..5c4bf726c 100644 --- a/cmd/provider/attestation/zz_main.go +++ b/cmd/provider/attestation/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_attestation(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/authorization/zz_main.go b/cmd/provider/authorization/zz_main.go index daacd23ef..241548da1 100644 --- a/cmd/provider/authorization/zz_main.go +++ b/cmd/provider/authorization/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_authorization(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/automation/zz_main.go b/cmd/provider/automation/zz_main.go index da3810bbc..54fc3c75f 100644 --- a/cmd/provider/automation/zz_main.go +++ b/cmd/provider/automation/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_automation(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/azure/zz_main.go b/cmd/provider/azure/zz_main.go index ee43a8e90..c255d5a19 100644 --- a/cmd/provider/azure/zz_main.go +++ b/cmd/provider/azure/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_azure(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/azurestackhci/zz_main.go b/cmd/provider/azurestackhci/zz_main.go index f59de0e87..31ebdb458 100644 --- a/cmd/provider/azurestackhci/zz_main.go +++ b/cmd/provider/azurestackhci/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_azurestackhci(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/botservice/zz_main.go b/cmd/provider/botservice/zz_main.go index af8af12ed..a4b053ee7 100644 --- a/cmd/provider/botservice/zz_main.go +++ b/cmd/provider/botservice/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_botservice(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/cache/zz_main.go b/cmd/provider/cache/zz_main.go index 4697503b8..7a51fa272 100644 --- a/cmd/provider/cache/zz_main.go +++ b/cmd/provider/cache/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_cache(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/cdn/zz_main.go b/cmd/provider/cdn/zz_main.go index 8a3b90e0d..0bdd68935 100644 --- a/cmd/provider/cdn/zz_main.go +++ b/cmd/provider/cdn/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_cdn(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/certificateregistration/zz_main.go b/cmd/provider/certificateregistration/zz_main.go index b6e79f7b1..e611d1837 100644 --- a/cmd/provider/certificateregistration/zz_main.go +++ b/cmd/provider/certificateregistration/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_certificateregistration(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/cognitiveservices/zz_main.go b/cmd/provider/cognitiveservices/zz_main.go index 40ffd5d36..9b6746d76 100644 --- a/cmd/provider/cognitiveservices/zz_main.go +++ b/cmd/provider/cognitiveservices/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_cognitiveservices(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/communication/zz_main.go b/cmd/provider/communication/zz_main.go index 72da767d5..822a997e3 100644 --- a/cmd/provider/communication/zz_main.go +++ b/cmd/provider/communication/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_communication(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/compute/zz_main.go b/cmd/provider/compute/zz_main.go index 8981265e8..aca6df0db 100644 --- a/cmd/provider/compute/zz_main.go +++ b/cmd/provider/compute/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_compute(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/confidentialledger/zz_main.go b/cmd/provider/confidentialledger/zz_main.go index e32ff3e54..3734e0d5e 100644 --- a/cmd/provider/confidentialledger/zz_main.go +++ b/cmd/provider/confidentialledger/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_confidentialledger(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/config/zz_main.go b/cmd/provider/config/zz_main.go index 146d1b46f..292e122a9 100644 --- a/cmd/provider/config/zz_main.go +++ b/cmd/provider/config/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_config(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/consumption/zz_main.go b/cmd/provider/consumption/zz_main.go index 5150b26cc..df03e4720 100644 --- a/cmd/provider/consumption/zz_main.go +++ b/cmd/provider/consumption/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_consumption(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/containerapp/zz_main.go b/cmd/provider/containerapp/zz_main.go index f9a21548c..775893f79 100644 --- a/cmd/provider/containerapp/zz_main.go +++ b/cmd/provider/containerapp/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_containerapp(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/containerregistry/zz_main.go b/cmd/provider/containerregistry/zz_main.go index 106c7e706..c53348db7 100644 --- a/cmd/provider/containerregistry/zz_main.go +++ b/cmd/provider/containerregistry/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_containerregistry(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/containerservice/zz_main.go b/cmd/provider/containerservice/zz_main.go index e3ba1f792..1abc4d9ef 100644 --- a/cmd/provider/containerservice/zz_main.go +++ b/cmd/provider/containerservice/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_containerservice(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/cosmosdb/zz_main.go b/cmd/provider/cosmosdb/zz_main.go index 98bd2bdee..cfa52446c 100644 --- a/cmd/provider/cosmosdb/zz_main.go +++ b/cmd/provider/cosmosdb/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_cosmosdb(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/costmanagement/zz_main.go b/cmd/provider/costmanagement/zz_main.go index 8ae9b8a65..6995ee66a 100644 --- a/cmd/provider/costmanagement/zz_main.go +++ b/cmd/provider/costmanagement/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_costmanagement(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/customproviders/zz_main.go b/cmd/provider/customproviders/zz_main.go index ff4ff3cb5..d83c654ab 100644 --- a/cmd/provider/customproviders/zz_main.go +++ b/cmd/provider/customproviders/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_customproviders(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/databoxedge/zz_main.go b/cmd/provider/databoxedge/zz_main.go index 3f0ba6d46..1b278a2c2 100644 --- a/cmd/provider/databoxedge/zz_main.go +++ b/cmd/provider/databoxedge/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_databoxedge(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/databricks/zz_main.go b/cmd/provider/databricks/zz_main.go index 68a3da9aa..ffa607199 100644 --- a/cmd/provider/databricks/zz_main.go +++ b/cmd/provider/databricks/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_databricks(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/datafactory/zz_main.go b/cmd/provider/datafactory/zz_main.go index e3fa32d7f..f889e04cd 100644 --- a/cmd/provider/datafactory/zz_main.go +++ b/cmd/provider/datafactory/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_datafactory(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/datamigration/zz_main.go b/cmd/provider/datamigration/zz_main.go index 3d6fc74a2..beb67ea18 100644 --- a/cmd/provider/datamigration/zz_main.go +++ b/cmd/provider/datamigration/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_datamigration(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/dataprotection/zz_main.go b/cmd/provider/dataprotection/zz_main.go index 51d841163..1b8fa760c 100644 --- a/cmd/provider/dataprotection/zz_main.go +++ b/cmd/provider/dataprotection/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_dataprotection(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/datashare/zz_main.go b/cmd/provider/datashare/zz_main.go index 44a60a357..1ed878de9 100644 --- a/cmd/provider/datashare/zz_main.go +++ b/cmd/provider/datashare/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_datashare(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/dbformariadb/zz_main.go b/cmd/provider/dbformariadb/zz_main.go index 58c84a5f4..8c4423b9a 100644 --- a/cmd/provider/dbformariadb/zz_main.go +++ b/cmd/provider/dbformariadb/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_dbformariadb(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/dbformysql/zz_main.go b/cmd/provider/dbformysql/zz_main.go index 861a7abe5..7987470a0 100644 --- a/cmd/provider/dbformysql/zz_main.go +++ b/cmd/provider/dbformysql/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_dbformysql(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/dbforpostgresql/zz_main.go b/cmd/provider/dbforpostgresql/zz_main.go index 0b255fb86..0de9dcb4c 100644 --- a/cmd/provider/dbforpostgresql/zz_main.go +++ b/cmd/provider/dbforpostgresql/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_dbforpostgresql(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/devices/zz_main.go b/cmd/provider/devices/zz_main.go index c2a461c19..a8887a3fe 100644 --- a/cmd/provider/devices/zz_main.go +++ b/cmd/provider/devices/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_devices(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/deviceupdate/zz_main.go b/cmd/provider/deviceupdate/zz_main.go index bea4f70f9..a582df41e 100644 --- a/cmd/provider/deviceupdate/zz_main.go +++ b/cmd/provider/deviceupdate/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_deviceupdate(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/devtestlab/zz_main.go b/cmd/provider/devtestlab/zz_main.go index d8d6b6b17..854e1fa9b 100644 --- a/cmd/provider/devtestlab/zz_main.go +++ b/cmd/provider/devtestlab/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_devtestlab(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/digitaltwins/zz_main.go b/cmd/provider/digitaltwins/zz_main.go index 9fe2bc70a..80bab9978 100644 --- a/cmd/provider/digitaltwins/zz_main.go +++ b/cmd/provider/digitaltwins/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_digitaltwins(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/elastic/zz_main.go b/cmd/provider/elastic/zz_main.go index 52c215fbf..9084b4fbc 100644 --- a/cmd/provider/elastic/zz_main.go +++ b/cmd/provider/elastic/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_elastic(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/eventgrid/zz_main.go b/cmd/provider/eventgrid/zz_main.go index b3691022b..4f8e94787 100644 --- a/cmd/provider/eventgrid/zz_main.go +++ b/cmd/provider/eventgrid/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_eventgrid(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/eventhub/zz_main.go b/cmd/provider/eventhub/zz_main.go index fbcd97844..760484a9e 100644 --- a/cmd/provider/eventhub/zz_main.go +++ b/cmd/provider/eventhub/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_eventhub(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/fluidrelay/zz_main.go b/cmd/provider/fluidrelay/zz_main.go index bb5e996c8..902a24e6f 100644 --- a/cmd/provider/fluidrelay/zz_main.go +++ b/cmd/provider/fluidrelay/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_fluidrelay(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/guestconfiguration/zz_main.go b/cmd/provider/guestconfiguration/zz_main.go index fa4611f0b..25936674a 100644 --- a/cmd/provider/guestconfiguration/zz_main.go +++ b/cmd/provider/guestconfiguration/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_guestconfiguration(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/hdinsight/zz_main.go b/cmd/provider/hdinsight/zz_main.go index 08b798ed8..9d950ff05 100644 --- a/cmd/provider/hdinsight/zz_main.go +++ b/cmd/provider/hdinsight/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_hdinsight(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/healthbot/zz_main.go b/cmd/provider/healthbot/zz_main.go index 1ee08a652..dc1e3b8a6 100644 --- a/cmd/provider/healthbot/zz_main.go +++ b/cmd/provider/healthbot/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_healthbot(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/healthcareapis/zz_main.go b/cmd/provider/healthcareapis/zz_main.go index 5444a80fc..52c68668f 100644 --- a/cmd/provider/healthcareapis/zz_main.go +++ b/cmd/provider/healthcareapis/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_healthcareapis(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/insights/zz_main.go b/cmd/provider/insights/zz_main.go index 2c55a4415..287f04f27 100644 --- a/cmd/provider/insights/zz_main.go +++ b/cmd/provider/insights/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_insights(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/iotcentral/zz_main.go b/cmd/provider/iotcentral/zz_main.go index acde9e6a8..4b069fe8c 100644 --- a/cmd/provider/iotcentral/zz_main.go +++ b/cmd/provider/iotcentral/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_iotcentral(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/keyvault/zz_main.go b/cmd/provider/keyvault/zz_main.go index fd36d17e0..f6b503919 100644 --- a/cmd/provider/keyvault/zz_main.go +++ b/cmd/provider/keyvault/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_keyvault(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/kusto/zz_main.go b/cmd/provider/kusto/zz_main.go index ef891018d..3adb8e364 100644 --- a/cmd/provider/kusto/zz_main.go +++ b/cmd/provider/kusto/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_kusto(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/labservices/zz_main.go b/cmd/provider/labservices/zz_main.go index 7a61a9cf9..471a677c7 100644 --- a/cmd/provider/labservices/zz_main.go +++ b/cmd/provider/labservices/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_labservices(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/loadtestservice/zz_main.go b/cmd/provider/loadtestservice/zz_main.go index e1037eac6..fc0c63dff 100644 --- a/cmd/provider/loadtestservice/zz_main.go +++ b/cmd/provider/loadtestservice/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_loadtestservice(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/logic/zz_main.go b/cmd/provider/logic/zz_main.go index 5bb7991ca..45467b92d 100644 --- a/cmd/provider/logic/zz_main.go +++ b/cmd/provider/logic/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_logic(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/logz/zz_main.go b/cmd/provider/logz/zz_main.go index 72d75af57..62ab37903 100644 --- a/cmd/provider/logz/zz_main.go +++ b/cmd/provider/logz/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_logz(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/machinelearningservices/zz_main.go b/cmd/provider/machinelearningservices/zz_main.go index 84364188b..11ae1a733 100644 --- a/cmd/provider/machinelearningservices/zz_main.go +++ b/cmd/provider/machinelearningservices/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_machinelearningservices(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/maintenance/zz_main.go b/cmd/provider/maintenance/zz_main.go index 907a5a7e2..29ab62983 100644 --- a/cmd/provider/maintenance/zz_main.go +++ b/cmd/provider/maintenance/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_maintenance(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/managedidentity/zz_main.go b/cmd/provider/managedidentity/zz_main.go index 8161a7c89..e106c1959 100644 --- a/cmd/provider/managedidentity/zz_main.go +++ b/cmd/provider/managedidentity/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_managedidentity(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/management/zz_main.go b/cmd/provider/management/zz_main.go index 237dc34c6..9139554a2 100644 --- a/cmd/provider/management/zz_main.go +++ b/cmd/provider/management/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_management(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/maps/zz_main.go b/cmd/provider/maps/zz_main.go index 52dfc2016..8ff0f002b 100644 --- a/cmd/provider/maps/zz_main.go +++ b/cmd/provider/maps/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_maps(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/marketplaceordering/zz_main.go b/cmd/provider/marketplaceordering/zz_main.go index 1107c05f9..e0d6b16fa 100644 --- a/cmd/provider/marketplaceordering/zz_main.go +++ b/cmd/provider/marketplaceordering/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_marketplaceordering(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/media/zz_main.go b/cmd/provider/media/zz_main.go index 4e80d2744..97e008061 100644 --- a/cmd/provider/media/zz_main.go +++ b/cmd/provider/media/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_media(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/mixedreality/zz_main.go b/cmd/provider/mixedreality/zz_main.go index c1a443827..c2c69c7ce 100644 --- a/cmd/provider/mixedreality/zz_main.go +++ b/cmd/provider/mixedreality/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_mixedreality(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/monolith/zz_main.go b/cmd/provider/monolith/zz_main.go index 06cf29737..32e6eefc0 100644 --- a/cmd/provider/monolith/zz_main.go +++ b/cmd/provider/monolith/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_monolith(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/netapp/zz_main.go b/cmd/provider/netapp/zz_main.go index 7ba9fc68d..3285d1859 100644 --- a/cmd/provider/netapp/zz_main.go +++ b/cmd/provider/netapp/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_netapp(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/network/zz_main.go b/cmd/provider/network/zz_main.go index af66401c0..98554d117 100644 --- a/cmd/provider/network/zz_main.go +++ b/cmd/provider/network/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_network(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/notificationhubs/zz_main.go b/cmd/provider/notificationhubs/zz_main.go index 743e78510..f779e1f7a 100644 --- a/cmd/provider/notificationhubs/zz_main.go +++ b/cmd/provider/notificationhubs/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_notificationhubs(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/operationalinsights/zz_main.go b/cmd/provider/operationalinsights/zz_main.go index 9ed74e2d0..46a0d8be3 100644 --- a/cmd/provider/operationalinsights/zz_main.go +++ b/cmd/provider/operationalinsights/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_operationalinsights(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/operationsmanagement/zz_main.go b/cmd/provider/operationsmanagement/zz_main.go index fee524841..248c8aead 100644 --- a/cmd/provider/operationsmanagement/zz_main.go +++ b/cmd/provider/operationsmanagement/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_operationsmanagement(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/orbital/zz_main.go b/cmd/provider/orbital/zz_main.go index 6be23bbe4..9c82c0433 100644 --- a/cmd/provider/orbital/zz_main.go +++ b/cmd/provider/orbital/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_orbital(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/policyinsights/zz_main.go b/cmd/provider/policyinsights/zz_main.go index 060bbf54e..2372e13a6 100644 --- a/cmd/provider/policyinsights/zz_main.go +++ b/cmd/provider/policyinsights/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_policyinsights(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/portal/zz_main.go b/cmd/provider/portal/zz_main.go index 97ac99a12..b61d2dd81 100644 --- a/cmd/provider/portal/zz_main.go +++ b/cmd/provider/portal/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_portal(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/powerbidedicated/zz_main.go b/cmd/provider/powerbidedicated/zz_main.go index 1dbe21572..a40ccb39b 100644 --- a/cmd/provider/powerbidedicated/zz_main.go +++ b/cmd/provider/powerbidedicated/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_powerbidedicated(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/purview/zz_main.go b/cmd/provider/purview/zz_main.go index 24e3898ce..cd5e4a473 100644 --- a/cmd/provider/purview/zz_main.go +++ b/cmd/provider/purview/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_purview(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/recoveryservices/zz_main.go b/cmd/provider/recoveryservices/zz_main.go index 03ea85ea4..5ddc7e468 100644 --- a/cmd/provider/recoveryservices/zz_main.go +++ b/cmd/provider/recoveryservices/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_recoveryservices(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/relay/zz_main.go b/cmd/provider/relay/zz_main.go index 24e3f3431..165ddae2f 100644 --- a/cmd/provider/relay/zz_main.go +++ b/cmd/provider/relay/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_relay(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/resources/zz_main.go b/cmd/provider/resources/zz_main.go index 394a260ee..fd036c769 100644 --- a/cmd/provider/resources/zz_main.go +++ b/cmd/provider/resources/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_resources(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/search/zz_main.go b/cmd/provider/search/zz_main.go index bf278d91a..869cddce6 100644 --- a/cmd/provider/search/zz_main.go +++ b/cmd/provider/search/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_search(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/security/zz_main.go b/cmd/provider/security/zz_main.go index 41dbfed97..453399b03 100644 --- a/cmd/provider/security/zz_main.go +++ b/cmd/provider/security/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_security(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/securityinsights/zz_main.go b/cmd/provider/securityinsights/zz_main.go index ba50dfd05..0f3a9af66 100644 --- a/cmd/provider/securityinsights/zz_main.go +++ b/cmd/provider/securityinsights/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_securityinsights(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/servicebus/zz_main.go b/cmd/provider/servicebus/zz_main.go index e7656d377..4d27512ee 100644 --- a/cmd/provider/servicebus/zz_main.go +++ b/cmd/provider/servicebus/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_servicebus(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/servicefabric/zz_main.go b/cmd/provider/servicefabric/zz_main.go index 12eb75443..b92ce1fa9 100644 --- a/cmd/provider/servicefabric/zz_main.go +++ b/cmd/provider/servicefabric/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_servicefabric(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/servicelinker/zz_main.go b/cmd/provider/servicelinker/zz_main.go index f362d25a0..40ed48f3d 100644 --- a/cmd/provider/servicelinker/zz_main.go +++ b/cmd/provider/servicelinker/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_servicelinker(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/signalrservice/zz_main.go b/cmd/provider/signalrservice/zz_main.go index 48439fa14..d32c3eb68 100644 --- a/cmd/provider/signalrservice/zz_main.go +++ b/cmd/provider/signalrservice/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_signalrservice(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/solutions/zz_main.go b/cmd/provider/solutions/zz_main.go index 152a48162..da4732f98 100644 --- a/cmd/provider/solutions/zz_main.go +++ b/cmd/provider/solutions/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_solutions(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/spring/zz_main.go b/cmd/provider/spring/zz_main.go index 1d37146ee..792f35344 100644 --- a/cmd/provider/spring/zz_main.go +++ b/cmd/provider/spring/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_spring(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/sql/zz_main.go b/cmd/provider/sql/zz_main.go index e85cb9ecd..f42ef4925 100644 --- a/cmd/provider/sql/zz_main.go +++ b/cmd/provider/sql/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_sql(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/storage/zz_main.go b/cmd/provider/storage/zz_main.go index 94d0293cc..2a0f9de8a 100644 --- a/cmd/provider/storage/zz_main.go +++ b/cmd/provider/storage/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_storage(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/storagecache/zz_main.go b/cmd/provider/storagecache/zz_main.go index 61e3f6c7b..9ca4a9232 100644 --- a/cmd/provider/storagecache/zz_main.go +++ b/cmd/provider/storagecache/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_storagecache(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/storagepool/zz_main.go b/cmd/provider/storagepool/zz_main.go index 8f7d98663..c338b42b9 100644 --- a/cmd/provider/storagepool/zz_main.go +++ b/cmd/provider/storagepool/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_storagepool(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/storagesync/zz_main.go b/cmd/provider/storagesync/zz_main.go index 84a011101..822d22c03 100644 --- a/cmd/provider/storagesync/zz_main.go +++ b/cmd/provider/storagesync/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_storagesync(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/streamanalytics/zz_main.go b/cmd/provider/streamanalytics/zz_main.go index 75ada0e2c..4cf66329e 100644 --- a/cmd/provider/streamanalytics/zz_main.go +++ b/cmd/provider/streamanalytics/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_streamanalytics(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/synapse/zz_main.go b/cmd/provider/synapse/zz_main.go index d9f606183..52d0bc6b0 100644 --- a/cmd/provider/synapse/zz_main.go +++ b/cmd/provider/synapse/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_synapse(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/timeseriesinsights/zz_main.go b/cmd/provider/timeseriesinsights/zz_main.go index f96b6f367..d253328e8 100644 --- a/cmd/provider/timeseriesinsights/zz_main.go +++ b/cmd/provider/timeseriesinsights/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_timeseriesinsights(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/cmd/provider/web/zz_main.go b/cmd/provider/web/zz_main.go index fef232ed6..2b2dcc18c 100644 --- a/cmd/provider/web/zz_main.go +++ b/cmd/provider/web/zz_main.go @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_web(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/config/apimanagement/config.go b/config/apimanagement/config.go index be4d8e216..f950f5c17 100644 --- a/config/apimanagement/config.go +++ b/config/apimanagement/config.go @@ -20,13 +20,13 @@ import ( "github.com/crossplane/upjet/pkg/config" "github.com/upbound/provider-azure/apis/rconfig" + "github.com/upbound/provider-azure/config/common" ) // Configure configures apimanagement group func Configure(p *config.Provider) { p.AddResourceConfigurator("azurerm_api_management", func(r *config.Resource) { r.Kind = "Management" - r.UseAsync = false // Mutually exclusive with azurerm_api_management_custom_domain config.MoveToStatus(r.TerraformResource, "hostname_configuration") }) @@ -101,4 +101,7 @@ func Configure(p *config.Provider) { Extractor: rconfig.ExtractResourceIDFuncPath, } }) + p.AddResourceConfigurator("azurerm_api_management_gateway", func(r *config.Resource) { + r.ExternalName.IdentifierFields = common.RemoveIndex(r.ExternalName.IdentifierFields, "api_management_id") + }) } diff --git a/config/authorization/config.go b/config/authorization/config.go index 52f27915e..84c264eb9 100644 --- a/config/authorization/config.go +++ b/config/authorization/config.go @@ -18,6 +18,8 @@ package authorization import ( "github.com/crossplane/upjet/pkg/config" + + "github.com/upbound/provider-azure/config/common" ) // Configure configures authorization group @@ -27,4 +29,7 @@ func Configure(p *config.Provider) { IgnoredFields: []string{"role_definition_id"}, } }) + p.AddResourceConfigurator("azurerm_resource_group_policy_assignment", func(r *config.Resource) { + r.ExternalName.IdentifierFields = common.RemoveIndex(r.ExternalName.IdentifierFields, "resource_group_id") + }) } diff --git a/config/base/config.go b/config/base/config.go index 0c5680b23..65dda98eb 100644 --- a/config/base/config.go +++ b/config/base/config.go @@ -23,7 +23,6 @@ import ( // Configure configures the base group func Configure(p *config.Provider) { p.AddResourceConfigurator("azurerm_subscription", func(r *config.Resource) { - r.UseAsync = false r.ShortGroup = "" r.LateInitializer = config.LateInitializer{ IgnoredFields: []string{"billing_scope_id", "subscription_id"}, @@ -31,7 +30,6 @@ func Configure(p *config.Provider) { }) p.AddResourceConfigurator("azurerm_resource_provider_registration", func(r *config.Resource) { - r.UseAsync = false r.ShortGroup = "" }) diff --git a/config/common/common.go b/config/common/common.go index d80ffd2ae..dc039c6d9 100644 --- a/config/common/common.go +++ b/config/common/common.go @@ -45,6 +45,9 @@ const ( ErrFmtUnexpectedType = `unexpected type for attribute %s: Expecting a string` // ErrGetPasswordSecret is an error string for failing to get password secret ErrGetPasswordSecret = "cannot get password secret" + // VersionV1Beta1 is used for resources that meet the v1beta1 criteria + // here: https://github.com/upbound/arch/pull/33 + VersionV1Beta1 = "v1beta1" // nameReferenceKind represents name reference kind nameReferenceKind = "name" @@ -224,3 +227,13 @@ func PasswordGenerator(secretRefFieldPath, toggleFieldPath string) tjconfig.NewI }) } } + +func RemoveIndex(s []string, elementToRemove string) []string { + var result []string + for _, value := range s { + if value != elementToRemove { + result = append(result, value) + } + } + return result +} diff --git a/config/compute/config.go b/config/compute/config.go index 48f3a02dc..ee18da679 100644 --- a/config/compute/config.go +++ b/config/compute/config.go @@ -5,9 +5,10 @@ Copyright 2022 Upbound Inc. package compute import ( - "github.com/upbound/provider-azure/apis/rconfig" - "github.com/crossplane/upjet/pkg/config" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + + "github.com/upbound/provider-azure/apis/rconfig" ) // Configure configures cosmodb group @@ -21,10 +22,26 @@ func Configure(p *config.Provider) { IgnoredFields: []string{"platform_fault_domain", "virtual_machine_scale_set_id"}, } + r.TerraformCustomDiff = func(diff *terraform.InstanceDiff, _ *terraform.InstanceState, _ *terraform.ResourceConfig) (*terraform.InstanceDiff, error) { + if diff != nil && diff.Attributes != nil { + delete(diff.Attributes, "termination_notification.#") + } + return diff, nil + } }) p.AddResourceConfigurator("azurerm_linux_virtual_machine_scale_set", func(r *config.Resource) { // In version 3.38.0 the `scale_in_policy` parameter was removed, and replaced by `scale_in` config.MoveToStatus(r.TerraformResource, "scale_in_policy") + r.TerraformCustomDiff = func(diff *terraform.InstanceDiff, _ *terraform.InstanceState, _ *terraform.ResourceConfig) (*terraform.InstanceDiff, error) { + if diff != nil && diff.Attributes != nil { + delete(diff.Attributes, "termination_notification.#") + delete(diff.Attributes, "terminate_notification.#") + delete(diff.Attributes, "gallery_application.#") + delete(diff.Attributes, "gallery_applications.#") + delete(diff.Attributes, "spot_restore.#") + } + return diff, nil + } }) p.AddResourceConfigurator("azurerm_windows_virtual_machine", func(r *config.Resource) { r.References["network_interface_ids"] = config.Reference{ @@ -42,6 +59,16 @@ func Configure(p *config.Provider) { IgnoredFields: []string{"scale_in_policy"}, } r.MetaResource.ArgumentDocs["scale_in_policy"] = "Deprecated: scaleInPolicy will be removed in favour of the scaleIn code block." + r.TerraformCustomDiff = func(diff *terraform.InstanceDiff, _ *terraform.InstanceState, _ *terraform.ResourceConfig) (*terraform.InstanceDiff, error) { + if diff != nil && diff.Attributes != nil { + delete(diff.Attributes, "termination_notification.#") + delete(diff.Attributes, "terminate_notification.#") + delete(diff.Attributes, "gallery_application.#") + delete(diff.Attributes, "gallery_applications.#") + delete(diff.Attributes, "spot_restore.#") + } + return diff, nil + } }) p.AddResourceConfigurator("azurerm_virtual_machine_extension", func(r *config.Resource) { r.Kind = "VirtualMachineExtension" @@ -53,6 +80,14 @@ func Configure(p *config.Provider) { Extractor: rconfig.ExtractResourceIDFuncPath, } }) + p.AddResourceConfigurator("azurerm_orchestrated_virtual_machine_scale_set", func(r *config.Resource) { + r.TerraformCustomDiff = func(diff *terraform.InstanceDiff, _ *terraform.InstanceState, _ *terraform.ResourceConfig) (*terraform.InstanceDiff, error) { + if diff != nil && diff.Attributes != nil { + delete(diff.Attributes, "termination_notification.#") + } + return diff, nil + } + }) /* Note on testing: * - create a storage account * - upload a text file with *.vhd extension diff --git a/config/containerregistry/config.go b/config/containerregistry/config.go index 6b1df8edd..a5265d26f 100644 --- a/config/containerregistry/config.go +++ b/config/containerregistry/config.go @@ -4,6 +4,7 @@ import ( "github.com/crossplane/upjet/pkg/config" "github.com/upbound/provider-azure/apis/rconfig" + "github.com/upbound/provider-azure/config/common" ) // Configure configures containerregistry group @@ -30,5 +31,10 @@ func Configure(p *config.Provider) { Type: "Token", Extractor: rconfig.ExtractResourceIDFuncPath, } + r.ExternalName.IdentifierFields = common.RemoveIndex(r.ExternalName.IdentifierFields, "container_registry_id") + }) + + p.AddResourceConfigurator("azurerm_container_registry_webhook", func(r *config.Resource) { + r.ExternalName.IdentifierFields = common.RemoveIndex(r.ExternalName.IdentifierFields, "registry_name") }) } diff --git a/config/externalname.go b/config/externalname.go index ee633dace..0f219dc6c 100644 --- a/config/externalname.go +++ b/config/externalname.go @@ -5,14 +5,17 @@ import ( "fmt" "strings" + "github.com/upbound/provider-azure/config/common" + "github.com/pkg/errors" "github.com/crossplane/upjet/pkg/config" ) -// ExternalNameConfigs is a map of external name configurations for the whole -// provider. -var ExternalNameConfigs = map[string]config.ExternalName{ +// NoForkExternalNameConfigs contains all external name configurations +// belonging to Terraform resources to be reconciled under the no-fork +// architecture for this provider. +var NoForkExternalNameConfigs = map[string]config.ExternalName{ // apimanagement // API Management Services can be imported using the resource id // /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1 @@ -61,7 +64,7 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "azurerm_api_management_email_template": config.TemplatedStringAsIdentifier("", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.ApiManagement/service/{{ .parameters.api_management_name }}/templates/{{ .parameters.template_name }}"), // API Management Gateways can be imported using the resource id // /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/gateways/gateway1 - "azurerm_api_management_gateway": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.ApiManagement/service/{{ .parameters.api_management_name }}/gateways/{{ .external_name }}"), + "azurerm_api_management_gateway": config.TemplatedStringAsIdentifier("name", "{{ .parameters.api_management_id }}/gateways/{{ .external_name }}"), // API Management AAD Identity Provider can be imported using the resource id // /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/identityProviders/aad "azurerm_api_management_identity_provider_aad": config.TemplatedStringAsIdentifier("", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.ApiManagement/service/{{ .parameters.api_management_name }}/identityProviders/aad"), @@ -121,7 +124,7 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "azurerm_api_management_global_schema": config.TemplatedStringAsIdentifier("schema_id", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.ApiManagement/service/{{ .parameters.api_management_name }}/schemas/{{ .external_name }}"), // authorization - "azurerm_resource_group_policy_assignment": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.Authorization/policyAssignments/{{ .external_name }}"), + "azurerm_resource_group_policy_assignment": config.TemplatedStringAsIdentifier("name", "{{ .parameters.resource_group_id }}/providers/Microsoft.Authorization/policyAssignments/{{ .external_name }}"), "azurerm_role_assignment": config.IdentifierFromProvider, // /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Authorization/locks/lock1 "azurerm_management_lock": config.IdentifierFromProvider, @@ -200,7 +203,7 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "azurerm_snapshot": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.Compute/snapshots/{{ .external_name }}"), // Arguments make up the ID. "azurerm_marketplace_agreement": config.IdentifierFromProvider, - "azurerm_dedicated_host": config.TemplatedStringAsIdentifier("name", "{{ .parameters.dedicated_host_group_id }}/hosts/{ .external_name }}"), + "azurerm_dedicated_host": config.TemplatedStringAsIdentifier("name", "{{ .parameters.dedicated_host_group_id }}/hosts/{{ .external_name }}"), // /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/galleries/gallery1/applications/galleryApplication1 "azurerm_gallery_application": config.TemplatedStringAsIdentifier("name", "{{ .parameters.gallery_id }}/applications/{{ .external_name }}"), // /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/galleries/gallery1/applications/galleryApplication1/versions/galleryApplicationVersion1 @@ -386,8 +389,8 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "azurerm_container_registry_agent_pool": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.ContainerRegistry/registries/{{ .parameters.container_registry_name }}/agentPools/{{ .external_name }}"), "azurerm_container_registry_scope_map": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.ContainerRegistry/registries/{{ .parameters.container_registry_name }}/scopeMaps/{{ .external_name }}"), "azurerm_container_registry_token": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.ContainerRegistry/registries/{{ .parameters.container_registry_name }}/tokens/{{ .external_name }}"), - "azurerm_container_registry_webhook": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.ContainerRegistry/registries/{{ .parameters.container_registry_name }}/webHooks/{{ .external_name }}"), - "azurerm_container_connected_registry": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.ContainerRegistry/registries/{{ .parameters.container_registry_name }}/connectedRegistries/{{ .external_name }}"), + "azurerm_container_registry_webhook": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.ContainerRegistry/registries/{{ .parameters.registry_name }}/webHooks/{{ .external_name }}"), + "azurerm_container_connected_registry": config.TemplatedStringAsIdentifier("name", "{{ .parameters.container_registry_id }}/connectedRegistries/{{ .external_name }}"), // /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/tokens/token1/passwords/password "azurerm_container_registry_token_password": config.IdentifierFromProvider, @@ -548,7 +551,7 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "azurerm_nat_gateway": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.Network/natGateways/{{ .external_name }}"), "azurerm_network_watcher": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.Network/networkWatchers/{{ .external_name }}"), "azurerm_network_watcher_flow_log": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.Network/networkWatchers/{{ .parameters.network_watcher_name }}/flowLogs/{{ .external_name }}"), - "azurerm_network_connection_monitor": config.TemplatedStringAsIdentifier("name", "{{ .parameters.network_watcher_id }}/backendAddressPools/{{ .connectionMonitors }}"), + "azurerm_network_connection_monitor": config.TemplatedStringAsIdentifier("name", "{{ .parameters.network_watcher_id }}/connectionMonitors/{{ .external_name }}"), "azurerm_network_ddos_protection_plan": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.Network/ddosProtectionPlans/{{ .external_name }}"), "azurerm_application_security_group": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.Network/applicationSecurityGroups/{{ .external_name }}"), "azurerm_network_security_group": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.Network/networkSecurityGroups/{{ .external_name }}"), @@ -792,11 +795,11 @@ var ExternalNameConfigs = map[string]config.ExternalName{ // Following _Case 6_ from the **Adding a New Resource** guide "azurerm_storage_account_network_rules": config.IdentifierFromProvider, "azurerm_storage_blob": config.TemplatedStringAsIdentifier("name", "https://{{ .parameters.storage_account_name }}.blob.core.windows.net/{{ .parameters.storage_container_name }}/{{ .external_name }}"), - "azurerm_storage_blob_inventory_policy": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.Storage/storageAccounts/{{ .storage_account_id }}/inventoryPolicies/Default"), + "azurerm_storage_blob_inventory_policy": config.IdentifierFromProvider, "azurerm_storage_container": config.TemplatedStringAsIdentifier("name", "https://{{ .parameters.storage_account_name }}.blob.core.windows.net/{{ .external_name }}"), "azurerm_storage_data_lake_gen2_filesystem": storageDataLakeGen2Filesystem(), - "azurerm_storage_encryption_scope": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.Storage/storageAccounts/{{ .storage_account_id }}/encryptionScopes/{{ .external_name }}"), - "azurerm_storage_management_policy": config.TemplatedStringAsIdentifier("", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.Storage/storageAccounts/{{ .storage_account_id }}/managementPolicies/default"), + "azurerm_storage_encryption_scope": config.TemplatedStringAsIdentifier("name", "{{ .parameters.storage_account_id }}/encryptionScopes/{{ .external_name }}"), + "azurerm_storage_management_policy": config.TemplatedStringAsIdentifier("", "{{ .parameters.storage_account_id }}/managementPolicies/default"), // The id of this resource is a concatenation of 2 resource names, but in the terraform documentation // this reasource does not have a name so instead it concatenates destination and target storage account IDs "azurerm_storage_object_replication": config.IdentifierFromProvider, @@ -1875,6 +1878,8 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "azurerm_load_test": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.LoadTestService/loadTests/{{ .external_name }}"), } +var CLIReconciledExternalNameConfigs = map[string]config.ExternalName{} + func keyVaultURLIDConf(resourceType string) config.ExternalName { e := config.IdentifierFromProvider e.GetExternalNameFn = func(tfstate map[string]any) (string, error) { @@ -2017,25 +2022,24 @@ func managementGroupSubscriptionAssociation() config.ExternalName { return e } -// ExternalNameConfigurations adds all external name configurations from -// the main table ExternalNameConfigs. -func ExternalNameConfigurations() config.ResourceOption { +// ResourceConfigurator applies all external name configs +// listed in the table NoForkExternalNameConfigs and +// CLIReconciledExternalNameConfigs and sets the version +// of those resources to v1beta1. For those resource in +// NoForkExternalNameConfigs, it also sets +// config.Resource.UseNoForkClient to `true`. +func ResourceConfigurator() config.ResourceOption { return func(r *config.Resource) { - if e, ok := ExternalNameConfigs[r.Name]; ok { - r.ExternalName = e - r.Version = "v1beta1" + // if configured both for the no-fork and CLI based architectures, + // no-fork configuration prevails + e, configured := NoForkExternalNameConfigs[r.Name] + if !configured { + e, configured = CLIReconciledExternalNameConfigs[r.Name] } + if !configured { + return + } + r.Version = common.VersionV1Beta1 + r.ExternalName = e } } - -// ResourcesWithExternalNameConfig returns a list of resources that have external -// name config defined in the external name table. -func ResourcesWithExternalNameConfig() []string { - l := make([]string, len(ExternalNameConfigs)) - i := 0 - for r := range ExternalNameConfigs { - l[i] = r + "$" - i++ - } - return l -} diff --git a/config/management/config.go b/config/management/config.go index 8a160bab2..e00e329f6 100644 --- a/config/management/config.go +++ b/config/management/config.go @@ -25,7 +25,6 @@ import ( // Configure configures management group func Configure(p *config.Provider) { p.AddResourceConfigurator("azurerm_management_group", func(r *config.Resource) { - r.UseAsync = false r.Kind = "ManagementGroup" }) p.AddResourceConfigurator("azurerm_management_group_subscription_association", func(r *config.Resource) { diff --git a/config/mariadb/config.go b/config/mariadb/config.go index af52995f8..851073d21 100644 --- a/config/mariadb/config.go +++ b/config/mariadb/config.go @@ -44,7 +44,4 @@ func Configure(p *config.Provider) { }, nil } }) - p.AddResourceConfigurator("azurerm_mariadb_configuration", func(r *config.Resource) { - r.UseAsync = false - }) } diff --git a/config/network/config.go b/config/network/config.go index 21da5e96e..e54d27532 100644 --- a/config/network/config.go +++ b/config/network/config.go @@ -18,6 +18,7 @@ package network import ( "github.com/crossplane/upjet/pkg/config" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/upbound/provider-azure/apis/rconfig" ) @@ -25,12 +26,10 @@ import ( // Configure configures virtual group func Configure(p *config.Provider) { p.AddResourceConfigurator("azurerm_ip_group", func(r *config.Resource) { - r.UseAsync = false r.Kind = "IPGroup" }) p.AddResourceConfigurator("azurerm_network_interface", func(r *config.Resource) { - r.UseAsync = false r.Kind = "NetworkInterface" }) @@ -130,12 +129,10 @@ func Configure(p *config.Provider) { }) p.AddResourceConfigurator("azurerm_network_watcher", func(r *config.Resource) { - r.UseAsync = false r.Kind = "Watcher" }) p.AddResourceConfigurator("azurerm_network_watcher_flow_log", func(r *config.Resource) { - r.UseAsync = false r.References["network_watcher_name"] = config.Reference{ Type: "Watcher", } @@ -151,7 +148,6 @@ func Configure(p *config.Provider) { }) p.AddResourceConfigurator("azurerm_network_connection_monitor", func(r *config.Resource) { - r.UseAsync = false r.Kind = "ConnectionMonitor" r.References["network_watcher_id"] = config.Reference{ Type: "Watcher", @@ -160,12 +156,10 @@ func Configure(p *config.Provider) { }) p.AddResourceConfigurator("azurerm_network_ddos_protection_plan", func(r *config.Resource) { - r.UseAsync = false r.Kind = "DDoSProtectionPlan" }) p.AddResourceConfigurator("azurerm_network_security_rule", func(r *config.Resource) { - r.UseAsync = false r.References["network_security_group_name"] = config.Reference{ Type: "SecurityGroup", } @@ -247,7 +241,6 @@ func Configure(p *config.Provider) { }) p.AddResourceConfigurator("azurerm_network_profile", func(r *config.Resource) { - r.UseAsync = false r.References["container_network_interface.ip_configuration.subnet_id"] = config.Reference{ Type: "Subnet", Extractor: rconfig.ExtractResourceIDFuncPath, @@ -255,14 +248,12 @@ func Configure(p *config.Provider) { }) p.AddResourceConfigurator("azurerm_private_dns_a_record", func(r *config.Resource) { - r.UseAsync = false r.References["zone_name"] = config.Reference{ Type: "PrivateDNSZone", } }) p.AddResourceConfigurator("azurerm_private_dns_aaaa_record", func(r *config.Resource) { - r.UseAsync = false r.References["zone_name"] = config.Reference{ Type: "PrivateDNSZone", } @@ -275,28 +266,24 @@ func Configure(p *config.Provider) { }) p.AddResourceConfigurator("azurerm_private_dns_mx_record", func(r *config.Resource) { - r.UseAsync = false r.References["zone_name"] = config.Reference{ Type: "PrivateDNSZone", } }) p.AddResourceConfigurator("azurerm_private_dns_ptr_record", func(r *config.Resource) { - r.UseAsync = false r.References["zone_name"] = config.Reference{ Type: "PrivateDNSZone", } }) p.AddResourceConfigurator("azurerm_private_dns_srv_record", func(r *config.Resource) { - r.UseAsync = false r.References["zone_name"] = config.Reference{ Type: "PrivateDNSZone", } }) p.AddResourceConfigurator("azurerm_private_dns_txt_record", func(r *config.Resource) { - r.UseAsync = false r.References["zone_name"] = config.Reference{ Type: "PrivateDNSZone", } @@ -551,7 +538,6 @@ func Configure(p *config.Provider) { }) p.AddResourceConfigurator("azurerm_frontdoor", func(r *config.Resource) { - r.UseAsync = false r.Kind = "FrontDoor" }) @@ -607,30 +593,6 @@ func Configure(p *config.Provider) { } }) - p.AddResourceConfigurator("azurerm_application_security_group", func(r *config.Resource) { - r.UseAsync = false - }) - - p.AddResourceConfigurator("azurerm_private_dns_zone", func(r *config.Resource) { - r.UseAsync = false - }) - - p.AddResourceConfigurator("azurerm_public_ip", func(r *config.Resource) { - r.UseAsync = false - }) - - p.AddResourceConfigurator("azurerm_public_ip_prefix", func(r *config.Resource) { - r.UseAsync = false - }) - - p.AddResourceConfigurator("azurerm_network_security_group", func(r *config.Resource) { - r.UseAsync = false - }) - - p.AddResourceConfigurator("azurerm_virtual_network", func(r *config.Resource) { - r.UseAsync = false - }) - p.AddResourceConfigurator("azurerm_virtual_hub_connection", func(r *config.Resource) { r.References["routing.associated_route_table_id"] = config.Reference{ TerraformName: "azurerm_virtual_hub_route_table", @@ -644,4 +606,13 @@ func Configure(p *config.Provider) { Extractor: rconfig.ExtractResourceIDFuncPath, } }) + + p.AddResourceConfigurator("azurerm_network_manager_management_group_connection", func(r *config.Resource) { + r.TerraformCustomDiff = func(diff *terraform.InstanceDiff, _ *terraform.InstanceState, _ *terraform.ResourceConfig) (*terraform.InstanceDiff, error) { + if diff != nil && diff.Attributes != nil { + delete(diff.Attributes, "network_manager_id") + } + return diff, nil + } + }) } diff --git a/config/postgresql/config.go b/config/postgresql/config.go index 0a9698d79..c5321302b 100644 --- a/config/postgresql/config.go +++ b/config/postgresql/config.go @@ -51,7 +51,6 @@ func Configure(p *config.Provider) { }) p.AddResourceConfigurator("azurerm_postgresql_flexible_server_configuration", func(r *config.Resource) { - r.UseAsync = false r.References["server_id"] = config.Reference{ Type: "FlexibleServer", Extractor: rconfig.ExtractResourceIDFuncPath, @@ -145,7 +144,6 @@ func Configure(p *config.Provider) { }) p.AddResourceConfigurator("azurerm_postgresql_configuration", func(r *config.Resource) { - r.UseAsync = false r.References["server_name"] = config.Reference{ Type: "Server", } diff --git a/config/provider.go b/config/provider.go index b56d2e83a..282c32a1a 100644 --- a/config/provider.go +++ b/config/provider.go @@ -18,8 +18,15 @@ package config import ( // Note(ezgidemirel): we are importing this to embed provider schema document + "context" _ "embed" + conversiontfjson "github.com/crossplane/upjet/pkg/types/conversion/tfjson" + tfjson "github.com/hashicorp/terraform-json" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-azurerm/xpprovider" + "github.com/pkg/errors" + tjconfig "github.com/crossplane/upjet/pkg/config" "github.com/crossplane/upjet/pkg/registry/reference" @@ -156,19 +163,51 @@ var skipList = []string{ "azurerm_cdn_frontdoor_route_disable_link_to_default_domain", } +// workaround for the TF Azure v3.57.0-based no-fork release: We would like to +// keep the types in the generated CRDs intact +// (prevent number->int type replacements). +func getProviderSchema(s string) (*schema.Provider, error) { + ps := tfjson.ProviderSchemas{} + if err := ps.UnmarshalJSON([]byte(s)); err != nil { + panic(err) + } + if len(ps.Schemas) != 1 { + return nil, errors.Errorf("there should exactly be 1 provider schema but there are %d", len(ps.Schemas)) + } + var rs map[string]*tfjson.Schema + for _, v := range ps.Schemas { + rs = v.ResourceSchemas + break + } + return &schema.Provider{ + ResourcesMap: conversiontfjson.GetV2ResourceMap(rs), + }, nil +} + // GetProvider returns provider configuration -func GetProvider() *tjconfig.Provider { +func GetProvider(ctx context.Context, generationProvider bool) (*tjconfig.Provider, error) { + var p *schema.Provider + var err error + if generationProvider { + p, err = getProviderSchema(providerSchema) + } else { + p, err = xpprovider.GetProviderSchema(ctx) + } + if err != nil { + return nil, errors.Wrapf(err, "cannot get the Terraform provider schema with generation mode set to %t", generationProvider) + } + pc := tjconfig.NewProvider([]byte(providerSchema), resourcePrefix, modulePath, providerMetadata, tjconfig.WithShortName("azure"), tjconfig.WithRootGroup("azure.upbound.io"), - tjconfig.WithIncludeList(ResourcesWithExternalNameConfig()), + tjconfig.WithIncludeList(CLIReconciledResourceList()), + tjconfig.WithNoForkIncludeList(NoForkResourceList()), tjconfig.WithSkipList(skipList), - tjconfig.WithDefaultResourceOptions( - ExternalNameConfigurations(), - ), + tjconfig.WithDefaultResourceOptions(ResourceConfigurator()), tjconfig.WithReferenceInjectors([]tjconfig.ReferenceInjector{reference.NewInjector(modulePath)}), tjconfig.WithFeaturesPackage("internal/features"), tjconfig.WithMainTemplate(hack.MainTemplate), + tjconfig.WithTerraformProvider(p), ) // "azure" group contains resources that actually do not have a specific // group, e.g. ResourceGroup with APIVersion "azure.upbound.io/v1beta1". @@ -248,5 +287,33 @@ func GetProvider() *tjconfig.Provider { panic(err) } } - return pc + return pc, nil +} + +// CLIReconciledResourceList returns the list of resources that have external +// name configured in ExternalNameConfigs table and to be reconciled under +// the TF CLI based architecture. +func CLIReconciledResourceList() []string { + l := make([]string, len(CLIReconciledExternalNameConfigs)) + i := 0 + for name := range CLIReconciledExternalNameConfigs { + // Expected format is regex and we'd like to have exact matches. + l[i] = name + "$" + i++ + } + return l +} + +// NoForkResourceList returns the list of resources that have external +// name configured in ExternalNameConfigs table and to be reconciled under +// the no-fork architecture. +func NoForkResourceList() []string { + l := make([]string, len(NoForkExternalNameConfigs)) + i := 0 + for name := range NoForkExternalNameConfigs { + // Expected format is regex and we'd like to have exact matches. + l[i] = name + "$" + i++ + } + return l } diff --git a/config/sql/config.go b/config/sql/config.go index 38d71a822..0ddfe2e22 100644 --- a/config/sql/config.go +++ b/config/sql/config.go @@ -62,7 +62,6 @@ func Configure(p *config.Provider) { }) p.AddResourceConfigurator("azurerm_mssql_server_transparent_data_encryption", func(r *config.Resource) { - r.UseAsync = false r.References["server_id"] = config.Reference{ Type: "MSSQLServer", Extractor: rconfig.ExtractResourceIDFuncPath, diff --git a/config/storage/config.go b/config/storage/config.go index 2d35961f8..642f78be8 100644 --- a/config/storage/config.go +++ b/config/storage/config.go @@ -17,9 +17,10 @@ limitations under the License. package storage import ( - "github.com/upbound/provider-azure/apis/rconfig" - "github.com/crossplane/upjet/pkg/config" + + "github.com/upbound/provider-azure/apis/rconfig" + "github.com/upbound/provider-azure/config/common" ) // Configure configures storage group @@ -45,4 +46,12 @@ func Configure(p *config.Provider) { Extractor: rconfig.ExtractResourceIDFuncPath, } }) + + p.AddResourceConfigurator("azurerm_storage_encryption_scope", func(r *config.Resource) { + r.ExternalName.IdentifierFields = common.RemoveIndex(r.ExternalName.IdentifierFields, "storage_account_id") + }) + + p.AddResourceConfigurator("azurerm_storage_management_policy", func(r *config.Resource) { + r.ExternalName.IdentifierFields = common.RemoveIndex(r.ExternalName.IdentifierFields, "storage_account_id") + }) } diff --git a/config/storagesync/config.go b/config/storagesync/config.go index 5d5dd9b41..521ae9276 100644 --- a/config/storagesync/config.go +++ b/config/storagesync/config.go @@ -23,7 +23,6 @@ import ( // Configure configures storagesync group func Configure(p *config.Provider) { p.AddResourceConfigurator("azurerm_storage_sync", func(r *config.Resource) { - r.UseAsync = false r.Kind = "StorageSync" }) } diff --git a/examples/apimanagement/rediscache.yaml b/examples/apimanagement/rediscache.yaml index b918038e2..ec6c37020 100644 --- a/examples/apimanagement/rediscache.yaml +++ b/examples/apimanagement/rediscache.yaml @@ -14,9 +14,6 @@ spec: redisCacheIdSelector: matchLabels: testing.upbound.io/example-name: example - redisCacheIdSelector: - matchLabels: - testing.upbound.io/example-name: example cacheLocation: East Us connectionStringSecretRef: key: attribute.primary_connection_string @@ -31,7 +28,7 @@ metadata: meta.upbound.io/example-id: apimanagement/v1beta1/rediscache labels: testing.upbound.io/example-name: example - name: example + name: example-redis-cache-${Rand.RFC1123Subdomain} spec: writeConnectionSecretToRef: namespace: upbound-system diff --git a/examples/authorization/resourcegrouppolicyassignment.yaml b/examples/authorization/resourcegrouppolicyassignment.yaml index 887f627b0..64ce2b49f 100644 --- a/examples/authorization/resourcegrouppolicyassignment.yaml +++ b/examples/authorization/resourcegrouppolicyassignment.yaml @@ -8,7 +8,7 @@ spec: forProvider: policyDefinitionIdSelector: matchLabels: - testing.upbound.io/example-name: example + testing.upbound.io/example-name: example-auth resourceGroupIdSelector: matchLabels: testing.upbound.io/example-name: example-auth diff --git a/examples/azure/resourcegroup.yaml b/examples/azure/resourcegroup.yaml index 98b1d9951..7a048275e 100644 --- a/examples/azure/resourcegroup.yaml +++ b/examples/azure/resourcegroup.yaml @@ -1,7 +1,7 @@ apiVersion: azure.upbound.io/v1beta1 kind: ResourceGroup metadata: - name: example-resources + name: example-resources-${Rand.RFC1123Subdomain} spec: forProvider: location: "West Europe" diff --git a/examples/containerregistry/tokenpassword.yaml b/examples/containerregistry/tokenpassword.yaml index 8c342cc0a..ffd2df9d4 100644 --- a/examples/containerregistry/tokenpassword.yaml +++ b/examples/containerregistry/tokenpassword.yaml @@ -13,7 +13,7 @@ spec: matchLabels: testing.upbound.io/example-name: tokenpasswordtoken password1: - - expiry: "2023-03-22T17:57:36+08:00" + - expiry: "2024-03-22T17:57:36+08:00" --- diff --git a/examples/dataprotection/backuppolicyblobstorage.yaml b/examples/dataprotection/backuppolicyblobstorage.yaml index f17ceeaf0..df5152145 100644 --- a/examples/dataprotection/backuppolicyblobstorage.yaml +++ b/examples/dataprotection/backuppolicyblobstorage.yaml @@ -6,4 +6,30 @@ spec: forProvider: retentionDuration: P30D vaultIdRef: - name: example + name: example-backuppolicyblobstorage-vault + +--- + +apiVersion: dataprotection.azure.upbound.io/v1beta1 +kind: BackupVault +metadata: + name: example-backuppolicyblobstorage-vault +spec: + forProvider: + datastoreType: VaultStore + location: West Europe + redundancy: LocallyRedundant + resourceGroupNameRef: + name: example-rg-backuppolicyblobstorage + +--- + +apiVersion: azure.upbound.io/v1beta1 +kind: ResourceGroup +metadata: + name: example-rg-backuppolicyblobstorage +spec: + forProvider: + location: West Europe + tags: + provisioner: crossplane diff --git a/examples/dbforpostgresql/server-all-in-one.yaml b/examples/dbforpostgresql/server-all-in-one.yaml index 27660982c..02691a425 100644 --- a/examples/dbforpostgresql/server-all-in-one.yaml +++ b/examples/dbforpostgresql/server-all-in-one.yaml @@ -6,6 +6,7 @@ metadata: name: example spec: forProvider: + login: anotheradmin objectId: ${data.azurerm_client_config.current.object_id} resourceGroupNameSelector: matchLabels: diff --git a/examples/network/applicationgateway.yaml b/examples/network/applicationgateway.yaml index 192149a56..914cda6b9 100644 --- a/examples/network/applicationgateway.yaml +++ b/examples/network/applicationgateway.yaml @@ -47,8 +47,8 @@ spec: testing.upbound.io/example-name: example sku: - capacity: 2 - name: Standard_Small - tier: Standard + name: Standard_v2 + tier: Standard_v2 --- diff --git a/examples/network/frontdoor-all-in-one.yaml b/examples/network/frontdoor-all-in-one.yaml index 82a09cb4d..f6c1c88d8 100644 --- a/examples/network/frontdoor-all-in-one.yaml +++ b/examples/network/frontdoor-all-in-one.yaml @@ -54,7 +54,7 @@ metadata: spec: forProvider: customHttpsProvisioningEnabled: false - frontendEndpointId: /subscriptions/038f2b7c-3265-43b8-8624-c9ad5da610a8/resourceGroups/example-frontdoor-rg/providers/Microsoft.Network/frontDoors/example/frontendEndpoints/example + frontendEndpointId: /subscriptions/2895a7df-ae9f-41b8-9e78-3ce4926df838/resourceGroups/example-frontdoor-rg/providers/Microsoft.Network/frontDoors/example/frontendEndpoints/example --- apiVersion: network.azure.upbound.io/v1beta1 diff --git a/examples/network/subnet.yaml b/examples/network/subnet.yaml new file mode 100644 index 000000000..6b6bcec15 --- /dev/null +++ b/examples/network/subnet.yaml @@ -0,0 +1,57 @@ +apiVersion: network.azure.upbound.io/v1beta1 +kind: Subnet +metadata: + annotations: + meta.upbound.io/example-id: network/v1beta1/subnet + labels: + testing.upbound.io/example-name: example + name: example-subnet +spec: + forProvider: + addressPrefixes: + - 10.0.1.0/24 + delegation: + - name: delegation + serviceDelegation: + - actions: + - Microsoft.Network/virtualNetworks/subnets/action + name: Microsoft.ContainerInstance/containerGroups + resourceGroupNameSelector: + matchLabels: + testing.upbound.io/example-name: example + virtualNetworkNameSelector: + matchLabels: + testing.upbound.io/example-name: example + +--- + +apiVersion: azure.upbound.io/v1beta1 +kind: ResourceGroup +metadata: + annotations: + meta.upbound.io/example-id: network/v1beta1/subnet + labels: + testing.upbound.io/example-name: example + name: example-subnet +spec: + forProvider: + location: West Europe + +--- + +apiVersion: network.azure.upbound.io/v1beta1 +kind: VirtualNetwork +metadata: + annotations: + meta.upbound.io/example-id: network/v1beta1/subnet + labels: + testing.upbound.io/example-name: example + name: example-subnet +spec: + forProvider: + addressSpace: + - 10.0.0.0/16 + location: West Europe + resourceGroupNameSelector: + matchLabels: + testing.upbound.io/example-name: example diff --git a/examples/resources/resourcegrouptemplatedeployment.yaml b/examples/resources/resourcegrouptemplatedeployment.yaml index c14c53f04..8d9913273 100644 --- a/examples/resources/resourcegrouptemplatedeployment.yaml +++ b/examples/resources/resourcegrouptemplatedeployment.yaml @@ -10,11 +10,11 @@ spec: forProvider: deploymentMode: Incremental parametersContent: |- - ${jsonencode({ - "vnetName" = { - value = "example-vnet" - } - })} + { + "vnetName": { + "value": "example-vnet" + } + } resourceGroupNameSelector: matchLabels: testing.upbound.io/example-name: example @@ -35,8 +35,8 @@ spec: { "type": "Microsoft.Network/virtualNetworks", "apiVersion": "2020-05-01", - "name": "[parameters('vnetName')]", - "location": "[resourceGroup().location]", + "name": "example-vnet", + "location": "westeurope", "properties": { "addressSpace": { "addressPrefixes": [ diff --git a/examples/web/appactiveslot.yaml b/examples/web/appactiveslot.yaml index 7bde370c8..37037b037 100644 --- a/examples/web/appactiveslot.yaml +++ b/examples/web/appactiveslot.yaml @@ -4,85 +4,83 @@ metadata: annotations: meta.upbound.io/example-id: web/v1beta1/appactiveslot labels: - testing.upbound.io/example-name: exampleappactiveslot - name: exampleappactiveslot + testing.upbound.io/example-name: example + name: example spec: forProvider: slotIdSelector: matchLabels: - testing.upbound.io/example-name: appactiveslot-lsl + testing.upbound.io/example-name: example --- -apiVersion: web.azure.upbound.io/v1beta1 -kind: LinuxWebAppSlot +apiVersion: azure.upbound.io/v1beta1 +kind: ResourceGroup metadata: annotations: meta.upbound.io/example-id: web/v1beta1/appactiveslot labels: - testing.upbound.io/example-name: appactiveslot-lsl - name: appactiveslot-lsl + testing.upbound.io/example-name: example + name: appactiveslot-rg spec: forProvider: - name: appactiveslot - appServiceIdSelector: - matchLabels: - testing.upbound.io/example-name: appactiveslot-lwa - siteConfig: - - {} + location: West Europe --- apiVersion: web.azure.upbound.io/v1beta1 -kind: LinuxWebApp +kind: ServicePlan metadata: annotations: meta.upbound.io/example-id: web/v1beta1/appactiveslot labels: - testing.upbound.io/example-name: appactiveslot-lwa - name: appactiveslot-lwa + testing.upbound.io/example-name: example + name: example-appactive spec: forProvider: location: West Europe + osType: Windows resourceGroupNameSelector: matchLabels: - testing.upbound.io/example-name: appactiveslot-rg - servicePlanIdSelector: - matchLabels: - testing.upbound.io/example-name: appactiveslot-sp - siteConfig: - - {} + testing.upbound.io/example-name: example + skuName: P1v2 --- -apiVersion: azure.upbound.io/v1beta1 -kind: ResourceGroup +apiVersion: web.azure.upbound.io/v1beta1 +kind: WindowsWebApp metadata: annotations: meta.upbound.io/example-id: web/v1beta1/appactiveslot labels: - testing.upbound.io/example-name: appactiveslot-rg - name: appactiveslot-rg + testing.upbound.io/example-name: example + name: example-appactive spec: forProvider: location: West Europe + resourceGroupNameSelector: + matchLabels: + testing.upbound.io/example-name: example + servicePlanIdSelector: + matchLabels: + testing.upbound.io/example-name: example + siteConfig: + - {} --- apiVersion: web.azure.upbound.io/v1beta1 -kind: ServicePlan +kind: WindowsWebAppSlot metadata: annotations: meta.upbound.io/example-id: web/v1beta1/appactiveslot labels: - testing.upbound.io/example-name: appactiveslot-sp - name: appactiveslot-sp + testing.upbound.io/example-name: example + name: example-appactive spec: forProvider: - location: West Europe - osType: Windows - resourceGroupNameSelector: + appServiceIdSelector: matchLabels: - testing.upbound.io/example-name: appactiveslot-rg - skuName: P1v2 - + testing.upbound.io/example-name: example + siteConfig: + - {} diff --git a/go.mod b/go.mod index 53bad7db4..8877d27cb 100644 --- a/go.mod +++ b/go.mod @@ -1,14 +1,16 @@ module github.com/upbound/provider-azure -go 1.19 +go 1.21 require ( dario.cat/mergo v1.0.0 - github.com/crossplane/crossplane-runtime v1.14.1 + github.com/crossplane/crossplane-runtime v1.15.0-rc.0.0.20231213071410-0b379538ab14 github.com/crossplane/crossplane-tools v0.0.0-20230925130601-628280f8bf79 github.com/crossplane/upjet v1.1.0-rc.0.0.20231227120826-4cb45f9104ac github.com/google/go-cmp v0.6.0 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0 + github.com/hashicorp/terraform-json v0.16.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 + github.com/hashicorp/terraform-provider-azurerm v1.44.1-0.20230519070112-155958d2cb08 github.com/pkg/errors v0.9.1 gopkg.in/alecthomas/kingpin.v2 v2.2.6 k8s.io/api v0.28.4 @@ -19,6 +21,15 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go v66.0.0+incompatible // indirect + github.com/Azure/go-autorest v14.2.0+incompatible // indirect + github.com/Azure/go-autorest/autorest v0.11.29 // indirect + github.com/Azure/go-autorest/autorest/adal v0.9.23 // indirect + github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect + github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect + github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect + github.com/Azure/go-autorest/logger v0.2.1 // indirect + github.com/Azure/go-autorest/tracing v0.6.0 // indirect github.com/agext/levenshtein v1.2.3 // indirect github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect @@ -26,38 +37,53 @@ require ( github.com/antchfx/xpath v1.2.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/btubbs/datetime v0.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/dave/jennifer v1.4.1 // indirect + github.com/dave/jennifer v1.6.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/fatih/camelcase v1.0.0 // indirect github.com/fatih/color v1.15.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/go-logr/logr v1.2.4 // indirect + github.com/go-logr/logr v1.3.0 // indirect github.com/go-logr/zapr v1.2.4 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect github.com/gobuffalo/flect v1.0.2 // indirect + github.com/gofrs/uuid v4.4.0+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/uuid v1.3.1 // indirect + github.com/google/uuid v1.4.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-azure-helpers v0.56.0 // indirect + github.com/hashicorp/go-azure-sdk v0.20230511.1094507 // indirect + github.com/hashicorp/go-checkpoint v0.5.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect - github.com/hashicorp/go-hclog v1.2.1 // indirect + github.com/hashicorp/go-hclog v1.4.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/go-plugin v1.4.8 // indirect + github.com/hashicorp/go-retryablehttp v0.7.2 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/hcl/v2 v2.14.1 // indirect + github.com/hashicorp/hc-install v0.5.0 // indirect + github.com/hashicorp/hcl/v2 v2.16.2 // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-json v0.14.0 // indirect - github.com/hashicorp/terraform-plugin-go v0.14.0 // indirect - github.com/hashicorp/terraform-plugin-log v0.7.0 // indirect + github.com/hashicorp/terraform-exec v0.18.1 // indirect + github.com/hashicorp/terraform-plugin-go v0.14.3 // indirect + github.com/hashicorp/terraform-plugin-log v0.8.0 // indirect + github.com/hashicorp/terraform-plugin-testing v1.0.0 // indirect + github.com/hashicorp/terraform-registry-address v0.1.0 // indirect + github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect + github.com/hashicorp/yamux v0.0.0-20210316155119-a95892c5f864 // indirect github.com/iancoleman/strcase v0.2.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -77,45 +103,54 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/muvaf/typewriter v0.0.0-20220131201631-921e94e8e8d7 // indirect + github.com/oklog/run v1.1.0 // indirect github.com/prometheus/client_golang v1.16.0 // indirect github.com/prometheus/client_model v0.4.0 // indirect github.com/prometheus/common v0.44.0 // indirect github.com/prometheus/procfs v0.10.1 // indirect - github.com/spf13/afero v1.10.0 // indirect - github.com/spf13/cobra v1.7.0 // indirect + github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9 // indirect + github.com/rickb777/plural v1.2.0 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cobra v1.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tmccombs/hcl2json v0.3.3 // indirect + github.com/tombuildsstuff/giovanni v0.20.0 // indirect + github.com/tombuildsstuff/kermit v0.20230424.1090808 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect github.com/vmihailenco/tagparser v0.1.1 // indirect github.com/yuin/goldmark v1.4.13 // indirect - github.com/zclconf/go-cty v1.11.0 // indirect + github.com/zclconf/go-cty v1.13.1 // indirect github.com/zclconf/go-cty-yaml v1.0.3 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect - golang.org/x/mod v0.13.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/oauth2 v0.11.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/term v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect - golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.14.0 // indirect + golang.org/x/crypto v0.16.0 // indirect + golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/oauth2 v0.15.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/term v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/time v0.5.0 // indirect + golang.org/x/tools v0.15.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect google.golang.org/grpc v1.59.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.31.1-0.20231128094519-2087447a6b4a // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.28.3 // indirect - k8s.io/component-base v0.28.3 // indirect + k8s.io/apiextensions-apiserver v0.28.4 // indirect + k8s.io/component-base v0.28.4 // indirect k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect + software.sslmate.com/src/go-pkcs12 v0.2.0 // indirect ) + +replace github.com/hashicorp/terraform-provider-azurerm => github.com/upbound/terraform-provider-azurerm v0.0.0-20231115141655-4efad3ac0449 diff --git a/go.sum b/go.sum index 7311b4a27..68f3d2d72 100644 --- a/go.sum +++ b/go.sum @@ -1,45 +1,52 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Azure/azure-sdk-for-go v45.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v56.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v66.0.0+incompatible h1:bmmC38SlE8/E81nNADlgmVGurPWMHDX2YNXVQMrBpEE= +github.com/Azure/azure-sdk-for-go v66.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest/autorest v0.11.3/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= +github.com/Azure/go-autorest/autorest v0.11.19/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= +github.com/Azure/go-autorest/autorest v0.11.29 h1:I4+HL/JDvErx2LjyzaVxllw2lRDB5/BT2Bm4g20iqYw= +github.com/Azure/go-autorest/autorest v0.11.29/go.mod h1:ZtEzC4Jy2JDrZLxvWs8LrBWEBycl1hbT1eknI8MtfAs= +github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= +github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= +github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= +github.com/Azure/go-autorest/autorest/adal v0.9.14/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= +github.com/Azure/go-autorest/autorest/adal v0.9.22/go.mod h1:XuAbAEUv2Tta//+voMI038TrJBqjKam0me7qR+L8Cmk= +github.com/Azure/go-autorest/autorest/adal v0.9.23 h1:Yepx8CvFxwNKpH6ja7RZ+sKX+DWYNldbLiALMC3BTz8= +github.com/Azure/go-autorest/autorest/adal v0.9.23/go.mod h1:5pcMqFkdPhviJdlEy3kC/v1ZLnQl0MH6XA5YCcMhy4c= +github.com/Azure/go-autorest/autorest/azure/cli v0.4.0/go.mod h1:JljT387FplPzBA31vUcvsetLKF3pec5bdAxjVU4kI2s= +github.com/Azure/go-autorest/autorest/azure/cli v0.4.2/go.mod h1:7qkJkT+j6b+hIpzMOwPChJhTqS8VbsqqgULzMNRugoM= +github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= +github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= +github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/autorest/mocks v0.4.2 h1:PGN4EDXnuQbojHbU0UWoNvmu9AGVwYHG9/fkDYhtAfw= +github.com/Azure/go-autorest/autorest/mocks v0.4.2/go.mod h1:Vy7OitM9Kei0i1Oj+LvyAWMXJHeKH1MVlzFugfVrmyU= +github.com/Azure/go-autorest/autorest/to v0.4.0 h1:oXVqrxakqqV1UZdSazDOPOLvOIz+XA683u8EctwboHk= +github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= +github.com/Azure/go-autorest/autorest/validation v0.3.0/go.mod h1:yhLgjC0Wda5DYXl6JAsWyUe4KVNffhoDhG0zVzUMo3E= +github.com/Azure/go-autorest/autorest/validation v0.3.1 h1:AgyqjAd94fwNAoTjl/WQXg4VvFeRFpO+UhNyRXqF1ac= +github.com/Azure/go-autorest/autorest/validation v0.3.1/go.mod h1:yhLgjC0Wda5DYXl6JAsWyUe4KVNffhoDhG0zVzUMo3E= +github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= +github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= +github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= +github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= +github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= +github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= @@ -48,66 +55,74 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafo github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antchfx/htmlquery v1.2.4 h1:qLteofCMe/KGovBI6SQgmou2QNyedFUW+pE+BpeZ494= github.com/antchfx/htmlquery v1.2.4/go.mod h1:2xO6iu3EVWs7R2JYqBbp8YzG50gj/ofqs5/0VZoDZLc= github.com/antchfx/xpath v1.2.0 h1:mbwv7co+x0RwgeGAOHdrKy89GvHaGvxxBtPK0uF9Zr8= github.com/antchfx/xpath v1.2.0/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/btubbs/datetime v0.1.0 h1:183iHRjmNAokYM5D8V3wbEOOEe/HYEYpm7E2oom3vhM= +github.com/btubbs/datetime v0.1.0/go.mod h1:n2BZ/2ltnRzNiz27aE3wUb2onNttQdC+WFxAoks5jJM= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/crossplane/crossplane-runtime v1.14.1 h1:TCa7R1N4bDGHjsLhiRxR/mUhwmistlMACHm0kiiYKck= -github.com/crossplane/crossplane-runtime v1.14.1/go.mod h1:aOP+5W2wKpvthVs3pFNbVOe1jwrKYbJho0ThGNCVz9o= +github.com/crossplane/crossplane-runtime v1.15.0-rc.0.0.20231213071410-0b379538ab14 h1:PrldAMuJ8Fm/YON/f0ztdCEwT3S9zOnZUbRoOSL4Yz0= +github.com/crossplane/crossplane-runtime v1.15.0-rc.0.0.20231213071410-0b379538ab14/go.mod h1:pgt7PaTvvOQz3jILyxbCaeleU9MrAqKaNoPJavhGBgM= github.com/crossplane/crossplane-tools v0.0.0-20230925130601-628280f8bf79 h1:HigXs5tEQxWz0fcj8hzbU2UAZgEM7wPe0XRFOsrtF8Y= github.com/crossplane/crossplane-tools v0.0.0-20230925130601-628280f8bf79/go.mod h1:+e4OaFlOcmr0JvINHl/yvEYBrZawzTgj6pQumOH1SS0= github.com/crossplane/upjet v1.1.0-rc.0.0.20231227120826-4cb45f9104ac h1:T1MTxsPAE/Cs0/EAGjeC29H9O/rO81yol2/5qGsf888= github.com/crossplane/upjet v1.1.0-rc.0.0.20231227120826-4cb45f9104ac/go.mod h1:t9etxIdYaxgyvFPBToikm5zBHi8RIpX8N4mTH77lQFM= -github.com/dave/jennifer v1.4.1 h1:XyqG6cn5RQsTj3qlWQTKlRGAyrTcsk1kUmWdZBzRjDw= -github.com/dave/jennifer v1.4.1/go.mod h1:7jEdnm+qBcxl8PC0zyp7vxcpSRnzXSt9r39tpTVGlwA= +github.com/dave/jennifer v1.6.0 h1:MQ/6emI2xM7wt0tJzJzyUik2Q3Tcn2eE0vtYgh4GPVI= +github.com/dave/jennifer v1.6.0/go.mod h1:AxTG893FiZKqxy3FP1kL80VMshSMuz2G+EgvszgGRnk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= +github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= +github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= +github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34= +github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= +github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= +github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -117,138 +132,136 @@ github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M= github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA= github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= +github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= +github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/addlicense v0.0.0-20210428195630-6d92264d7170/go.mod h1:EMjYTRimagHs1FwlIqKyX3wAM0u3rA+McvlIIWmSamA= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98 h1:pUa4ghanp6q4IJHwE9RwLgmVFfReJN+KbQ8ExNEUUoQ= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a h1:fEBsGL/sjAuJrgah5XqmmYsTLzJp/TO9Lhy39gkverk= +github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-azure-helpers v0.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg= +github.com/hashicorp/go-azure-helpers v0.56.0 h1:KxDXISHwWe4PKEz6FSSPG8vCXNrFGsCcCn/AI94ccig= +github.com/hashicorp/go-azure-helpers v0.56.0/go.mod h1:MbnCV9jPmlkbdH7VsoBK8IbCHvo3pLWRbRvq+F6u9sI= +github.com/hashicorp/go-azure-sdk v0.20230511.1094507 h1:uvmyrTZAHXtHzwkuHtjD889OyH3c4ul1IuPiegm/uag= +github.com/hashicorp/go-azure-sdk v0.20230511.1094507/go.mod h1:x2r7/U5MKlTHUO6/hFHRNO03qkRLBYyeQOuEUHkZmEg= +github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= +github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= -github.com/hashicorp/go-hclog v1.2.1 h1:YQsLlGDJgwhXFpucSPyVbCBviQtjlHv3jLTlp8YmtEw= -github.com/hashicorp/go-hclog v1.2.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v1.4.0 h1:ctuWFGrhFha8BnnzxqeRGidlEcQkDyL5u8J8t5eA11I= +github.com/hashicorp/go-hclog v1.4.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= +github.com/hashicorp/go-retryablehttp v0.7.2 h1:AcYqCvkpalPnPF2pn0KamgwamS42TqUDDYFRKq/RAd0= +github.com/hashicorp/go-retryablehttp v0.7.2/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hc-install v0.5.0 h1:D9bl4KayIYKEeJ4vUDe9L5huqxZXczKaykSRcmQ0xY0= +github.com/hashicorp/hc-install v0.5.0/go.mod h1:JyzMfbzfSBSjoDCRPna1vi/24BEDxFaCPfdHtM5SCdo= github.com/hashicorp/hcl/v2 v2.9.1/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= -github.com/hashicorp/hcl/v2 v2.14.1 h1:x0BpjfZ+CYdbiz+8yZTQ+gdLO7IXvOut7Da+XJayx34= -github.com/hashicorp/hcl/v2 v2.14.1/go.mod h1:e4z5nxYlWNPdDSNYX+ph14EvWYMFm3eP0zIUqPc2jr0= +github.com/hashicorp/hcl/v2 v2.16.2 h1:mpkHZh/Tv+xet3sy3F9Ld4FyI2tUpWe9x3XtPx9f1a0= +github.com/hashicorp/hcl/v2 v2.16.2/go.mod h1:JRmR89jycNkrrqnMmvPDMd56n1rQJ2Q6KocSLCMCXng= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-json v0.14.0 h1:sh9iZ1Y8IFJLx+xQiKHGud6/TSUCM0N8e17dKDpqV7s= -github.com/hashicorp/terraform-json v0.14.0/go.mod h1:5A9HIWPkk4e5aeeXIBbkcOvaZbIYnAIkEyqP2pNSckM= -github.com/hashicorp/terraform-plugin-go v0.14.0 h1:ttnSlS8bz3ZPYbMb84DpcPhY4F5DsQtcAS7cHo8uvP4= -github.com/hashicorp/terraform-plugin-go v0.14.0/go.mod h1:2nNCBeRLaenyQEi78xrGrs9hMbulveqG/zDMQSvVJTE= -github.com/hashicorp/terraform-plugin-log v0.7.0 h1:SDxJUyT8TwN4l5b5/VkiTIaQgY6R+Y2BQ0sRZftGKQs= -github.com/hashicorp/terraform-plugin-log v0.7.0/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0 h1:FtCLTiTcykdsURXPt/ku7fYXm3y19nbzbZcUxHx9RbI= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0/go.mod h1:80wf5oad1tW+oLnbXS4UTYmDCrl7BuN1Q+IA91X1a4Y= +github.com/hashicorp/terraform-exec v0.18.1 h1:LAbfDvNQU1l0NOQlTuudjczVhHj061fNX5H8XZxHlH4= +github.com/hashicorp/terraform-exec v0.18.1/go.mod h1:58wg4IeuAJ6LVsLUeD2DWZZoc/bYi6dzhLHzxM41980= +github.com/hashicorp/terraform-json v0.16.0 h1:UKkeWRWb23do5LNAFlh/K3N0ymn1qTOO8c+85Albo3s= +github.com/hashicorp/terraform-json v0.16.0/go.mod h1:v0Ufk9jJnk6tcIZvScHvetlKfiNTC+WS21mnXIlc0B0= +github.com/hashicorp/terraform-plugin-go v0.14.3 h1:nlnJ1GXKdMwsC8g1Nh05tK2wsC3+3BL/DBBxFEki+j0= +github.com/hashicorp/terraform-plugin-go v0.14.3/go.mod h1:7ees7DMZ263q8wQ6E4RdIdR6nHHJtrdt4ogX5lPkX1A= +github.com/hashicorp/terraform-plugin-log v0.8.0 h1:pX2VQ/TGKu+UU1rCay0OlzosNKe4Nz1pepLXj95oyy0= +github.com/hashicorp/terraform-plugin-log v0.8.0/go.mod h1:1myFrhVsBLeylQzYYEV17VVjtG8oYPRFdaZs7xdW2xs= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 h1:G9WAfb8LHeCxu7Ae8nc1agZlQOSCUWsb610iAogBhCs= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1/go.mod h1:xcOSYlRVdPLmDUoqPhO9fiO/YCN/l6MGYeTzGt5jgkQ= +github.com/hashicorp/terraform-plugin-testing v1.0.0 h1:3dJV+etJxfiRQ4ENe5fZ38ZQPN5aJ8PwqUAOE2NzDnw= +github.com/hashicorp/terraform-plugin-testing v1.0.0/go.mod h1:sv9NoAabKrcjYzvYYwnJCJU+EfF0QnZbaodl+SgWUM8= +github.com/hashicorp/terraform-registry-address v0.1.0 h1:W6JkV9wbum+m516rCl5/NjKxCyTVaaUBbzYcMzBDO3U= +github.com/hashicorp/terraform-registry-address v0.1.0/go.mod h1:EnyO2jYO6j29DTHbJcm00E5nQTFeTtyZH3H5ycydQ5A= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= +github.com/hashicorp/yamux v0.0.0-20210316155119-a95892c5f864 h1:Y4V+SFe7d3iH+9pJCoeWIOS5/xBJIFsltS7E+KJSsJY= +github.com/hashicorp/yamux v0.0.0-20210316155119-a95892c5f864/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= +github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= +github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= +github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= +github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -258,19 +271,27 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= @@ -280,6 +301,7 @@ github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQ github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -291,54 +313,76 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/muvaf/typewriter v0.0.0-20220131201631-921e94e8e8d7 h1:CxRHKnh1YJXgNKxcos9rrKL6AcmOl1AS/fygmxFDzh4= github.com/muvaf/typewriter v0.0.0-20220131201631-921e94e8e8d7/go.mod h1:SAAdeMEiFXR8LcHffvIdiLI1w243DCH2DuHq7UrA5YQ= -github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= +github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9 h1:czJCcoUR3FMpHnRQow2E84H/0CPrX1fMAGn9HugzyI4= +github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9/go.mod h1:L8WrssTzvgYw34/Ppa0JpJfI7KKXZ2cVGI6Djt0brUU= +github.com/rickb777/plural v1.2.0 h1:5tvEc7UBCZ7l8h/2UeybSkt/uu1DQsZFOFdNevmUhlE= +github.com/rickb777/plural v1.2.0/go.mod h1:UdpyWFCGbo3mvK3f/PfZOAOrkjzJlYN/sD46XNWJ+Es= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= -github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/tmccombs/hcl2json v0.3.3 h1:+DLNYqpWE0CsOQiEZu+OZm5ZBImake3wtITYxQ8uLFQ= github.com/tmccombs/hcl2json v0.3.3/go.mod h1:Y2chtz2x9bAeRTvSibVRVgbLJhLJXKlUeIvjeVdnm4w= +github.com/tombuildsstuff/giovanni v0.20.0 h1:IM/I/iNWMXnPYwcSq8uxV7TKDlv7Nejq0bRK9i6O/C0= +github.com/tombuildsstuff/giovanni v0.20.0/go.mod h1:66KVLYma2whJhEdxPSPL3GQHkulhK+C5CluKfHGfPF4= +github.com/tombuildsstuff/kermit v0.20230424.1090808 h1:p4vmVTBAeZyERLf6J5C9BIwHJ2ty1y+4Dvdoxzo3rB0= +github.com/tombuildsstuff/kermit v0.20230424.1090808/go.mod h1:YleYDYRKTGy5ihWHG9u3CwyVTr0l8dOLkYtVEPjnzGI= +github.com/upbound/terraform-provider-azurerm v0.0.0-20231115141655-4efad3ac0449 h1:svJL/V82oNz6001pOLGDPAwI0HrDgcQb9UY/ho4A3y4= +github.com/upbound/terraform-provider-azurerm v0.0.0-20231115141655-4efad3ac0449/go.mod h1:Cwkegu9hzL9Ft5GHi8fblT7YadhzahI6XPR7Hbyam5U= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= @@ -346,407 +390,213 @@ github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvC github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= +github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty v1.8.1/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= -github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= -github.com/zclconf/go-cty v1.11.0 h1:726SxLdi2SDnjY+BStqB9J1hNp4+2WlzyXLuimibIe0= -github.com/zclconf/go-cty v1.11.0/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA= +github.com/zclconf/go-cty v1.13.1 h1:0a6bRwuiSHtAmqCqNOE+c2oHgepv0ctoxU4FUe43kwc= +github.com/zclconf/go-cty v1.13.1/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= github.com/zclconf/go-cty-yaml v1.0.3 h1:og/eOQ7lvA/WWhHGFETVWNduJM7Rjsv2RRpx1sdFMLc= github.com/zclconf/go-cty-yaml v1.0.3/go.mod h1:9YLUH4g7lOhVWqUbctnVlZ5KLpg7JAprQNgxSZ1Gyxs= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= -golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU= -golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= +golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= +golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= +golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.1-0.20231128094519-2087447a6b4a h1:4Xl+xgjbTX1HWSmJKoV3GeNdVZCJmlx2rvHT3eHoUCw= +google.golang.org/protobuf v1.31.1-0.20231128094519-2087447a6b4a/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.28.4 h1:8ZBrLjwosLl/NYgv1P7EQLqoO8MGQApnbgH8tu3BMzY= k8s.io/api v0.28.4/go.mod h1:axWTGrY88s/5YE+JSt4uUi6NMM+gur1en2REMR7IRj0= -k8s.io/apiextensions-apiserver v0.28.3 h1:Od7DEnhXHnHPZG+W9I97/fSQkVpVPQx2diy+2EtmY08= -k8s.io/apiextensions-apiserver v0.28.3/go.mod h1:NE1XJZ4On0hS11aWWJUTNkmVB03j9LM7gJSisbRt8Lc= +k8s.io/apiextensions-apiserver v0.28.4 h1:AZpKY/7wQ8n+ZYDtNHbAJBb+N4AXXJvyZx6ww6yAJvU= +k8s.io/apiextensions-apiserver v0.28.4/go.mod h1:pgQIZ1U8eJSMQcENew/0ShUTlePcSGFq6dxSxf2mwPM= k8s.io/apimachinery v0.28.4 h1:zOSJe1mc+GxuMnFzD4Z/U1wst50X28ZNsn5bhgIIao8= k8s.io/apimachinery v0.28.4/go.mod h1:wI37ncBvfAoswfq626yPTe6Bz1c22L7uaJ8dho83mgg= k8s.io/client-go v0.28.4 h1:Np5ocjlZcTrkyRJ3+T3PkXDpe4UpatQxj85+xjaD2wY= k8s.io/client-go v0.28.4/go.mod h1:0VDZFpgoZfelyP5Wqu0/r/TRYcLYuJ2U1KEeoaPa1N4= -k8s.io/component-base v0.28.3 h1:rDy68eHKxq/80RiMb2Ld/tbH8uAE75JdCqJyi6lXMzI= -k8s.io/component-base v0.28.3/go.mod h1:fDJ6vpVNSk6cRo5wmDa6eKIG7UlIQkaFmZN2fYgIUD8= +k8s.io/component-base v0.28.4 h1:c/iQLWPdUgI90O+T9TeECg8o7N3YJTiuz2sKxILYcYo= +k8s.io/component-base v0.28.4/go.mod h1:m9hR0uvqXDybiGL2nf/3Lf0MerAfQXzkfWhUY58JUbU= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4= sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0= sigs.k8s.io/controller-tools v0.13.0 h1:NfrvuZ4bxyolhDBt/rCZhDnx3M2hzlhgo5n3Iv2RykI= @@ -755,5 +605,7 @@ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMm sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= +software.sslmate.com/src/go-pkcs12 v0.2.0 h1:nlFkj7bTysH6VkC4fGphtjXRbezREPgrHuJG20hBGPE= +software.sslmate.com/src/go-pkcs12 v0.2.0/go.mod h1:23rNcYsMabIc1otwLpTkCCPwUq6kQsTyowttG/as0kQ= diff --git a/hack/main.go.tmpl b/hack/main.go.tmpl index b88abda42..db6faae65 100644 --- a/hack/main.go.tmpl +++ b/hack/main.go.tmpl @@ -18,7 +18,6 @@ package main import ( "context" - "math/rand" "os" "path/filepath" "time" @@ -113,6 +112,9 @@ func main() { terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, @@ -121,9 +123,10 @@ func main() { MaxConcurrentReconciles: *maxReconcileRate, Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), - PollJitter: pollJitter, + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, provider.TerraformProvider, scheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), } if *enableManagementPolicies { @@ -147,7 +150,7 @@ func main() { } // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -161,7 +164,6 @@ func main() { })), "cannot create default store config") } - rand.Seed(time.Now().UnixNano()) kingpin.FatalIfError(controller.Setup_{{ .Group }}(mgr, o), "Cannot setup Azure controllers") kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager") } diff --git a/internal/clients/azure.go b/internal/clients/azure.go index 2839e4beb..e8b390840 100644 --- a/internal/clients/azure.go +++ b/internal/clients/azure.go @@ -5,14 +5,16 @@ import ( "encoding/json" "strings" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + tfsdk "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/upjet/pkg/terraform" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/upjet/pkg/terraform" - "github.com/upbound/provider-azure/apis/v1beta1" ) @@ -63,7 +65,7 @@ var ( // TerraformSetupBuilder returns Terraform setup with provider specific // configuration like provider credentials used to connect to cloud APIs in the // expected form of a Terraform provider. -func TerraformSetupBuilder(version, providerSource, providerVersion string, scheduler terraform.ProviderScheduler) terraform.SetupFn { //nolint:gocyclo +func TerraformSetupBuilder(version, providerSource, providerVersion string, tfProvider *schema.Provider, scheduler terraform.ProviderScheduler) terraform.SetupFn { //nolint:gocyclo return func(ctx context.Context, client client.Client, mg xpresource.Managed) (terraform.Setup, error) { ps := terraform.Setup{ Version: version, @@ -89,7 +91,7 @@ func TerraformSetupBuilder(version, providerSource, providerVersion string, sche } ps.Configuration = map[string]interface{}{ - keyTerraformFeatures: struct{}{}, + keyTerraformFeatures: map[string]interface{}{}, // Terraform AzureRM provider tries to register all resource providers // in Azure just in case if the provider of the resource you're // trying to create is not registered and the returned error is @@ -110,10 +112,25 @@ func TerraformSetupBuilder(version, providerSource, providerVersion string, sche default: err = spAuth(ctx, pc, &ps, client) } - return ps, err + if err != nil { + return terraform.Setup{}, errors.Wrap(err, "failed to prepare terraform.Setup") + } + + return ps, errors.Wrap(configureNoForkAzureClient(ctx, &ps, *tfProvider), "failed to configure the no-fork Azure client") } } +func configureNoForkAzureClient(ctx context.Context, ps *terraform.Setup, p schema.Provider) error { + diag := p.Configure(context.WithoutCancel(ctx), &tfsdk.ResourceConfig{ + Config: ps.Configuration, + }) + if diag != nil && diag.HasError() { + return errors.Errorf("failed to configure the provider: %v", diag) + } + ps.Meta = p.Meta() + return nil +} + func spAuth(ctx context.Context, pc *v1beta1.ProviderConfig, ps *terraform.Setup, client client.Client) error { data, err := xpresource.CommonCredentialExtractor(ctx, pc.Spec.Credentials.Source, client, pc.Spec.Credentials.CommonCredentialSelectors) if err != nil { diff --git a/internal/controller/alertsmanagement/monitoractionruleactiongroup/zz_controller.go b/internal/controller/alertsmanagement/monitoractionruleactiongroup/zz_controller.go index 774fd612a..9c0ab4ce1 100755 --- a/internal/controller/alertsmanagement/monitoractionruleactiongroup/zz_controller.go +++ b/internal/controller/alertsmanagement/monitoractionruleactiongroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/alertsmanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorActionRuleActionGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorActionRuleActionGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorActionRuleActionGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_action_rule_action_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_action_rule_action_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorActionRuleActionGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/alertsmanagement/monitoractionrulesuppression/zz_controller.go b/internal/controller/alertsmanagement/monitoractionrulesuppression/zz_controller.go index bee1003f9..ace86d598 100755 --- a/internal/controller/alertsmanagement/monitoractionrulesuppression/zz_controller.go +++ b/internal/controller/alertsmanagement/monitoractionrulesuppression/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/alertsmanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorActionRuleSuppression_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorActionRuleSuppression_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorActionRuleSuppression_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_action_rule_suppression"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_action_rule_suppression"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorActionRuleSuppression_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/alertsmanagement/monitoralertprocessingruleactiongroup/zz_controller.go b/internal/controller/alertsmanagement/monitoralertprocessingruleactiongroup/zz_controller.go index 6ebca0b31..d21925748 100755 --- a/internal/controller/alertsmanagement/monitoralertprocessingruleactiongroup/zz_controller.go +++ b/internal/controller/alertsmanagement/monitoralertprocessingruleactiongroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/alertsmanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorAlertProcessingRuleActionGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorAlertProcessingRuleActionGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorAlertProcessingRuleActionGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_alert_processing_rule_action_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_alert_processing_rule_action_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorAlertProcessingRuleActionGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/alertsmanagement/monitoralertprocessingrulesuppression/zz_controller.go b/internal/controller/alertsmanagement/monitoralertprocessingrulesuppression/zz_controller.go index a2850fdcd..94b2c612f 100755 --- a/internal/controller/alertsmanagement/monitoralertprocessingrulesuppression/zz_controller.go +++ b/internal/controller/alertsmanagement/monitoralertprocessingrulesuppression/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/alertsmanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorAlertProcessingRuleSuppression_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorAlertProcessingRuleSuppression_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorAlertProcessingRuleSuppression_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_alert_processing_rule_suppression"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_alert_processing_rule_suppression"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorAlertProcessingRuleSuppression_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/alertsmanagement/monitorsmartdetectoralertrule/zz_controller.go b/internal/controller/alertsmanagement/monitorsmartdetectoralertrule/zz_controller.go index a295cb5ef..c54c4d3fd 100755 --- a/internal/controller/alertsmanagement/monitorsmartdetectoralertrule/zz_controller.go +++ b/internal/controller/alertsmanagement/monitorsmartdetectoralertrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/alertsmanagement/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorSmartDetectorAlertRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorSmartDetectorAlertRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorSmartDetectorAlertRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_smart_detector_alert_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_smart_detector_alert_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorSmartDetectorAlertRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/analysisservices/server/zz_controller.go b/internal/controller/analysisservices/server/zz_controller.go index 48aa84bd7..6335f973b 100755 --- a/internal/controller/analysisservices/server/zz_controller.go +++ b/internal/controller/analysisservices/server/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/analysisservices/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Server_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Server_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Server_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_analysis_services_server"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_analysis_services_server"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Server_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/api/zz_controller.go b/internal/controller/apimanagement/api/zz_controller.go index 9bda20110..0d9ac6c9f 100755 --- a/internal/controller/apimanagement/api/zz_controller.go +++ b/internal/controller/apimanagement/api/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.API_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.API_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.API_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.API_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/apidiagnostic/zz_controller.go b/internal/controller/apimanagement/apidiagnostic/zz_controller.go index 5e4e6a5fc..5a664b8d3 100755 --- a/internal/controller/apimanagement/apidiagnostic/zz_controller.go +++ b/internal/controller/apimanagement/apidiagnostic/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.APIDiagnostic_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APIDiagnostic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APIDiagnostic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_diagnostic"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_diagnostic"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.APIDiagnostic_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/apioperation/zz_controller.go b/internal/controller/apimanagement/apioperation/zz_controller.go index 7072a76f0..87a6e8df3 100755 --- a/internal/controller/apimanagement/apioperation/zz_controller.go +++ b/internal/controller/apimanagement/apioperation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.APIOperation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APIOperation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APIOperation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_operation"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_operation"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.APIOperation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/apioperationpolicy/zz_controller.go b/internal/controller/apimanagement/apioperationpolicy/zz_controller.go index cdac65b05..9f50d6f73 100755 --- a/internal/controller/apimanagement/apioperationpolicy/zz_controller.go +++ b/internal/controller/apimanagement/apioperationpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.APIOperationPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APIOperationPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APIOperationPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_operation_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_operation_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.APIOperationPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/apioperationtag/zz_controller.go b/internal/controller/apimanagement/apioperationtag/zz_controller.go index 6b67be10f..a6e80c96e 100755 --- a/internal/controller/apimanagement/apioperationtag/zz_controller.go +++ b/internal/controller/apimanagement/apioperationtag/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.APIOperationTag_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APIOperationTag_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APIOperationTag_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_operation_tag"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_operation_tag"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.APIOperationTag_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/apipolicy/zz_controller.go b/internal/controller/apimanagement/apipolicy/zz_controller.go index e1082bce0..5f5be8c24 100755 --- a/internal/controller/apimanagement/apipolicy/zz_controller.go +++ b/internal/controller/apimanagement/apipolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.APIPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APIPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APIPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.APIPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/apirelease/zz_controller.go b/internal/controller/apimanagement/apirelease/zz_controller.go index 716804c84..2224f0b18 100755 --- a/internal/controller/apimanagement/apirelease/zz_controller.go +++ b/internal/controller/apimanagement/apirelease/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.APIRelease_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APIRelease_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APIRelease_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_release"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_release"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.APIRelease_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/apischema/zz_controller.go b/internal/controller/apimanagement/apischema/zz_controller.go index c4407d1bc..0792c7fc5 100755 --- a/internal/controller/apimanagement/apischema/zz_controller.go +++ b/internal/controller/apimanagement/apischema/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.APISchema_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APISchema_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APISchema_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_schema"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_schema"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.APISchema_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/apitag/zz_controller.go b/internal/controller/apimanagement/apitag/zz_controller.go index 68c19ae68..06d91905c 100755 --- a/internal/controller/apimanagement/apitag/zz_controller.go +++ b/internal/controller/apimanagement/apitag/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.APITag_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APITag_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APITag_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_tag"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_tag"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.APITag_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/apiversionset/zz_controller.go b/internal/controller/apimanagement/apiversionset/zz_controller.go index 321e8d7df..d7ab72b37 100755 --- a/internal/controller/apimanagement/apiversionset/zz_controller.go +++ b/internal/controller/apimanagement/apiversionset/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.APIVersionSet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APIVersionSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APIVersionSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_version_set"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_version_set"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.APIVersionSet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/authorizationserver/zz_controller.go b/internal/controller/apimanagement/authorizationserver/zz_controller.go index 3943795d1..cd66491a4 100755 --- a/internal/controller/apimanagement/authorizationserver/zz_controller.go +++ b/internal/controller/apimanagement/authorizationserver/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AuthorizationServer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AuthorizationServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AuthorizationServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_authorization_server"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_authorization_server"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AuthorizationServer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/backend/zz_controller.go b/internal/controller/apimanagement/backend/zz_controller.go index 16333f95e..b621c4859 100755 --- a/internal/controller/apimanagement/backend/zz_controller.go +++ b/internal/controller/apimanagement/backend/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Backend_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Backend_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Backend_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_backend"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_backend"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Backend_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/certificate/zz_controller.go b/internal/controller/apimanagement/certificate/zz_controller.go index e0846d934..8667fe4a3 100755 --- a/internal/controller/apimanagement/certificate/zz_controller.go +++ b/internal/controller/apimanagement/certificate/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Certificate_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Certificate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Certificate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_certificate"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_certificate"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Certificate_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/diagnostic/zz_controller.go b/internal/controller/apimanagement/diagnostic/zz_controller.go index 16caf0d60..290f9b4d4 100755 --- a/internal/controller/apimanagement/diagnostic/zz_controller.go +++ b/internal/controller/apimanagement/diagnostic/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Diagnostic_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Diagnostic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Diagnostic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_diagnostic"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_diagnostic"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Diagnostic_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/emailtemplate/zz_controller.go b/internal/controller/apimanagement/emailtemplate/zz_controller.go index 04a0da6d8..b33918d68 100755 --- a/internal/controller/apimanagement/emailtemplate/zz_controller.go +++ b/internal/controller/apimanagement/emailtemplate/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.EmailTemplate_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EmailTemplate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EmailTemplate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_email_template"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_email_template"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.EmailTemplate_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/gateway/zz_controller.go b/internal/controller/apimanagement/gateway/zz_controller.go index aa7466c43..a14cb877f 100755 --- a/internal/controller/apimanagement/gateway/zz_controller.go +++ b/internal/controller/apimanagement/gateway/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Gateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Gateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Gateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_gateway"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_gateway"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Gateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/gatewayapi/zz_controller.go b/internal/controller/apimanagement/gatewayapi/zz_controller.go index db7ff210a..9edfaf7da 100755 --- a/internal/controller/apimanagement/gatewayapi/zz_controller.go +++ b/internal/controller/apimanagement/gatewayapi/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.GatewayAPI_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GatewayAPI_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GatewayAPI_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_gateway_api"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_gateway_api"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.GatewayAPI_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/globalschema/zz_controller.go b/internal/controller/apimanagement/globalschema/zz_controller.go index 0248fa99a..1e54dfbf3 100755 --- a/internal/controller/apimanagement/globalschema/zz_controller.go +++ b/internal/controller/apimanagement/globalschema/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.GlobalSchema_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GlobalSchema_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GlobalSchema_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_global_schema"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_global_schema"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.GlobalSchema_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/identityprovideraad/zz_controller.go b/internal/controller/apimanagement/identityprovideraad/zz_controller.go index c70e08312..ae6ff61e3 100755 --- a/internal/controller/apimanagement/identityprovideraad/zz_controller.go +++ b/internal/controller/apimanagement/identityprovideraad/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IdentityProviderAAD_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IdentityProviderAAD_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IdentityProviderAAD_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_identity_provider_aad"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_identity_provider_aad"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IdentityProviderAAD_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/identityproviderfacebook/zz_controller.go b/internal/controller/apimanagement/identityproviderfacebook/zz_controller.go index 628cd63ca..1ab2d6f30 100755 --- a/internal/controller/apimanagement/identityproviderfacebook/zz_controller.go +++ b/internal/controller/apimanagement/identityproviderfacebook/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IdentityProviderFacebook_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IdentityProviderFacebook_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IdentityProviderFacebook_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_identity_provider_facebook"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_identity_provider_facebook"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IdentityProviderFacebook_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/identityprovidergoogle/zz_controller.go b/internal/controller/apimanagement/identityprovidergoogle/zz_controller.go index 73a1fc88c..2d5224888 100755 --- a/internal/controller/apimanagement/identityprovidergoogle/zz_controller.go +++ b/internal/controller/apimanagement/identityprovidergoogle/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IdentityProviderGoogle_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IdentityProviderGoogle_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IdentityProviderGoogle_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_identity_provider_google"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_identity_provider_google"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IdentityProviderGoogle_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/identityprovidermicrosoft/zz_controller.go b/internal/controller/apimanagement/identityprovidermicrosoft/zz_controller.go index 8ffaefa98..ce0957c5a 100755 --- a/internal/controller/apimanagement/identityprovidermicrosoft/zz_controller.go +++ b/internal/controller/apimanagement/identityprovidermicrosoft/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IdentityProviderMicrosoft_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IdentityProviderMicrosoft_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IdentityProviderMicrosoft_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_identity_provider_microsoft"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_identity_provider_microsoft"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IdentityProviderMicrosoft_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/identityprovidertwitter/zz_controller.go b/internal/controller/apimanagement/identityprovidertwitter/zz_controller.go index fbc5b97f6..471f3a768 100755 --- a/internal/controller/apimanagement/identityprovidertwitter/zz_controller.go +++ b/internal/controller/apimanagement/identityprovidertwitter/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IdentityProviderTwitter_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IdentityProviderTwitter_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IdentityProviderTwitter_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_identity_provider_twitter"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_identity_provider_twitter"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IdentityProviderTwitter_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/logger/zz_controller.go b/internal/controller/apimanagement/logger/zz_controller.go index 542d8c2e0..e7f49bcaf 100755 --- a/internal/controller/apimanagement/logger/zz_controller.go +++ b/internal/controller/apimanagement/logger/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Logger_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Logger_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Logger_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_logger"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_logger"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Logger_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/management/zz_controller.go b/internal/controller/apimanagement/management/zz_controller.go index 0e7b30f1d..8780192eb 100755 --- a/internal/controller/apimanagement/management/zz_controller.go +++ b/internal/controller/apimanagement/management/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Management_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Management_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Management_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/namedvalue/zz_controller.go b/internal/controller/apimanagement/namedvalue/zz_controller.go index b77d5ef1d..044a1ea71 100755 --- a/internal/controller/apimanagement/namedvalue/zz_controller.go +++ b/internal/controller/apimanagement/namedvalue/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NamedValue_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamedValue_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamedValue_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_named_value"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_named_value"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NamedValue_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/notificationrecipientemail/zz_controller.go b/internal/controller/apimanagement/notificationrecipientemail/zz_controller.go index 85ee92752..12dd111a0 100755 --- a/internal/controller/apimanagement/notificationrecipientemail/zz_controller.go +++ b/internal/controller/apimanagement/notificationrecipientemail/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NotificationRecipientEmail_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NotificationRecipientEmail_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NotificationRecipientEmail_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_notification_recipient_email"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_notification_recipient_email"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NotificationRecipientEmail_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/notificationrecipientuser/zz_controller.go b/internal/controller/apimanagement/notificationrecipientuser/zz_controller.go index c48619620..cde7f6e4b 100755 --- a/internal/controller/apimanagement/notificationrecipientuser/zz_controller.go +++ b/internal/controller/apimanagement/notificationrecipientuser/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NotificationRecipientUser_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NotificationRecipientUser_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NotificationRecipientUser_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_notification_recipient_user"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_notification_recipient_user"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NotificationRecipientUser_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/openidconnectprovider/zz_controller.go b/internal/controller/apimanagement/openidconnectprovider/zz_controller.go index cf57e9f5f..ec6e1bab7 100755 --- a/internal/controller/apimanagement/openidconnectprovider/zz_controller.go +++ b/internal/controller/apimanagement/openidconnectprovider/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.OpenIDConnectProvider_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OpenIDConnectProvider_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OpenIDConnectProvider_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_openid_connect_provider"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_openid_connect_provider"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.OpenIDConnectProvider_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/policy/zz_controller.go b/internal/controller/apimanagement/policy/zz_controller.go index cc0a18dad..bc109b72f 100755 --- a/internal/controller/apimanagement/policy/zz_controller.go +++ b/internal/controller/apimanagement/policy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Policy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Policy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Policy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Policy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/product/zz_controller.go b/internal/controller/apimanagement/product/zz_controller.go index 90e9d15f5..ff672942f 100755 --- a/internal/controller/apimanagement/product/zz_controller.go +++ b/internal/controller/apimanagement/product/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Product_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Product_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Product_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_product"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_product"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Product_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/productapi/zz_controller.go b/internal/controller/apimanagement/productapi/zz_controller.go index a195fdc2a..9d0346490 100755 --- a/internal/controller/apimanagement/productapi/zz_controller.go +++ b/internal/controller/apimanagement/productapi/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ProductAPI_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ProductAPI_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ProductAPI_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_product_api"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_product_api"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ProductAPI_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/productpolicy/zz_controller.go b/internal/controller/apimanagement/productpolicy/zz_controller.go index e6dfcda7f..f3d03f2f7 100755 --- a/internal/controller/apimanagement/productpolicy/zz_controller.go +++ b/internal/controller/apimanagement/productpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ProductPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ProductPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ProductPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_product_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_product_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ProductPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/producttag/zz_controller.go b/internal/controller/apimanagement/producttag/zz_controller.go index 9133aaf70..d9985ba4a 100755 --- a/internal/controller/apimanagement/producttag/zz_controller.go +++ b/internal/controller/apimanagement/producttag/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ProductTag_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ProductTag_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ProductTag_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_product_tag"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_product_tag"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ProductTag_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/rediscache/zz_controller.go b/internal/controller/apimanagement/rediscache/zz_controller.go index e2c4ced56..44fd9a8b5 100755 --- a/internal/controller/apimanagement/rediscache/zz_controller.go +++ b/internal/controller/apimanagement/rediscache/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RedisCache_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RedisCache_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RedisCache_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_redis_cache"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_redis_cache"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RedisCache_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/subscription/zz_controller.go b/internal/controller/apimanagement/subscription/zz_controller.go index 6e9ead0a0..d78580376 100755 --- a/internal/controller/apimanagement/subscription/zz_controller.go +++ b/internal/controller/apimanagement/subscription/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Subscription_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Subscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Subscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_subscription"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_subscription"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Subscription_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/tag/zz_controller.go b/internal/controller/apimanagement/tag/zz_controller.go index b2cce7608..f1b2d9c15 100755 --- a/internal/controller/apimanagement/tag/zz_controller.go +++ b/internal/controller/apimanagement/tag/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Tag_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Tag_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Tag_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_tag"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_tag"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Tag_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/apimanagement/user/zz_controller.go b/internal/controller/apimanagement/user/zz_controller.go index 895965012..5fcc25268 100755 --- a/internal/controller/apimanagement/user/zz_controller.go +++ b/internal/controller/apimanagement/user/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.User_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.User_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.User_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_user"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_user"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.User_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appconfiguration/configuration/zz_controller.go b/internal/controller/appconfiguration/configuration/zz_controller.go index 6526a3dd1..d61909c91 100755 --- a/internal/controller/appconfiguration/configuration/zz_controller.go +++ b/internal/controller/appconfiguration/configuration/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appconfiguration/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Configuration_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Configuration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Configuration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_app_configuration"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_app_configuration"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Configuration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudaccelerator/zz_controller.go b/internal/controller/appplatform/springcloudaccelerator/zz_controller.go index 390368d33..a37e7b8d7 100755 --- a/internal/controller/appplatform/springcloudaccelerator/zz_controller.go +++ b/internal/controller/appplatform/springcloudaccelerator/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudAccelerator_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudAccelerator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudAccelerator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_accelerator"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_accelerator"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudAccelerator_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudactivedeployment/zz_controller.go b/internal/controller/appplatform/springcloudactivedeployment/zz_controller.go index ef8447901..0e42524c2 100755 --- a/internal/controller/appplatform/springcloudactivedeployment/zz_controller.go +++ b/internal/controller/appplatform/springcloudactivedeployment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudActiveDeployment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudActiveDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudActiveDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_active_deployment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_active_deployment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudActiveDeployment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudapiportal/zz_controller.go b/internal/controller/appplatform/springcloudapiportal/zz_controller.go index c736f0569..57aa72789 100755 --- a/internal/controller/appplatform/springcloudapiportal/zz_controller.go +++ b/internal/controller/appplatform/springcloudapiportal/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudAPIPortal_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudAPIPortal_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudAPIPortal_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_api_portal"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_api_portal"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudAPIPortal_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudapiportalcustomdomain/zz_controller.go b/internal/controller/appplatform/springcloudapiportalcustomdomain/zz_controller.go index 507ad583f..f4ee12c51 100755 --- a/internal/controller/appplatform/springcloudapiportalcustomdomain/zz_controller.go +++ b/internal/controller/appplatform/springcloudapiportalcustomdomain/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudAPIPortalCustomDomain_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudAPIPortalCustomDomain_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudAPIPortalCustomDomain_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_api_portal_custom_domain"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_api_portal_custom_domain"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudAPIPortalCustomDomain_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudapp/zz_controller.go b/internal/controller/appplatform/springcloudapp/zz_controller.go index 47eb692b8..e5f768b1a 100755 --- a/internal/controller/appplatform/springcloudapp/zz_controller.go +++ b/internal/controller/appplatform/springcloudapp/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudApp_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_app"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_app"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudApp_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudappcosmosdbassociation/zz_controller.go b/internal/controller/appplatform/springcloudappcosmosdbassociation/zz_controller.go index c113681ec..3498e6fd1 100755 --- a/internal/controller/appplatform/springcloudappcosmosdbassociation/zz_controller.go +++ b/internal/controller/appplatform/springcloudappcosmosdbassociation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudAppCosmosDBAssociation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudAppCosmosDBAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudAppCosmosDBAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_app_cosmosdb_association"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_app_cosmosdb_association"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudAppCosmosDBAssociation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudappmysqlassociation/zz_controller.go b/internal/controller/appplatform/springcloudappmysqlassociation/zz_controller.go index ef8178502..a9b1d9b03 100755 --- a/internal/controller/appplatform/springcloudappmysqlassociation/zz_controller.go +++ b/internal/controller/appplatform/springcloudappmysqlassociation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudAppMySQLAssociation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudAppMySQLAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudAppMySQLAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_app_mysql_association"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_app_mysql_association"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudAppMySQLAssociation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudappredisassociation/zz_controller.go b/internal/controller/appplatform/springcloudappredisassociation/zz_controller.go index fa121755b..62005cf59 100755 --- a/internal/controller/appplatform/springcloudappredisassociation/zz_controller.go +++ b/internal/controller/appplatform/springcloudappredisassociation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudAppRedisAssociation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudAppRedisAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudAppRedisAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_app_redis_association"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_app_redis_association"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudAppRedisAssociation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudbuilddeployment/zz_controller.go b/internal/controller/appplatform/springcloudbuilddeployment/zz_controller.go index b5e5c3d98..fdb93b8ec 100755 --- a/internal/controller/appplatform/springcloudbuilddeployment/zz_controller.go +++ b/internal/controller/appplatform/springcloudbuilddeployment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudBuildDeployment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudBuildDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudBuildDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_build_deployment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_build_deployment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudBuildDeployment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudbuilder/zz_controller.go b/internal/controller/appplatform/springcloudbuilder/zz_controller.go index 664a2406c..2b89d8ac2 100755 --- a/internal/controller/appplatform/springcloudbuilder/zz_controller.go +++ b/internal/controller/appplatform/springcloudbuilder/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudBuilder_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudBuilder_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudBuilder_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_builder"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_builder"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudBuilder_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudbuildpackbinding/zz_controller.go b/internal/controller/appplatform/springcloudbuildpackbinding/zz_controller.go index 981c6317d..330f3de46 100755 --- a/internal/controller/appplatform/springcloudbuildpackbinding/zz_controller.go +++ b/internal/controller/appplatform/springcloudbuildpackbinding/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudBuildPackBinding_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudBuildPackBinding_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudBuildPackBinding_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_build_pack_binding"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_build_pack_binding"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudBuildPackBinding_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudcertificate/zz_controller.go b/internal/controller/appplatform/springcloudcertificate/zz_controller.go index 5cbe436cc..4e3ca5763 100755 --- a/internal/controller/appplatform/springcloudcertificate/zz_controller.go +++ b/internal/controller/appplatform/springcloudcertificate/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudCertificate_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudCertificate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudCertificate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_certificate"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_certificate"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudCertificate_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudconfigurationservice/zz_controller.go b/internal/controller/appplatform/springcloudconfigurationservice/zz_controller.go index 673523214..b0fa3ec97 100755 --- a/internal/controller/appplatform/springcloudconfigurationservice/zz_controller.go +++ b/internal/controller/appplatform/springcloudconfigurationservice/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudConfigurationService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudConfigurationService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudConfigurationService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_configuration_service"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_configuration_service"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudConfigurationService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudcontainerdeployment/zz_controller.go b/internal/controller/appplatform/springcloudcontainerdeployment/zz_controller.go index 463ff94a3..c1794d474 100755 --- a/internal/controller/appplatform/springcloudcontainerdeployment/zz_controller.go +++ b/internal/controller/appplatform/springcloudcontainerdeployment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudContainerDeployment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudContainerDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudContainerDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_container_deployment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_container_deployment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudContainerDeployment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudcustomdomain/zz_controller.go b/internal/controller/appplatform/springcloudcustomdomain/zz_controller.go index 98240b18d..03eb4ee8c 100755 --- a/internal/controller/appplatform/springcloudcustomdomain/zz_controller.go +++ b/internal/controller/appplatform/springcloudcustomdomain/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudCustomDomain_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudCustomDomain_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudCustomDomain_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_custom_domain"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_custom_domain"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudCustomDomain_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudcustomizedaccelerator/zz_controller.go b/internal/controller/appplatform/springcloudcustomizedaccelerator/zz_controller.go index 615a76ba1..04f2982d3 100755 --- a/internal/controller/appplatform/springcloudcustomizedaccelerator/zz_controller.go +++ b/internal/controller/appplatform/springcloudcustomizedaccelerator/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudCustomizedAccelerator_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudCustomizedAccelerator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudCustomizedAccelerator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_customized_accelerator"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_customized_accelerator"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudCustomizedAccelerator_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springclouddevtoolportal/zz_controller.go b/internal/controller/appplatform/springclouddevtoolportal/zz_controller.go index 10c550292..8f59bc1cd 100755 --- a/internal/controller/appplatform/springclouddevtoolportal/zz_controller.go +++ b/internal/controller/appplatform/springclouddevtoolportal/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudDevToolPortal_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudDevToolPortal_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudDevToolPortal_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_dev_tool_portal"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_dev_tool_portal"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudDevToolPortal_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudgateway/zz_controller.go b/internal/controller/appplatform/springcloudgateway/zz_controller.go index d55550618..505bee788 100755 --- a/internal/controller/appplatform/springcloudgateway/zz_controller.go +++ b/internal/controller/appplatform/springcloudgateway/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudGateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_gateway"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_gateway"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudGateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudgatewaycustomdomain/zz_controller.go b/internal/controller/appplatform/springcloudgatewaycustomdomain/zz_controller.go index 5c2c830da..bb2404e89 100755 --- a/internal/controller/appplatform/springcloudgatewaycustomdomain/zz_controller.go +++ b/internal/controller/appplatform/springcloudgatewaycustomdomain/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudGatewayCustomDomain_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudGatewayCustomDomain_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudGatewayCustomDomain_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_gateway_custom_domain"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_gateway_custom_domain"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudGatewayCustomDomain_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudjavadeployment/zz_controller.go b/internal/controller/appplatform/springcloudjavadeployment/zz_controller.go index afbfdd5e2..8ae3205ef 100755 --- a/internal/controller/appplatform/springcloudjavadeployment/zz_controller.go +++ b/internal/controller/appplatform/springcloudjavadeployment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudJavaDeployment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudJavaDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudJavaDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_java_deployment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_java_deployment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudJavaDeployment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudservice/zz_controller.go b/internal/controller/appplatform/springcloudservice/zz_controller.go index 4d22fa966..49404e972 100755 --- a/internal/controller/appplatform/springcloudservice/zz_controller.go +++ b/internal/controller/appplatform/springcloudservice/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_service"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_service"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/appplatform/springcloudstorage/zz_controller.go b/internal/controller/appplatform/springcloudstorage/zz_controller.go index d77c7a53c..8bf3aa29b 100755 --- a/internal/controller/appplatform/springcloudstorage/zz_controller.go +++ b/internal/controller/appplatform/springcloudstorage/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudStorage_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_storage"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_storage"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudStorage_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/attestation/provider/zz_controller.go b/internal/controller/attestation/provider/zz_controller.go index fcf8cb1e8..fd29e39ea 100755 --- a/internal/controller/attestation/provider/zz_controller.go +++ b/internal/controller/attestation/provider/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/attestation/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Provider_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Provider_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Provider_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_attestation_provider"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_attestation_provider"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Provider_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/authorization/managementlock/zz_controller.go b/internal/controller/authorization/managementlock/zz_controller.go index c534f92f1..10bfbe67e 100755 --- a/internal/controller/authorization/managementlock/zz_controller.go +++ b/internal/controller/authorization/managementlock/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/authorization/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagementLock_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagementLock_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagementLock_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_management_lock"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_management_lock"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagementLock_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/authorization/policydefinition/zz_controller.go b/internal/controller/authorization/policydefinition/zz_controller.go index 77634dade..5d9b03c03 100755 --- a/internal/controller/authorization/policydefinition/zz_controller.go +++ b/internal/controller/authorization/policydefinition/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/authorization/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PolicyDefinition_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PolicyDefinition_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PolicyDefinition_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_policy_definition"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_policy_definition"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PolicyDefinition_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/authorization/resourcegrouppolicyassignment/zz_controller.go b/internal/controller/authorization/resourcegrouppolicyassignment/zz_controller.go index 7efdda508..fd40b2bca 100755 --- a/internal/controller/authorization/resourcegrouppolicyassignment/zz_controller.go +++ b/internal/controller/authorization/resourcegrouppolicyassignment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/authorization/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ResourceGroupPolicyAssignment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceGroupPolicyAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceGroupPolicyAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_resource_group_policy_assignment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_resource_group_policy_assignment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ResourceGroupPolicyAssignment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/authorization/resourcepolicyassignment/zz_controller.go b/internal/controller/authorization/resourcepolicyassignment/zz_controller.go index 310d46258..22dcdc8de 100755 --- a/internal/controller/authorization/resourcepolicyassignment/zz_controller.go +++ b/internal/controller/authorization/resourcepolicyassignment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/authorization/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ResourcePolicyAssignment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourcePolicyAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourcePolicyAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_resource_policy_assignment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_resource_policy_assignment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ResourcePolicyAssignment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/authorization/resourcepolicyexemption/zz_controller.go b/internal/controller/authorization/resourcepolicyexemption/zz_controller.go index 310ef67e0..e8ac1ce7a 100755 --- a/internal/controller/authorization/resourcepolicyexemption/zz_controller.go +++ b/internal/controller/authorization/resourcepolicyexemption/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/authorization/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ResourcePolicyExemption_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourcePolicyExemption_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourcePolicyExemption_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_resource_policy_exemption"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_resource_policy_exemption"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ResourcePolicyExemption_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/authorization/roleassignment/zz_controller.go b/internal/controller/authorization/roleassignment/zz_controller.go index af7845b89..04b69f393 100755 --- a/internal/controller/authorization/roleassignment/zz_controller.go +++ b/internal/controller/authorization/roleassignment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/authorization/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RoleAssignment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RoleAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RoleAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_role_assignment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_role_assignment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RoleAssignment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/authorization/roledefinition/zz_controller.go b/internal/controller/authorization/roledefinition/zz_controller.go index eebfe4af6..0361a4cd5 100755 --- a/internal/controller/authorization/roledefinition/zz_controller.go +++ b/internal/controller/authorization/roledefinition/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/authorization/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RoleDefinition_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RoleDefinition_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RoleDefinition_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_role_definition"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_role_definition"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RoleDefinition_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/authorization/subscriptionpolicyassignment/zz_controller.go b/internal/controller/authorization/subscriptionpolicyassignment/zz_controller.go index 919b79437..c3fb853f4 100755 --- a/internal/controller/authorization/subscriptionpolicyassignment/zz_controller.go +++ b/internal/controller/authorization/subscriptionpolicyassignment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/authorization/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SubscriptionPolicyAssignment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubscriptionPolicyAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubscriptionPolicyAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_subscription_policy_assignment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_subscription_policy_assignment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SubscriptionPolicyAssignment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/authorization/subscriptionpolicyexemption/zz_controller.go b/internal/controller/authorization/subscriptionpolicyexemption/zz_controller.go index 4a93a4e62..1020f654f 100755 --- a/internal/controller/authorization/subscriptionpolicyexemption/zz_controller.go +++ b/internal/controller/authorization/subscriptionpolicyexemption/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/authorization/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SubscriptionPolicyExemption_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubscriptionPolicyExemption_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubscriptionPolicyExemption_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_subscription_policy_exemption"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_subscription_policy_exemption"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SubscriptionPolicyExemption_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/automation/account/zz_controller.go b/internal/controller/automation/account/zz_controller.go index 67024cddf..86029c581 100755 --- a/internal/controller/automation/account/zz_controller.go +++ b/internal/controller/automation/account/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Account_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_automation_account"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_account"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Account_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/automation/connection/zz_controller.go b/internal/controller/automation/connection/zz_controller.go index a514c6ee2..fdc78155f 100755 --- a/internal/controller/automation/connection/zz_controller.go +++ b/internal/controller/automation/connection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Connection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Connection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Connection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_automation_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Connection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/automation/connectionclassiccertificate/zz_controller.go b/internal/controller/automation/connectionclassiccertificate/zz_controller.go index 9295c9e26..1525f43b7 100755 --- a/internal/controller/automation/connectionclassiccertificate/zz_controller.go +++ b/internal/controller/automation/connectionclassiccertificate/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ConnectionClassicCertificate_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ConnectionClassicCertificate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ConnectionClassicCertificate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_automation_connection_classic_certificate"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_connection_classic_certificate"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ConnectionClassicCertificate_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/automation/connectiontype/zz_controller.go b/internal/controller/automation/connectiontype/zz_controller.go index 74d247e8b..d47debf47 100755 --- a/internal/controller/automation/connectiontype/zz_controller.go +++ b/internal/controller/automation/connectiontype/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ConnectionType_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ConnectionType_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ConnectionType_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_automation_connection_type"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_connection_type"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ConnectionType_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/automation/credential/zz_controller.go b/internal/controller/automation/credential/zz_controller.go index 3a29dd0dd..e3b303451 100755 --- a/internal/controller/automation/credential/zz_controller.go +++ b/internal/controller/automation/credential/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Credential_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Credential_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Credential_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_automation_credential"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_credential"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Credential_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/automation/hybridrunbookworkergroup/zz_controller.go b/internal/controller/automation/hybridrunbookworkergroup/zz_controller.go index 05c775e21..7ae1c3974 100755 --- a/internal/controller/automation/hybridrunbookworkergroup/zz_controller.go +++ b/internal/controller/automation/hybridrunbookworkergroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HybridRunBookWorkerGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HybridRunBookWorkerGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HybridRunBookWorkerGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_automation_hybrid_runbook_worker_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_hybrid_runbook_worker_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HybridRunBookWorkerGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/automation/module/zz_controller.go b/internal/controller/automation/module/zz_controller.go index 627245a62..dcac92121 100755 --- a/internal/controller/automation/module/zz_controller.go +++ b/internal/controller/automation/module/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Module_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Module_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Module_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_automation_module"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_module"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Module_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/automation/runbook/zz_controller.go b/internal/controller/automation/runbook/zz_controller.go index 59e59872a..b74936254 100755 --- a/internal/controller/automation/runbook/zz_controller.go +++ b/internal/controller/automation/runbook/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RunBook_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RunBook_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RunBook_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_automation_runbook"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_runbook"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RunBook_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/automation/schedule/zz_controller.go b/internal/controller/automation/schedule/zz_controller.go index 3584ebdf6..e523a21ec 100755 --- a/internal/controller/automation/schedule/zz_controller.go +++ b/internal/controller/automation/schedule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Schedule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Schedule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Schedule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_automation_schedule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_schedule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Schedule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/automation/variablebool/zz_controller.go b/internal/controller/automation/variablebool/zz_controller.go index e556e0cba..da6686851 100755 --- a/internal/controller/automation/variablebool/zz_controller.go +++ b/internal/controller/automation/variablebool/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VariableBool_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VariableBool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VariableBool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_automation_variable_bool"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_variable_bool"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VariableBool_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/automation/variabledatetime/zz_controller.go b/internal/controller/automation/variabledatetime/zz_controller.go index 44000119a..5f06e4be1 100755 --- a/internal/controller/automation/variabledatetime/zz_controller.go +++ b/internal/controller/automation/variabledatetime/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VariableDateTime_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VariableDateTime_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VariableDateTime_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_automation_variable_datetime"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_variable_datetime"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VariableDateTime_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/automation/variableint/zz_controller.go b/internal/controller/automation/variableint/zz_controller.go index 94b7ec2ef..d1fc116f4 100755 --- a/internal/controller/automation/variableint/zz_controller.go +++ b/internal/controller/automation/variableint/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VariableInt_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VariableInt_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VariableInt_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_automation_variable_int"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_variable_int"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VariableInt_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/automation/variablestring/zz_controller.go b/internal/controller/automation/variablestring/zz_controller.go index 85e6d71d8..08c6c0f73 100755 --- a/internal/controller/automation/variablestring/zz_controller.go +++ b/internal/controller/automation/variablestring/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VariableString_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VariableString_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VariableString_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_automation_variable_string"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_variable_string"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VariableString_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/automation/webhook/zz_controller.go b/internal/controller/automation/webhook/zz_controller.go index a0a3f24e6..9b48ad833 100755 --- a/internal/controller/automation/webhook/zz_controller.go +++ b/internal/controller/automation/webhook/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Webhook_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Webhook_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Webhook_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_automation_webhook"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_webhook"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Webhook_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/azure/resourcegroup/zz_controller.go b/internal/controller/azure/resourcegroup/zz_controller.go index 5cf4af1a4..653dde849 100755 --- a/internal/controller/azure/resourcegroup/zz_controller.go +++ b/internal/controller/azure/resourcegroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/azure/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ResourceGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_resource_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_resource_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ResourceGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/azure/resourceproviderregistration/zz_controller.go b/internal/controller/azure/resourceproviderregistration/zz_controller.go index 66606fad8..42c7610f7 100755 --- a/internal/controller/azure/resourceproviderregistration/zz_controller.go +++ b/internal/controller/azure/resourceproviderregistration/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/azure/v1beta1" @@ -36,11 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ResourceProviderRegistration_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceProviderRegistration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_resource_provider_registration"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_resource_provider_registration"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ResourceProviderRegistration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/azure/subscription/zz_controller.go b/internal/controller/azure/subscription/zz_controller.go index 56800931f..0a168b328 100755 --- a/internal/controller/azure/subscription/zz_controller.go +++ b/internal/controller/azure/subscription/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/azure/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Subscription_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Subscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_subscription"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_subscription"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Subscription_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/azurestackhci/cluster/zz_controller.go b/internal/controller/azurestackhci/cluster/zz_controller.go index 5fa872f3d..0a1425bb7 100755 --- a/internal/controller/azurestackhci/cluster/zz_controller.go +++ b/internal/controller/azurestackhci/cluster/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/azurestackhci/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Cluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Cluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Cluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stack_hci_cluster"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stack_hci_cluster"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Cluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/botservice/botchannelalexa/zz_controller.go b/internal/controller/botservice/botchannelalexa/zz_controller.go index 3e1661293..3067e3cd6 100755 --- a/internal/controller/botservice/botchannelalexa/zz_controller.go +++ b/internal/controller/botservice/botchannelalexa/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/botservice/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BotChannelAlexa_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotChannelAlexa_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotChannelAlexa_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_bot_channel_alexa"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_bot_channel_alexa"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BotChannelAlexa_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/botservice/botchanneldirectline/zz_controller.go b/internal/controller/botservice/botchanneldirectline/zz_controller.go index a68198352..f7de5f0cd 100755 --- a/internal/controller/botservice/botchanneldirectline/zz_controller.go +++ b/internal/controller/botservice/botchanneldirectline/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/botservice/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BotChannelDirectLine_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotChannelDirectLine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotChannelDirectLine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_bot_channel_directline"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_bot_channel_directline"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BotChannelDirectLine_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/botservice/botchannelline/zz_controller.go b/internal/controller/botservice/botchannelline/zz_controller.go index ea178d47c..b96e93142 100755 --- a/internal/controller/botservice/botchannelline/zz_controller.go +++ b/internal/controller/botservice/botchannelline/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/botservice/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BotChannelLine_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotChannelLine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotChannelLine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_bot_channel_line"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_bot_channel_line"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BotChannelLine_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/botservice/botchannelmsteams/zz_controller.go b/internal/controller/botservice/botchannelmsteams/zz_controller.go index 0165f7959..4313019a8 100755 --- a/internal/controller/botservice/botchannelmsteams/zz_controller.go +++ b/internal/controller/botservice/botchannelmsteams/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/botservice/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BotChannelMSTeams_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotChannelMSTeams_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotChannelMSTeams_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_bot_channel_ms_teams"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_bot_channel_ms_teams"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BotChannelMSTeams_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/botservice/botchannelslack/zz_controller.go b/internal/controller/botservice/botchannelslack/zz_controller.go index 2e290a61e..7bd72a3a5 100755 --- a/internal/controller/botservice/botchannelslack/zz_controller.go +++ b/internal/controller/botservice/botchannelslack/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/botservice/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BotChannelSlack_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotChannelSlack_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotChannelSlack_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_bot_channel_slack"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_bot_channel_slack"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BotChannelSlack_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/botservice/botchannelsms/zz_controller.go b/internal/controller/botservice/botchannelsms/zz_controller.go index 4d417674c..887769c76 100755 --- a/internal/controller/botservice/botchannelsms/zz_controller.go +++ b/internal/controller/botservice/botchannelsms/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/botservice/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BotChannelSMS_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotChannelSMS_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotChannelSMS_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_bot_channel_sms"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_bot_channel_sms"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BotChannelSMS_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/botservice/botchannelsregistration/zz_controller.go b/internal/controller/botservice/botchannelsregistration/zz_controller.go index b44436b39..52dbc1385 100755 --- a/internal/controller/botservice/botchannelsregistration/zz_controller.go +++ b/internal/controller/botservice/botchannelsregistration/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/botservice/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BotChannelsRegistration_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotChannelsRegistration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotChannelsRegistration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_bot_channels_registration"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_bot_channels_registration"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BotChannelsRegistration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/botservice/botchannelwebchat/zz_controller.go b/internal/controller/botservice/botchannelwebchat/zz_controller.go index b79b28bab..4e19f12dc 100755 --- a/internal/controller/botservice/botchannelwebchat/zz_controller.go +++ b/internal/controller/botservice/botchannelwebchat/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/botservice/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BotChannelWebChat_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotChannelWebChat_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotChannelWebChat_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_bot_channel_web_chat"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_bot_channel_web_chat"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BotChannelWebChat_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/botservice/botconnection/zz_controller.go b/internal/controller/botservice/botconnection/zz_controller.go index 7025010b3..5d43013c1 100755 --- a/internal/controller/botservice/botconnection/zz_controller.go +++ b/internal/controller/botservice/botconnection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/botservice/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BotConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_bot_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_bot_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BotConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/botservice/botwebapp/zz_controller.go b/internal/controller/botservice/botwebapp/zz_controller.go index 5412584ba..d171bd9b8 100755 --- a/internal/controller/botservice/botwebapp/zz_controller.go +++ b/internal/controller/botservice/botwebapp/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/botservice/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BotWebApp_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotWebApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BotWebApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_bot_web_app"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_bot_web_app"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BotWebApp_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cache/rediscache/zz_controller.go b/internal/controller/cache/rediscache/zz_controller.go index 7fcae06e8..72612daed 100755 --- a/internal/controller/cache/rediscache/zz_controller.go +++ b/internal/controller/cache/rediscache/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cache/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RedisCache_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RedisCache_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RedisCache_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_redis_cache"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_redis_cache"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RedisCache_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cache/redisenterprisecluster/zz_controller.go b/internal/controller/cache/redisenterprisecluster/zz_controller.go index a98a4f712..f88370f15 100755 --- a/internal/controller/cache/redisenterprisecluster/zz_controller.go +++ b/internal/controller/cache/redisenterprisecluster/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cache/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RedisEnterpriseCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RedisEnterpriseCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RedisEnterpriseCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_redis_enterprise_cluster"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_redis_enterprise_cluster"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RedisEnterpriseCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cache/redisenterprisedatabase/zz_controller.go b/internal/controller/cache/redisenterprisedatabase/zz_controller.go index 497142ab8..c118087df 100755 --- a/internal/controller/cache/redisenterprisedatabase/zz_controller.go +++ b/internal/controller/cache/redisenterprisedatabase/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cache/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RedisEnterpriseDatabase_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RedisEnterpriseDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RedisEnterpriseDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_redis_enterprise_database"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_redis_enterprise_database"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RedisEnterpriseDatabase_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cache/redisfirewallrule/zz_controller.go b/internal/controller/cache/redisfirewallrule/zz_controller.go index 83817ced6..91f080101 100755 --- a/internal/controller/cache/redisfirewallrule/zz_controller.go +++ b/internal/controller/cache/redisfirewallrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cache/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RedisFirewallRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RedisFirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RedisFirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_redis_firewall_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_redis_firewall_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RedisFirewallRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cache/redislinkedserver/zz_controller.go b/internal/controller/cache/redislinkedserver/zz_controller.go index 610a60a16..6fbdd1ef3 100755 --- a/internal/controller/cache/redislinkedserver/zz_controller.go +++ b/internal/controller/cache/redislinkedserver/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cache/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RedisLinkedServer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RedisLinkedServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RedisLinkedServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_redis_linked_server"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_redis_linked_server"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RedisLinkedServer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cdn/endpoint/zz_controller.go b/internal/controller/cdn/endpoint/zz_controller.go index 8722eb265..71d88750c 100755 --- a/internal/controller/cdn/endpoint/zz_controller.go +++ b/internal/controller/cdn/endpoint/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Endpoint_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Endpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Endpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_endpoint"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_endpoint"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Endpoint_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cdn/frontdoorcustomdomain/zz_controller.go b/internal/controller/cdn/frontdoorcustomdomain/zz_controller.go index cbea8c27c..1e1e769a7 100755 --- a/internal/controller/cdn/frontdoorcustomdomain/zz_controller.go +++ b/internal/controller/cdn/frontdoorcustomdomain/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorCustomDomain_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorCustomDomain_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorCustomDomain_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_custom_domain"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_custom_domain"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorCustomDomain_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cdn/frontdoorcustomdomainassociation/zz_controller.go b/internal/controller/cdn/frontdoorcustomdomainassociation/zz_controller.go index 3d067fc54..4e73159a3 100755 --- a/internal/controller/cdn/frontdoorcustomdomainassociation/zz_controller.go +++ b/internal/controller/cdn/frontdoorcustomdomainassociation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorCustomDomainAssociation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorCustomDomainAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorCustomDomainAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_custom_domain_association"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_custom_domain_association"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorCustomDomainAssociation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cdn/frontdoorendpoint/zz_controller.go b/internal/controller/cdn/frontdoorendpoint/zz_controller.go index 1ec634793..92ad34260 100755 --- a/internal/controller/cdn/frontdoorendpoint/zz_controller.go +++ b/internal/controller/cdn/frontdoorendpoint/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorEndpoint_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_endpoint"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_endpoint"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorEndpoint_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cdn/frontdoorfirewallpolicy/zz_controller.go b/internal/controller/cdn/frontdoorfirewallpolicy/zz_controller.go index 196d90c20..617bf69de 100755 --- a/internal/controller/cdn/frontdoorfirewallpolicy/zz_controller.go +++ b/internal/controller/cdn/frontdoorfirewallpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorFirewallPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorFirewallPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorFirewallPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_firewall_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_firewall_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorFirewallPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cdn/frontdoororigin/zz_controller.go b/internal/controller/cdn/frontdoororigin/zz_controller.go index 0d151bfea..75c044a9a 100755 --- a/internal/controller/cdn/frontdoororigin/zz_controller.go +++ b/internal/controller/cdn/frontdoororigin/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorOrigin_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorOrigin_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorOrigin_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_origin"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_origin"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorOrigin_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cdn/frontdoororigingroup/zz_controller.go b/internal/controller/cdn/frontdoororigingroup/zz_controller.go index d394c2843..d49832f0d 100755 --- a/internal/controller/cdn/frontdoororigingroup/zz_controller.go +++ b/internal/controller/cdn/frontdoororigingroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorOriginGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorOriginGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorOriginGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_origin_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_origin_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorOriginGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cdn/frontdoorprofile/zz_controller.go b/internal/controller/cdn/frontdoorprofile/zz_controller.go index 47f49804e..fa8d4100a 100755 --- a/internal/controller/cdn/frontdoorprofile/zz_controller.go +++ b/internal/controller/cdn/frontdoorprofile/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorProfile_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorProfile_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorProfile_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_profile"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_profile"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorProfile_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cdn/frontdoorroute/zz_controller.go b/internal/controller/cdn/frontdoorroute/zz_controller.go index 70a224688..38fdb48dd 100755 --- a/internal/controller/cdn/frontdoorroute/zz_controller.go +++ b/internal/controller/cdn/frontdoorroute/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorRoute_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorRoute_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorRoute_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_route"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_route"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorRoute_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cdn/frontdoorrule/zz_controller.go b/internal/controller/cdn/frontdoorrule/zz_controller.go index d6e25dd20..bcf6f9c9d 100755 --- a/internal/controller/cdn/frontdoorrule/zz_controller.go +++ b/internal/controller/cdn/frontdoorrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cdn/frontdoorruleset/zz_controller.go b/internal/controller/cdn/frontdoorruleset/zz_controller.go index 38d665dbb..f79a815d3 100755 --- a/internal/controller/cdn/frontdoorruleset/zz_controller.go +++ b/internal/controller/cdn/frontdoorruleset/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorRuleSet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorRuleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorRuleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_rule_set"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_rule_set"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorRuleSet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cdn/frontdoorsecuritypolicy/zz_controller.go b/internal/controller/cdn/frontdoorsecuritypolicy/zz_controller.go index 7dfdfa6a5..be5dea0d0 100755 --- a/internal/controller/cdn/frontdoorsecuritypolicy/zz_controller.go +++ b/internal/controller/cdn/frontdoorsecuritypolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorSecurityPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorSecurityPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorSecurityPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_security_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_security_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorSecurityPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cdn/profile/zz_controller.go b/internal/controller/cdn/profile/zz_controller.go index 8ffe5b177..467e36096 100755 --- a/internal/controller/cdn/profile/zz_controller.go +++ b/internal/controller/cdn/profile/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Profile_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Profile_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Profile_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_profile"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_profile"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Profile_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/certificateregistration/appservicecertificateorder/zz_controller.go b/internal/controller/certificateregistration/appservicecertificateorder/zz_controller.go index 1d28ed9d1..979665601 100755 --- a/internal/controller/certificateregistration/appservicecertificateorder/zz_controller.go +++ b/internal/controller/certificateregistration/appservicecertificateorder/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/certificateregistration/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppServiceCertificateOrder_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppServiceCertificateOrder_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppServiceCertificateOrder_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_app_service_certificate_order"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_app_service_certificate_order"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppServiceCertificateOrder_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cognitiveservices/account/zz_controller.go b/internal/controller/cognitiveservices/account/zz_controller.go index 8f10cb86e..77ceecadf 100755 --- a/internal/controller/cognitiveservices/account/zz_controller.go +++ b/internal/controller/cognitiveservices/account/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cognitiveservices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Account_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cognitive_account"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cognitive_account"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Account_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/communication/service/zz_controller.go b/internal/controller/communication/service/zz_controller.go index 6671d1ebc..f7e11c23e 100755 --- a/internal/controller/communication/service/zz_controller.go +++ b/internal/controller/communication/service/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/communication/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Service_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Service_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Service_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_communication_service"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_communication_service"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Service_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/availabilityset/zz_controller.go b/internal/controller/compute/availabilityset/zz_controller.go index cb8f9ef5b..375ba6e4e 100755 --- a/internal/controller/compute/availabilityset/zz_controller.go +++ b/internal/controller/compute/availabilityset/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AvailabilitySet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AvailabilitySet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AvailabilitySet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_availability_set"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_availability_set"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AvailabilitySet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/capacityreservation/zz_controller.go b/internal/controller/compute/capacityreservation/zz_controller.go index 7a001cdd3..150aaf4fb 100755 --- a/internal/controller/compute/capacityreservation/zz_controller.go +++ b/internal/controller/compute/capacityreservation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CapacityReservation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CapacityReservation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CapacityReservation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_capacity_reservation"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_capacity_reservation"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CapacityReservation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/capacityreservationgroup/zz_controller.go b/internal/controller/compute/capacityreservationgroup/zz_controller.go index ef2953894..6e47c163b 100755 --- a/internal/controller/compute/capacityreservationgroup/zz_controller.go +++ b/internal/controller/compute/capacityreservationgroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CapacityReservationGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CapacityReservationGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CapacityReservationGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_capacity_reservation_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_capacity_reservation_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CapacityReservationGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/dedicatedhost/zz_controller.go b/internal/controller/compute/dedicatedhost/zz_controller.go index 2e4720ec8..05f2ee7c0 100755 --- a/internal/controller/compute/dedicatedhost/zz_controller.go +++ b/internal/controller/compute/dedicatedhost/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DedicatedHost_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DedicatedHost_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DedicatedHost_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dedicated_host"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dedicated_host"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DedicatedHost_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/diskaccess/zz_controller.go b/internal/controller/compute/diskaccess/zz_controller.go index 11bc735aa..078208b44 100755 --- a/internal/controller/compute/diskaccess/zz_controller.go +++ b/internal/controller/compute/diskaccess/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DiskAccess_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DiskAccess_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DiskAccess_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_disk_access"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_disk_access"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DiskAccess_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/diskencryptionset/zz_controller.go b/internal/controller/compute/diskencryptionset/zz_controller.go index 3c7f7e1bf..e27cb23e9 100755 --- a/internal/controller/compute/diskencryptionset/zz_controller.go +++ b/internal/controller/compute/diskencryptionset/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DiskEncryptionSet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DiskEncryptionSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DiskEncryptionSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_disk_encryption_set"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_disk_encryption_set"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DiskEncryptionSet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/galleryapplication/zz_controller.go b/internal/controller/compute/galleryapplication/zz_controller.go index a001a41ea..c193c79f9 100755 --- a/internal/controller/compute/galleryapplication/zz_controller.go +++ b/internal/controller/compute/galleryapplication/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.GalleryApplication_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GalleryApplication_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GalleryApplication_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_gallery_application"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_gallery_application"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.GalleryApplication_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/galleryapplicationversion/zz_controller.go b/internal/controller/compute/galleryapplicationversion/zz_controller.go index 207d5e79f..171ca7824 100755 --- a/internal/controller/compute/galleryapplicationversion/zz_controller.go +++ b/internal/controller/compute/galleryapplicationversion/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.GalleryApplicationVersion_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GalleryApplicationVersion_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GalleryApplicationVersion_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_gallery_application_version"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_gallery_application_version"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.GalleryApplicationVersion_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/image/zz_controller.go b/internal/controller/compute/image/zz_controller.go index 856bbef3d..ad062eca8 100755 --- a/internal/controller/compute/image/zz_controller.go +++ b/internal/controller/compute/image/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Image_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Image_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Image_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_image"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_image"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Image_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/linuxvirtualmachine/zz_controller.go b/internal/controller/compute/linuxvirtualmachine/zz_controller.go index f0a1b1697..4116755a0 100755 --- a/internal/controller/compute/linuxvirtualmachine/zz_controller.go +++ b/internal/controller/compute/linuxvirtualmachine/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinuxVirtualMachine_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_linux_virtual_machine"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_linux_virtual_machine"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinuxVirtualMachine_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/linuxvirtualmachinescaleset/zz_controller.go b/internal/controller/compute/linuxvirtualmachinescaleset/zz_controller.go index 93e3e6f9e..a202c0de4 100755 --- a/internal/controller/compute/linuxvirtualmachinescaleset/zz_controller.go +++ b/internal/controller/compute/linuxvirtualmachinescaleset/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinuxVirtualMachineScaleSet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxVirtualMachineScaleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxVirtualMachineScaleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_linux_virtual_machine_scale_set"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_linux_virtual_machine_scale_set"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinuxVirtualMachineScaleSet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/manageddisk/zz_controller.go b/internal/controller/compute/manageddisk/zz_controller.go index 83b9ca0cc..761f96dcf 100755 --- a/internal/controller/compute/manageddisk/zz_controller.go +++ b/internal/controller/compute/manageddisk/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagedDisk_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedDisk_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedDisk_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_managed_disk"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_managed_disk"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagedDisk_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/manageddisksastoken/zz_controller.go b/internal/controller/compute/manageddisksastoken/zz_controller.go index 8c9b8f923..bd0a70f4f 100755 --- a/internal/controller/compute/manageddisksastoken/zz_controller.go +++ b/internal/controller/compute/manageddisksastoken/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagedDiskSASToken_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedDiskSASToken_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedDiskSASToken_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_managed_disk_sas_token"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_managed_disk_sas_token"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagedDiskSASToken_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/orchestratedvirtualmachinescaleset/zz_controller.go b/internal/controller/compute/orchestratedvirtualmachinescaleset/zz_controller.go index 9dea5d86a..2b0283c8a 100755 --- a/internal/controller/compute/orchestratedvirtualmachinescaleset/zz_controller.go +++ b/internal/controller/compute/orchestratedvirtualmachinescaleset/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.OrchestratedVirtualMachineScaleSet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OrchestratedVirtualMachineScaleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OrchestratedVirtualMachineScaleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_orchestrated_virtual_machine_scale_set"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_orchestrated_virtual_machine_scale_set"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.OrchestratedVirtualMachineScaleSet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/proximityplacementgroup/zz_controller.go b/internal/controller/compute/proximityplacementgroup/zz_controller.go index b7c04052a..644185cfc 100755 --- a/internal/controller/compute/proximityplacementgroup/zz_controller.go +++ b/internal/controller/compute/proximityplacementgroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ProximityPlacementGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ProximityPlacementGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ProximityPlacementGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_proximity_placement_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_proximity_placement_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ProximityPlacementGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/sharedimage/zz_controller.go b/internal/controller/compute/sharedimage/zz_controller.go index 50ea4205e..dbfa82ef0 100755 --- a/internal/controller/compute/sharedimage/zz_controller.go +++ b/internal/controller/compute/sharedimage/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SharedImage_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SharedImage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SharedImage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_shared_image"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_shared_image"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SharedImage_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/sharedimagegallery/zz_controller.go b/internal/controller/compute/sharedimagegallery/zz_controller.go index 2f89c7801..ce7987dda 100755 --- a/internal/controller/compute/sharedimagegallery/zz_controller.go +++ b/internal/controller/compute/sharedimagegallery/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SharedImageGallery_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SharedImageGallery_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SharedImageGallery_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_shared_image_gallery"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_shared_image_gallery"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SharedImageGallery_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/snapshot/zz_controller.go b/internal/controller/compute/snapshot/zz_controller.go index 1d1bbf9f6..c53175542 100755 --- a/internal/controller/compute/snapshot/zz_controller.go +++ b/internal/controller/compute/snapshot/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Snapshot_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Snapshot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Snapshot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_snapshot"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_snapshot"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Snapshot_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/sshpublickey/zz_controller.go b/internal/controller/compute/sshpublickey/zz_controller.go index 65d8473e7..b955d62ec 100755 --- a/internal/controller/compute/sshpublickey/zz_controller.go +++ b/internal/controller/compute/sshpublickey/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SSHPublicKey_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SSHPublicKey_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SSHPublicKey_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_ssh_public_key"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_ssh_public_key"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SSHPublicKey_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/virtualmachinedatadiskattachment/zz_controller.go b/internal/controller/compute/virtualmachinedatadiskattachment/zz_controller.go index f32a40688..527aa698a 100755 --- a/internal/controller/compute/virtualmachinedatadiskattachment/zz_controller.go +++ b/internal/controller/compute/virtualmachinedatadiskattachment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualMachineDataDiskAttachment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualMachineDataDiskAttachment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualMachineDataDiskAttachment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_machine_data_disk_attachment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_machine_data_disk_attachment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualMachineDataDiskAttachment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/virtualmachineextension/zz_controller.go b/internal/controller/compute/virtualmachineextension/zz_controller.go index 82cb75ede..b71882884 100755 --- a/internal/controller/compute/virtualmachineextension/zz_controller.go +++ b/internal/controller/compute/virtualmachineextension/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualMachineExtension_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualMachineExtension_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualMachineExtension_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_machine_extension"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_machine_extension"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualMachineExtension_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/windowsvirtualmachine/zz_controller.go b/internal/controller/compute/windowsvirtualmachine/zz_controller.go index ecb8a758e..61d22d920 100755 --- a/internal/controller/compute/windowsvirtualmachine/zz_controller.go +++ b/internal/controller/compute/windowsvirtualmachine/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WindowsVirtualMachine_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_windows_virtual_machine"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_windows_virtual_machine"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WindowsVirtualMachine_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/compute/windowsvirtualmachinescaleset/zz_controller.go b/internal/controller/compute/windowsvirtualmachinescaleset/zz_controller.go index 8c852a0cd..1ba9764b0 100755 --- a/internal/controller/compute/windowsvirtualmachinescaleset/zz_controller.go +++ b/internal/controller/compute/windowsvirtualmachinescaleset/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WindowsVirtualMachineScaleSet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsVirtualMachineScaleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsVirtualMachineScaleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_windows_virtual_machine_scale_set"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_windows_virtual_machine_scale_set"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WindowsVirtualMachineScaleSet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/confidentialledger/ledger/zz_controller.go b/internal/controller/confidentialledger/ledger/zz_controller.go index 519a07afd..6dc70abe2 100755 --- a/internal/controller/confidentialledger/ledger/zz_controller.go +++ b/internal/controller/confidentialledger/ledger/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/confidentialledger/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Ledger_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Ledger_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Ledger_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_confidential_ledger"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_confidential_ledger"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Ledger_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/consumption/budgetmanagementgroup/zz_controller.go b/internal/controller/consumption/budgetmanagementgroup/zz_controller.go index b6e15d7bf..1848f2582 100755 --- a/internal/controller/consumption/budgetmanagementgroup/zz_controller.go +++ b/internal/controller/consumption/budgetmanagementgroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/consumption/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BudgetManagementGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BudgetManagementGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BudgetManagementGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_consumption_budget_management_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_consumption_budget_management_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BudgetManagementGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/consumption/budgetresourcegroup/zz_controller.go b/internal/controller/consumption/budgetresourcegroup/zz_controller.go index fb8ffb211..3d8ab7b2d 100755 --- a/internal/controller/consumption/budgetresourcegroup/zz_controller.go +++ b/internal/controller/consumption/budgetresourcegroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/consumption/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BudgetResourceGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BudgetResourceGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BudgetResourceGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_consumption_budget_resource_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_consumption_budget_resource_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BudgetResourceGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/consumption/budgetsubscription/zz_controller.go b/internal/controller/consumption/budgetsubscription/zz_controller.go index 0a84e452a..450f01bf8 100755 --- a/internal/controller/consumption/budgetsubscription/zz_controller.go +++ b/internal/controller/consumption/budgetsubscription/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/consumption/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BudgetSubscription_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BudgetSubscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BudgetSubscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_consumption_budget_subscription"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_consumption_budget_subscription"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BudgetSubscription_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/containerapp/containerapp/zz_controller.go b/internal/controller/containerapp/containerapp/zz_controller.go index a0b7edd16..2584aa2c2 100755 --- a/internal/controller/containerapp/containerapp/zz_controller.go +++ b/internal/controller/containerapp/containerapp/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/containerapp/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ContainerApp_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ContainerApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ContainerApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_container_app"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_container_app"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ContainerApp_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/containerapp/environment/zz_controller.go b/internal/controller/containerapp/environment/zz_controller.go index ee06eb6d7..97059d4bc 100755 --- a/internal/controller/containerapp/environment/zz_controller.go +++ b/internal/controller/containerapp/environment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/containerapp/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Environment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Environment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Environment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_container_app_environment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_container_app_environment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Environment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/containerregistry/agentpool/zz_controller.go b/internal/controller/containerregistry/agentpool/zz_controller.go index cafd808de..902036754 100755 --- a/internal/controller/containerregistry/agentpool/zz_controller.go +++ b/internal/controller/containerregistry/agentpool/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/containerregistry/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AgentPool_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AgentPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AgentPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_container_registry_agent_pool"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_container_registry_agent_pool"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AgentPool_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/containerregistry/containerconnectedregistry/zz_controller.go b/internal/controller/containerregistry/containerconnectedregistry/zz_controller.go index 8f9cb1dc7..cef6fb49b 100755 --- a/internal/controller/containerregistry/containerconnectedregistry/zz_controller.go +++ b/internal/controller/containerregistry/containerconnectedregistry/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/containerregistry/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ContainerConnectedRegistry_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ContainerConnectedRegistry_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ContainerConnectedRegistry_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_container_connected_registry"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_container_connected_registry"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ContainerConnectedRegistry_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/containerregistry/registry/zz_controller.go b/internal/controller/containerregistry/registry/zz_controller.go index 48b718cb0..d259a1221 100755 --- a/internal/controller/containerregistry/registry/zz_controller.go +++ b/internal/controller/containerregistry/registry/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/containerregistry/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Registry_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Registry_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Registry_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_container_registry"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_container_registry"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Registry_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/containerregistry/scopemap/zz_controller.go b/internal/controller/containerregistry/scopemap/zz_controller.go index 04dd291fb..2bb3d7cb0 100755 --- a/internal/controller/containerregistry/scopemap/zz_controller.go +++ b/internal/controller/containerregistry/scopemap/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/containerregistry/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ScopeMap_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ScopeMap_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ScopeMap_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_container_registry_scope_map"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_container_registry_scope_map"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ScopeMap_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/containerregistry/token/zz_controller.go b/internal/controller/containerregistry/token/zz_controller.go index e52f26f1e..2b97c3a44 100755 --- a/internal/controller/containerregistry/token/zz_controller.go +++ b/internal/controller/containerregistry/token/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/containerregistry/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Token_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Token_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Token_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_container_registry_token"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_container_registry_token"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Token_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/containerregistry/tokenpassword/zz_controller.go b/internal/controller/containerregistry/tokenpassword/zz_controller.go index b5467ad95..bb841a95a 100755 --- a/internal/controller/containerregistry/tokenpassword/zz_controller.go +++ b/internal/controller/containerregistry/tokenpassword/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/containerregistry/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.TokenPassword_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TokenPassword_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TokenPassword_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_container_registry_token_password"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_container_registry_token_password"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.TokenPassword_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/containerregistry/webhook/zz_controller.go b/internal/controller/containerregistry/webhook/zz_controller.go index 073b46835..ca453b31e 100755 --- a/internal/controller/containerregistry/webhook/zz_controller.go +++ b/internal/controller/containerregistry/webhook/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/containerregistry/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Webhook_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Webhook_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Webhook_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_container_registry_webhook"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_container_registry_webhook"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Webhook_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/containerservice/kubernetescluster/zz_controller.go b/internal/controller/containerservice/kubernetescluster/zz_controller.go index bdfc80d9d..433e824f3 100755 --- a/internal/controller/containerservice/kubernetescluster/zz_controller.go +++ b/internal/controller/containerservice/kubernetescluster/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/containerservice/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.KubernetesCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.KubernetesCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.KubernetesCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_kubernetes_cluster"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kubernetes_cluster"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.KubernetesCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/containerservice/kubernetesclusternodepool/zz_controller.go b/internal/controller/containerservice/kubernetesclusternodepool/zz_controller.go index 28930a19d..043930888 100755 --- a/internal/controller/containerservice/kubernetesclusternodepool/zz_controller.go +++ b/internal/controller/containerservice/kubernetesclusternodepool/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/containerservice/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.KubernetesClusterNodePool_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.KubernetesClusterNodePool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.KubernetesClusterNodePool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_kubernetes_cluster_node_pool"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kubernetes_cluster_node_pool"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.KubernetesClusterNodePool_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/containerservice/kubernetesfleetmanager/zz_controller.go b/internal/controller/containerservice/kubernetesfleetmanager/zz_controller.go index 6e7bed8d5..94323a094 100755 --- a/internal/controller/containerservice/kubernetesfleetmanager/zz_controller.go +++ b/internal/controller/containerservice/kubernetesfleetmanager/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/containerservice/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.KubernetesFleetManager_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.KubernetesFleetManager_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.KubernetesFleetManager_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_kubernetes_fleet_manager"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kubernetes_fleet_manager"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.KubernetesFleetManager_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/account/zz_controller.go b/internal/controller/cosmosdb/account/zz_controller.go index 85e48fa4c..70ef1f592 100755 --- a/internal/controller/cosmosdb/account/zz_controller.go +++ b/internal/controller/cosmosdb/account/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Account_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_account"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_account"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Account_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/cassandracluster/zz_controller.go b/internal/controller/cosmosdb/cassandracluster/zz_controller.go index a0948cfb2..aa9162907 100755 --- a/internal/controller/cosmosdb/cassandracluster/zz_controller.go +++ b/internal/controller/cosmosdb/cassandracluster/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CassandraCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CassandraCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CassandraCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_cassandra_cluster"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_cassandra_cluster"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CassandraCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/cassandradatacenter/zz_controller.go b/internal/controller/cosmosdb/cassandradatacenter/zz_controller.go index f56f89714..8f2e4bede 100755 --- a/internal/controller/cosmosdb/cassandradatacenter/zz_controller.go +++ b/internal/controller/cosmosdb/cassandradatacenter/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CassandraDatacenter_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CassandraDatacenter_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CassandraDatacenter_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_cassandra_datacenter"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_cassandra_datacenter"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CassandraDatacenter_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/cassandrakeyspace/zz_controller.go b/internal/controller/cosmosdb/cassandrakeyspace/zz_controller.go index 48a2578a3..61c5d0900 100755 --- a/internal/controller/cosmosdb/cassandrakeyspace/zz_controller.go +++ b/internal/controller/cosmosdb/cassandrakeyspace/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CassandraKeySpace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CassandraKeySpace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CassandraKeySpace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_cassandra_keyspace"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_cassandra_keyspace"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CassandraKeySpace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/cassandratable/zz_controller.go b/internal/controller/cosmosdb/cassandratable/zz_controller.go index 553f6f0ab..a2714d9ba 100755 --- a/internal/controller/cosmosdb/cassandratable/zz_controller.go +++ b/internal/controller/cosmosdb/cassandratable/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CassandraTable_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CassandraTable_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CassandraTable_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_cassandra_table"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_cassandra_table"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CassandraTable_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/gremlindatabase/zz_controller.go b/internal/controller/cosmosdb/gremlindatabase/zz_controller.go index 69591b9ce..28edcdb2d 100755 --- a/internal/controller/cosmosdb/gremlindatabase/zz_controller.go +++ b/internal/controller/cosmosdb/gremlindatabase/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.GremlinDatabase_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GremlinDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GremlinDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_gremlin_database"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_gremlin_database"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.GremlinDatabase_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/gremlingraph/zz_controller.go b/internal/controller/cosmosdb/gremlingraph/zz_controller.go index e39fca990..08f235944 100755 --- a/internal/controller/cosmosdb/gremlingraph/zz_controller.go +++ b/internal/controller/cosmosdb/gremlingraph/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.GremlinGraph_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GremlinGraph_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GremlinGraph_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_gremlin_graph"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_gremlin_graph"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.GremlinGraph_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/mongocollection/zz_controller.go b/internal/controller/cosmosdb/mongocollection/zz_controller.go index f6a6bb755..f79dce23e 100755 --- a/internal/controller/cosmosdb/mongocollection/zz_controller.go +++ b/internal/controller/cosmosdb/mongocollection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MongoCollection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MongoCollection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MongoCollection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_mongo_collection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_mongo_collection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MongoCollection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/mongodatabase/zz_controller.go b/internal/controller/cosmosdb/mongodatabase/zz_controller.go index a48219eda..21e607b17 100755 --- a/internal/controller/cosmosdb/mongodatabase/zz_controller.go +++ b/internal/controller/cosmosdb/mongodatabase/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MongoDatabase_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MongoDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MongoDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_mongo_database"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_mongo_database"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MongoDatabase_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/sqlcontainer/zz_controller.go b/internal/controller/cosmosdb/sqlcontainer/zz_controller.go index 452195395..5955b27e8 100755 --- a/internal/controller/cosmosdb/sqlcontainer/zz_controller.go +++ b/internal/controller/cosmosdb/sqlcontainer/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SQLContainer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLContainer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLContainer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_container"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_container"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SQLContainer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/sqldatabase/zz_controller.go b/internal/controller/cosmosdb/sqldatabase/zz_controller.go index 3ff6f9826..ddcb8839b 100755 --- a/internal/controller/cosmosdb/sqldatabase/zz_controller.go +++ b/internal/controller/cosmosdb/sqldatabase/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SQLDatabase_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_database"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_database"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SQLDatabase_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/sqldedicatedgateway/zz_controller.go b/internal/controller/cosmosdb/sqldedicatedgateway/zz_controller.go index 12f05c234..bbff7629d 100755 --- a/internal/controller/cosmosdb/sqldedicatedgateway/zz_controller.go +++ b/internal/controller/cosmosdb/sqldedicatedgateway/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SQLDedicatedGateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLDedicatedGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLDedicatedGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_dedicated_gateway"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_dedicated_gateway"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SQLDedicatedGateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/sqlfunction/zz_controller.go b/internal/controller/cosmosdb/sqlfunction/zz_controller.go index e9ccfc849..4f87612b0 100755 --- a/internal/controller/cosmosdb/sqlfunction/zz_controller.go +++ b/internal/controller/cosmosdb/sqlfunction/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SQLFunction_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLFunction_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLFunction_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_function"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_function"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SQLFunction_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/sqlroleassignment/zz_controller.go b/internal/controller/cosmosdb/sqlroleassignment/zz_controller.go index 5e8a454ac..e1d09135d 100755 --- a/internal/controller/cosmosdb/sqlroleassignment/zz_controller.go +++ b/internal/controller/cosmosdb/sqlroleassignment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SQLRoleAssignment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLRoleAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLRoleAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_role_assignment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_role_assignment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SQLRoleAssignment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/sqlroledefinition/zz_controller.go b/internal/controller/cosmosdb/sqlroledefinition/zz_controller.go index 20c18d5d0..2144a8301 100755 --- a/internal/controller/cosmosdb/sqlroledefinition/zz_controller.go +++ b/internal/controller/cosmosdb/sqlroledefinition/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SQLRoleDefinition_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLRoleDefinition_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLRoleDefinition_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_role_definition"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_role_definition"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SQLRoleDefinition_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/sqlstoredprocedure/zz_controller.go b/internal/controller/cosmosdb/sqlstoredprocedure/zz_controller.go index 4e036d6b3..6680cabe8 100755 --- a/internal/controller/cosmosdb/sqlstoredprocedure/zz_controller.go +++ b/internal/controller/cosmosdb/sqlstoredprocedure/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SQLStoredProcedure_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLStoredProcedure_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLStoredProcedure_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_stored_procedure"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_stored_procedure"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SQLStoredProcedure_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/sqltrigger/zz_controller.go b/internal/controller/cosmosdb/sqltrigger/zz_controller.go index 521074df8..11e82a047 100755 --- a/internal/controller/cosmosdb/sqltrigger/zz_controller.go +++ b/internal/controller/cosmosdb/sqltrigger/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SQLTrigger_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLTrigger_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLTrigger_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_trigger"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_trigger"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SQLTrigger_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/cosmosdb/table/zz_controller.go b/internal/controller/cosmosdb/table/zz_controller.go index 922e4259a..152ef1ed8 100755 --- a/internal/controller/cosmosdb/table/zz_controller.go +++ b/internal/controller/cosmosdb/table/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Table_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Table_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Table_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_table"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_table"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Table_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/costmanagement/costanomalyalert/zz_controller.go b/internal/controller/costmanagement/costanomalyalert/zz_controller.go index c540b0bb6..f6b7ff1f0 100755 --- a/internal/controller/costmanagement/costanomalyalert/zz_controller.go +++ b/internal/controller/costmanagement/costanomalyalert/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/costmanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CostAnomalyAlert_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CostAnomalyAlert_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CostAnomalyAlert_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_cost_anomaly_alert"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cost_anomaly_alert"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CostAnomalyAlert_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/costmanagement/resourcegroupcostmanagementexport/zz_controller.go b/internal/controller/costmanagement/resourcegroupcostmanagementexport/zz_controller.go index a3d62e075..d13825180 100755 --- a/internal/controller/costmanagement/resourcegroupcostmanagementexport/zz_controller.go +++ b/internal/controller/costmanagement/resourcegroupcostmanagementexport/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/costmanagement/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ResourceGroupCostManagementExport_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceGroupCostManagementExport_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceGroupCostManagementExport_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_resource_group_cost_management_export"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_resource_group_cost_management_export"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ResourceGroupCostManagementExport_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/costmanagement/subscriptioncostmanagementexport/zz_controller.go b/internal/controller/costmanagement/subscriptioncostmanagementexport/zz_controller.go index 972ee0d96..00ff6ac48 100755 --- a/internal/controller/costmanagement/subscriptioncostmanagementexport/zz_controller.go +++ b/internal/controller/costmanagement/subscriptioncostmanagementexport/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/costmanagement/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SubscriptionCostManagementExport_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubscriptionCostManagementExport_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubscriptionCostManagementExport_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_subscription_cost_management_export"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_subscription_cost_management_export"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SubscriptionCostManagementExport_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/customproviders/customprovider/zz_controller.go b/internal/controller/customproviders/customprovider/zz_controller.go index 4b29a8917..279094e04 100755 --- a/internal/controller/customproviders/customprovider/zz_controller.go +++ b/internal/controller/customproviders/customprovider/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/customproviders/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CustomProvider_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CustomProvider_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CustomProvider_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_custom_provider"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_custom_provider"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CustomProvider_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/databoxedge/device/zz_controller.go b/internal/controller/databoxedge/device/zz_controller.go index 143e1b418..70ef2c0de 100755 --- a/internal/controller/databoxedge/device/zz_controller.go +++ b/internal/controller/databoxedge/device/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/databoxedge/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Device_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Device_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Device_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_databox_edge_device"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_databox_edge_device"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Device_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/databricks/accessconnector/zz_controller.go b/internal/controller/databricks/accessconnector/zz_controller.go index 58f5adbc6..062a8533d 100755 --- a/internal/controller/databricks/accessconnector/zz_controller.go +++ b/internal/controller/databricks/accessconnector/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/databricks/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AccessConnector_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AccessConnector_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AccessConnector_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_databricks_access_connector"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_databricks_access_connector"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AccessConnector_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/databricks/workspace/zz_controller.go b/internal/controller/databricks/workspace/zz_controller.go index 638f1f6c1..bba320c93 100755 --- a/internal/controller/databricks/workspace/zz_controller.go +++ b/internal/controller/databricks/workspace/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/databricks/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Workspace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Workspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Workspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_databricks_workspace"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_databricks_workspace"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Workspace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/databricks/workspacecustomermanagedkey/zz_controller.go b/internal/controller/databricks/workspacecustomermanagedkey/zz_controller.go index b4483fdbe..b35964082 100755 --- a/internal/controller/databricks/workspacecustomermanagedkey/zz_controller.go +++ b/internal/controller/databricks/workspacecustomermanagedkey/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/databricks/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WorkspaceCustomerManagedKey_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WorkspaceCustomerManagedKey_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WorkspaceCustomerManagedKey_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_databricks_workspace_customer_managed_key"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_databricks_workspace_customer_managed_key"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WorkspaceCustomerManagedKey_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/customdataset/zz_controller.go b/internal/controller/datafactory/customdataset/zz_controller.go index 46406df76..441c4a237 100755 --- a/internal/controller/datafactory/customdataset/zz_controller.go +++ b/internal/controller/datafactory/customdataset/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CustomDataSet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CustomDataSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CustomDataSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_custom_dataset"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_custom_dataset"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CustomDataSet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/dataflow/zz_controller.go b/internal/controller/datafactory/dataflow/zz_controller.go index 30e72af02..8b47ec369 100755 --- a/internal/controller/datafactory/dataflow/zz_controller.go +++ b/internal/controller/datafactory/dataflow/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataFlow_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataFlow_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataFlow_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_data_flow"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_data_flow"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataFlow_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/datasetazureblob/zz_controller.go b/internal/controller/datafactory/datasetazureblob/zz_controller.go index ff5468b55..4de51b443 100755 --- a/internal/controller/datafactory/datasetazureblob/zz_controller.go +++ b/internal/controller/datafactory/datasetazureblob/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetAzureBlob_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetAzureBlob_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetAzureBlob_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_azure_blob"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_azure_blob"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetAzureBlob_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/datasetbinary/zz_controller.go b/internal/controller/datafactory/datasetbinary/zz_controller.go index 49eae072e..153811670 100755 --- a/internal/controller/datafactory/datasetbinary/zz_controller.go +++ b/internal/controller/datafactory/datasetbinary/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetBinary_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetBinary_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetBinary_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_binary"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_binary"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetBinary_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/datasetcosmosdbsqlapi/zz_controller.go b/internal/controller/datafactory/datasetcosmosdbsqlapi/zz_controller.go index 74054af1c..335bf93ef 100755 --- a/internal/controller/datafactory/datasetcosmosdbsqlapi/zz_controller.go +++ b/internal/controller/datafactory/datasetcosmosdbsqlapi/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetCosmosDBSQLAPI_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetCosmosDBSQLAPI_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetCosmosDBSQLAPI_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_cosmosdb_sqlapi"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_cosmosdb_sqlapi"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetCosmosDBSQLAPI_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/datasetdelimitedtext/zz_controller.go b/internal/controller/datafactory/datasetdelimitedtext/zz_controller.go index 71acdb83a..1480123ac 100755 --- a/internal/controller/datafactory/datasetdelimitedtext/zz_controller.go +++ b/internal/controller/datafactory/datasetdelimitedtext/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetDelimitedText_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetDelimitedText_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetDelimitedText_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_delimited_text"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_delimited_text"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetDelimitedText_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/datasethttp/zz_controller.go b/internal/controller/datafactory/datasethttp/zz_controller.go index f1edf1015..de9805dcf 100755 --- a/internal/controller/datafactory/datasethttp/zz_controller.go +++ b/internal/controller/datafactory/datasethttp/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetHTTP_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetHTTP_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetHTTP_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_http"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_http"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetHTTP_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/datasetjson/zz_controller.go b/internal/controller/datafactory/datasetjson/zz_controller.go index 9969542d3..34be9b254 100755 --- a/internal/controller/datafactory/datasetjson/zz_controller.go +++ b/internal/controller/datafactory/datasetjson/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetJSON_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetJSON_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetJSON_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_json"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_json"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetJSON_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/datasetmysql/zz_controller.go b/internal/controller/datafactory/datasetmysql/zz_controller.go index e80bffc15..eb88f6f56 100755 --- a/internal/controller/datafactory/datasetmysql/zz_controller.go +++ b/internal/controller/datafactory/datasetmysql/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetMySQL_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetMySQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetMySQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_mysql"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_mysql"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetMySQL_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/datasetparquet/zz_controller.go b/internal/controller/datafactory/datasetparquet/zz_controller.go index d16cc3c83..31a934367 100755 --- a/internal/controller/datafactory/datasetparquet/zz_controller.go +++ b/internal/controller/datafactory/datasetparquet/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetParquet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetParquet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetParquet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_parquet"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_parquet"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetParquet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/datasetpostgresql/zz_controller.go b/internal/controller/datafactory/datasetpostgresql/zz_controller.go index 170e5d9d3..de9fa80df 100755 --- a/internal/controller/datafactory/datasetpostgresql/zz_controller.go +++ b/internal/controller/datafactory/datasetpostgresql/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetPostgreSQL_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetPostgreSQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetPostgreSQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_postgresql"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_postgresql"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetPostgreSQL_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/datasetsnowflake/zz_controller.go b/internal/controller/datafactory/datasetsnowflake/zz_controller.go index 03dbbc198..775eff19d 100755 --- a/internal/controller/datafactory/datasetsnowflake/zz_controller.go +++ b/internal/controller/datafactory/datasetsnowflake/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetSnowflake_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetSnowflake_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetSnowflake_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_snowflake"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_snowflake"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetSnowflake_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/datasetsqlservertable/zz_controller.go b/internal/controller/datafactory/datasetsqlservertable/zz_controller.go index 4d2cbe277..d127f0ffd 100755 --- a/internal/controller/datafactory/datasetsqlservertable/zz_controller.go +++ b/internal/controller/datafactory/datasetsqlservertable/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetSQLServerTable_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetSQLServerTable_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetSQLServerTable_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_sql_server_table"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_sql_server_table"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetSQLServerTable_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/factory/zz_controller.go b/internal/controller/datafactory/factory/zz_controller.go index 784330b42..8cde9aae0 100755 --- a/internal/controller/datafactory/factory/zz_controller.go +++ b/internal/controller/datafactory/factory/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Factory_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Factory_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Factory_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Factory_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/integrationruntimeazure/zz_controller.go b/internal/controller/datafactory/integrationruntimeazure/zz_controller.go index ab12c3a61..4cccbaec0 100755 --- a/internal/controller/datafactory/integrationruntimeazure/zz_controller.go +++ b/internal/controller/datafactory/integrationruntimeazure/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IntegrationRuntimeAzure_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IntegrationRuntimeAzure_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IntegrationRuntimeAzure_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_integration_runtime_azure"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_integration_runtime_azure"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IntegrationRuntimeAzure_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/integrationruntimeazuressis/zz_controller.go b/internal/controller/datafactory/integrationruntimeazuressis/zz_controller.go index dc979c1e2..0a561d8f6 100755 --- a/internal/controller/datafactory/integrationruntimeazuressis/zz_controller.go +++ b/internal/controller/datafactory/integrationruntimeazuressis/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IntegrationRuntimeAzureSSIS_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IntegrationRuntimeAzureSSIS_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IntegrationRuntimeAzureSSIS_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_integration_runtime_azure_ssis"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_integration_runtime_azure_ssis"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IntegrationRuntimeAzureSSIS_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/integrationruntimemanaged/zz_controller.go b/internal/controller/datafactory/integrationruntimemanaged/zz_controller.go index 1f0d89798..5f40b9bf0 100755 --- a/internal/controller/datafactory/integrationruntimemanaged/zz_controller.go +++ b/internal/controller/datafactory/integrationruntimemanaged/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IntegrationRuntimeManaged_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IntegrationRuntimeManaged_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IntegrationRuntimeManaged_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_integration_runtime_managed"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_integration_runtime_managed"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IntegrationRuntimeManaged_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/integrationruntimeselfhosted/zz_controller.go b/internal/controller/datafactory/integrationruntimeselfhosted/zz_controller.go index 8cfe0f5f6..3e6912e05 100755 --- a/internal/controller/datafactory/integrationruntimeselfhosted/zz_controller.go +++ b/internal/controller/datafactory/integrationruntimeselfhosted/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IntegrationRuntimeSelfHosted_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IntegrationRuntimeSelfHosted_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IntegrationRuntimeSelfHosted_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_integration_runtime_self_hosted"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_integration_runtime_self_hosted"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IntegrationRuntimeSelfHosted_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedcustomservice/zz_controller.go b/internal/controller/datafactory/linkedcustomservice/zz_controller.go index 1ff82930a..85dba57e2 100755 --- a/internal/controller/datafactory/linkedcustomservice/zz_controller.go +++ b/internal/controller/datafactory/linkedcustomservice/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedCustomService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedCustomService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedCustomService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_custom_service"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_custom_service"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedCustomService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedserviceazureblobstorage/zz_controller.go b/internal/controller/datafactory/linkedserviceazureblobstorage/zz_controller.go index 856a3a6ef..c9c856292 100755 --- a/internal/controller/datafactory/linkedserviceazureblobstorage/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceazureblobstorage/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceAzureBlobStorage_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureBlobStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureBlobStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_blob_storage"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_blob_storage"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceAzureBlobStorage_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedserviceazuredatabricks/zz_controller.go b/internal/controller/datafactory/linkedserviceazuredatabricks/zz_controller.go index 5ec389bbd..803c39092 100755 --- a/internal/controller/datafactory/linkedserviceazuredatabricks/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceazuredatabricks/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceAzureDatabricks_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureDatabricks_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureDatabricks_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_databricks"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_databricks"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceAzureDatabricks_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedserviceazurefilestorage/zz_controller.go b/internal/controller/datafactory/linkedserviceazurefilestorage/zz_controller.go index a16d95575..ec537990c 100755 --- a/internal/controller/datafactory/linkedserviceazurefilestorage/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceazurefilestorage/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceAzureFileStorage_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureFileStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureFileStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_file_storage"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_file_storage"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceAzureFileStorage_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedserviceazurefunction/zz_controller.go b/internal/controller/datafactory/linkedserviceazurefunction/zz_controller.go index 42787cb07..7075eda74 100755 --- a/internal/controller/datafactory/linkedserviceazurefunction/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceazurefunction/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceAzureFunction_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureFunction_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureFunction_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_function"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_function"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceAzureFunction_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedserviceazuresearch/zz_controller.go b/internal/controller/datafactory/linkedserviceazuresearch/zz_controller.go index e6f8e52af..40490a34f 100755 --- a/internal/controller/datafactory/linkedserviceazuresearch/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceazuresearch/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceAzureSearch_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureSearch_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureSearch_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_search"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_search"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceAzureSearch_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedserviceazuresqldatabase/zz_controller.go b/internal/controller/datafactory/linkedserviceazuresqldatabase/zz_controller.go index 55076c0f2..8b4c40d0f 100755 --- a/internal/controller/datafactory/linkedserviceazuresqldatabase/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceazuresqldatabase/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceAzureSQLDatabase_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureSQLDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureSQLDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_sql_database"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_sql_database"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceAzureSQLDatabase_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedserviceazuretablestorage/zz_controller.go b/internal/controller/datafactory/linkedserviceazuretablestorage/zz_controller.go index 4094bf079..cedd1bceb 100755 --- a/internal/controller/datafactory/linkedserviceazuretablestorage/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceazuretablestorage/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceAzureTableStorage_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureTableStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureTableStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_table_storage"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_table_storage"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceAzureTableStorage_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedservicecosmosdb/zz_controller.go b/internal/controller/datafactory/linkedservicecosmosdb/zz_controller.go index a64586728..fccd3f689 100755 --- a/internal/controller/datafactory/linkedservicecosmosdb/zz_controller.go +++ b/internal/controller/datafactory/linkedservicecosmosdb/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceCosmosDB_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceCosmosDB_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceCosmosDB_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_cosmosdb"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_cosmosdb"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceCosmosDB_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedservicecosmosdbmongoapi/zz_controller.go b/internal/controller/datafactory/linkedservicecosmosdbmongoapi/zz_controller.go index 60465edaa..5fdf4cdc6 100755 --- a/internal/controller/datafactory/linkedservicecosmosdbmongoapi/zz_controller.go +++ b/internal/controller/datafactory/linkedservicecosmosdbmongoapi/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceCosmosDBMongoapi_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceCosmosDBMongoapi_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceCosmosDBMongoapi_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_cosmosdb_mongoapi"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_cosmosdb_mongoapi"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceCosmosDBMongoapi_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedservicedatalakestoragegen2/zz_controller.go b/internal/controller/datafactory/linkedservicedatalakestoragegen2/zz_controller.go index d441cffdc..d6cb7d807 100755 --- a/internal/controller/datafactory/linkedservicedatalakestoragegen2/zz_controller.go +++ b/internal/controller/datafactory/linkedservicedatalakestoragegen2/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceDataLakeStorageGen2_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceDataLakeStorageGen2_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceDataLakeStorageGen2_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_data_lake_storage_gen2"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_data_lake_storage_gen2"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceDataLakeStorageGen2_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedservicekeyvault/zz_controller.go b/internal/controller/datafactory/linkedservicekeyvault/zz_controller.go index 6e28644aa..16fa4d7ca 100755 --- a/internal/controller/datafactory/linkedservicekeyvault/zz_controller.go +++ b/internal/controller/datafactory/linkedservicekeyvault/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceKeyVault_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceKeyVault_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceKeyVault_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_key_vault"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_key_vault"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceKeyVault_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedservicekusto/zz_controller.go b/internal/controller/datafactory/linkedservicekusto/zz_controller.go index 226b1e00b..25dd3339c 100755 --- a/internal/controller/datafactory/linkedservicekusto/zz_controller.go +++ b/internal/controller/datafactory/linkedservicekusto/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceKusto_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceKusto_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceKusto_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_kusto"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_kusto"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceKusto_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedservicemysql/zz_controller.go b/internal/controller/datafactory/linkedservicemysql/zz_controller.go index c583ff159..6d4b9649b 100755 --- a/internal/controller/datafactory/linkedservicemysql/zz_controller.go +++ b/internal/controller/datafactory/linkedservicemysql/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceMySQL_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceMySQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceMySQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_mysql"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_mysql"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceMySQL_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedserviceodata/zz_controller.go b/internal/controller/datafactory/linkedserviceodata/zz_controller.go index c43a145ff..c5026f7ef 100755 --- a/internal/controller/datafactory/linkedserviceodata/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceodata/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceOData_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceOData_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceOData_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_odata"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_odata"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceOData_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedserviceodbc/zz_controller.go b/internal/controller/datafactory/linkedserviceodbc/zz_controller.go index 0d0d87bb5..7fe79d0f3 100755 --- a/internal/controller/datafactory/linkedserviceodbc/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceodbc/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceOdbc_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceOdbc_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceOdbc_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_odbc"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_odbc"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceOdbc_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedservicepostgresql/zz_controller.go b/internal/controller/datafactory/linkedservicepostgresql/zz_controller.go index edf9b4016..0d4e97ac7 100755 --- a/internal/controller/datafactory/linkedservicepostgresql/zz_controller.go +++ b/internal/controller/datafactory/linkedservicepostgresql/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServicePostgreSQL_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServicePostgreSQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServicePostgreSQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_postgresql"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_postgresql"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServicePostgreSQL_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedservicesftp/zz_controller.go b/internal/controller/datafactory/linkedservicesftp/zz_controller.go index 4908581d6..a0119ccbe 100755 --- a/internal/controller/datafactory/linkedservicesftp/zz_controller.go +++ b/internal/controller/datafactory/linkedservicesftp/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceSFTP_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceSFTP_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceSFTP_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_sftp"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_sftp"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceSFTP_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedservicesnowflake/zz_controller.go b/internal/controller/datafactory/linkedservicesnowflake/zz_controller.go index 4fa2d93a1..2be93e763 100755 --- a/internal/controller/datafactory/linkedservicesnowflake/zz_controller.go +++ b/internal/controller/datafactory/linkedservicesnowflake/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceSnowflake_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceSnowflake_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceSnowflake_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_snowflake"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_snowflake"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceSnowflake_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedservicesqlserver/zz_controller.go b/internal/controller/datafactory/linkedservicesqlserver/zz_controller.go index 61a150deb..5a822aff1 100755 --- a/internal/controller/datafactory/linkedservicesqlserver/zz_controller.go +++ b/internal/controller/datafactory/linkedservicesqlserver/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceSQLServer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceSQLServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceSQLServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_sql_server"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_sql_server"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceSQLServer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedservicesynapse/zz_controller.go b/internal/controller/datafactory/linkedservicesynapse/zz_controller.go index 3f6c2b661..2e0b6aa9f 100755 --- a/internal/controller/datafactory/linkedservicesynapse/zz_controller.go +++ b/internal/controller/datafactory/linkedservicesynapse/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceSynapse_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceSynapse_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceSynapse_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_synapse"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_synapse"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceSynapse_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/linkedserviceweb/zz_controller.go b/internal/controller/datafactory/linkedserviceweb/zz_controller.go index d9c62c4c4..5208e94bf 100755 --- a/internal/controller/datafactory/linkedserviceweb/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceweb/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceWeb_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceWeb_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceWeb_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_web"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_web"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceWeb_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/managedprivateendpoint/zz_controller.go b/internal/controller/datafactory/managedprivateendpoint/zz_controller.go index 0771f48e3..8a9c75996 100755 --- a/internal/controller/datafactory/managedprivateendpoint/zz_controller.go +++ b/internal/controller/datafactory/managedprivateendpoint/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagedPrivateEndpoint_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedPrivateEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedPrivateEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_managed_private_endpoint"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_managed_private_endpoint"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagedPrivateEndpoint_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/pipeline/zz_controller.go b/internal/controller/datafactory/pipeline/zz_controller.go index e28146472..4dd761222 100755 --- a/internal/controller/datafactory/pipeline/zz_controller.go +++ b/internal/controller/datafactory/pipeline/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Pipeline_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Pipeline_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Pipeline_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_pipeline"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_pipeline"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Pipeline_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/triggerblobevent/zz_controller.go b/internal/controller/datafactory/triggerblobevent/zz_controller.go index 3df53eebe..565717aa3 100755 --- a/internal/controller/datafactory/triggerblobevent/zz_controller.go +++ b/internal/controller/datafactory/triggerblobevent/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.TriggerBlobEvent_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TriggerBlobEvent_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TriggerBlobEvent_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_trigger_blob_event"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_trigger_blob_event"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.TriggerBlobEvent_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/triggercustomevent/zz_controller.go b/internal/controller/datafactory/triggercustomevent/zz_controller.go index e2b14018b..cebe769ba 100755 --- a/internal/controller/datafactory/triggercustomevent/zz_controller.go +++ b/internal/controller/datafactory/triggercustomevent/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.TriggerCustomEvent_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TriggerCustomEvent_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TriggerCustomEvent_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_trigger_custom_event"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_trigger_custom_event"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.TriggerCustomEvent_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datafactory/triggerschedule/zz_controller.go b/internal/controller/datafactory/triggerschedule/zz_controller.go index a769b2193..96ec63ce5 100755 --- a/internal/controller/datafactory/triggerschedule/zz_controller.go +++ b/internal/controller/datafactory/triggerschedule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.TriggerSchedule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TriggerSchedule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TriggerSchedule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_trigger_schedule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_trigger_schedule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.TriggerSchedule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datamigration/databasemigrationproject/zz_controller.go b/internal/controller/datamigration/databasemigrationproject/zz_controller.go index 6b1eb3821..a32689235 100755 --- a/internal/controller/datamigration/databasemigrationproject/zz_controller.go +++ b/internal/controller/datamigration/databasemigrationproject/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datamigration/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DatabaseMigrationProject_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DatabaseMigrationProject_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DatabaseMigrationProject_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_database_migration_project"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_database_migration_project"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DatabaseMigrationProject_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datamigration/databasemigrationservice/zz_controller.go b/internal/controller/datamigration/databasemigrationservice/zz_controller.go index a8941527e..3bbf1be80 100755 --- a/internal/controller/datamigration/databasemigrationservice/zz_controller.go +++ b/internal/controller/datamigration/databasemigrationservice/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datamigration/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DatabaseMigrationService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DatabaseMigrationService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DatabaseMigrationService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_database_migration_service"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_database_migration_service"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DatabaseMigrationService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dataprotection/backupinstanceblobstorage/zz_controller.go b/internal/controller/dataprotection/backupinstanceblobstorage/zz_controller.go index e29f25946..d129d2981 100755 --- a/internal/controller/dataprotection/backupinstanceblobstorage/zz_controller.go +++ b/internal/controller/dataprotection/backupinstanceblobstorage/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dataprotection/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupInstanceBlobStorage_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupInstanceBlobStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupInstanceBlobStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_instance_blob_storage"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_instance_blob_storage"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupInstanceBlobStorage_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dataprotection/backupinstancedisk/zz_controller.go b/internal/controller/dataprotection/backupinstancedisk/zz_controller.go index 88ce73d4a..5b60ac741 100755 --- a/internal/controller/dataprotection/backupinstancedisk/zz_controller.go +++ b/internal/controller/dataprotection/backupinstancedisk/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dataprotection/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupInstanceDisk_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupInstanceDisk_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupInstanceDisk_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_instance_disk"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_instance_disk"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupInstanceDisk_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dataprotection/backupinstancepostgresql/zz_controller.go b/internal/controller/dataprotection/backupinstancepostgresql/zz_controller.go index 5d5c77fde..f196f327f 100755 --- a/internal/controller/dataprotection/backupinstancepostgresql/zz_controller.go +++ b/internal/controller/dataprotection/backupinstancepostgresql/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dataprotection/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupInstancePostgreSQL_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupInstancePostgreSQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupInstancePostgreSQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_instance_postgresql"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_instance_postgresql"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupInstancePostgreSQL_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dataprotection/backuppolicyblobstorage/zz_controller.go b/internal/controller/dataprotection/backuppolicyblobstorage/zz_controller.go index 317b6c708..29f5a443e 100755 --- a/internal/controller/dataprotection/backuppolicyblobstorage/zz_controller.go +++ b/internal/controller/dataprotection/backuppolicyblobstorage/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dataprotection/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupPolicyBlobStorage_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyBlobStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyBlobStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_policy_blob_storage"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_policy_blob_storage"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupPolicyBlobStorage_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dataprotection/backuppolicydisk/zz_controller.go b/internal/controller/dataprotection/backuppolicydisk/zz_controller.go index a15231bd1..0bdb4a44e 100755 --- a/internal/controller/dataprotection/backuppolicydisk/zz_controller.go +++ b/internal/controller/dataprotection/backuppolicydisk/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dataprotection/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupPolicyDisk_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyDisk_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyDisk_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_policy_disk"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_policy_disk"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupPolicyDisk_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dataprotection/backuppolicypostgresql/zz_controller.go b/internal/controller/dataprotection/backuppolicypostgresql/zz_controller.go index e83efcb40..13415ce8c 100755 --- a/internal/controller/dataprotection/backuppolicypostgresql/zz_controller.go +++ b/internal/controller/dataprotection/backuppolicypostgresql/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dataprotection/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupPolicyPostgreSQL_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyPostgreSQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyPostgreSQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_policy_postgresql"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_policy_postgresql"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupPolicyPostgreSQL_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dataprotection/backupvault/zz_controller.go b/internal/controller/dataprotection/backupvault/zz_controller.go index 1c2dc6458..4960bf910 100755 --- a/internal/controller/dataprotection/backupvault/zz_controller.go +++ b/internal/controller/dataprotection/backupvault/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dataprotection/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupVault_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupVault_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupVault_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_vault"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_vault"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupVault_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dataprotection/resourceguard/zz_controller.go b/internal/controller/dataprotection/resourceguard/zz_controller.go index 9bc2ac0be..03fc66476 100755 --- a/internal/controller/dataprotection/resourceguard/zz_controller.go +++ b/internal/controller/dataprotection/resourceguard/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dataprotection/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ResourceGuard_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceGuard_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceGuard_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_resource_guard"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_resource_guard"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ResourceGuard_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datashare/account/zz_controller.go b/internal/controller/datashare/account/zz_controller.go index a75117d1f..9e0495433 100755 --- a/internal/controller/datashare/account/zz_controller.go +++ b/internal/controller/datashare/account/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datashare/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Account_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_share_account"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_share_account"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Account_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datashare/datasetblobstorage/zz_controller.go b/internal/controller/datashare/datasetblobstorage/zz_controller.go index 6f0a5a1ae..eab156552 100755 --- a/internal/controller/datashare/datasetblobstorage/zz_controller.go +++ b/internal/controller/datashare/datasetblobstorage/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datashare/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetBlobStorage_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetBlobStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetBlobStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_share_dataset_blob_storage"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_share_dataset_blob_storage"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetBlobStorage_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datashare/datasetdatalakegen2/zz_controller.go b/internal/controller/datashare/datasetdatalakegen2/zz_controller.go index 53636f755..aad8606b5 100755 --- a/internal/controller/datashare/datasetdatalakegen2/zz_controller.go +++ b/internal/controller/datashare/datasetdatalakegen2/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datashare/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetDataLakeGen2_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetDataLakeGen2_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetDataLakeGen2_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_share_dataset_data_lake_gen2"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_share_dataset_data_lake_gen2"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetDataLakeGen2_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datashare/datasetkustocluster/zz_controller.go b/internal/controller/datashare/datasetkustocluster/zz_controller.go index e3a5b11d7..d8c6d1323 100755 --- a/internal/controller/datashare/datasetkustocluster/zz_controller.go +++ b/internal/controller/datashare/datasetkustocluster/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datashare/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetKustoCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetKustoCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetKustoCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_share_dataset_kusto_cluster"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_share_dataset_kusto_cluster"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetKustoCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datashare/datasetkustodatabase/zz_controller.go b/internal/controller/datashare/datasetkustodatabase/zz_controller.go index c62d66320..30f9680f5 100755 --- a/internal/controller/datashare/datasetkustodatabase/zz_controller.go +++ b/internal/controller/datashare/datasetkustodatabase/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datashare/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetKustoDatabase_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetKustoDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetKustoDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_share_dataset_kusto_database"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_share_dataset_kusto_database"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetKustoDatabase_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/datashare/datashare/zz_controller.go b/internal/controller/datashare/datashare/zz_controller.go index 009a1a429..e4db91058 100755 --- a/internal/controller/datashare/datashare/zz_controller.go +++ b/internal/controller/datashare/datashare/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/datashare/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataShare_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataShare_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataShare_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_data_share"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_share"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataShare_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbformariadb/configuration/zz_controller.go b/internal/controller/dbformariadb/configuration/zz_controller.go index 32ce35d8a..7a63c2991 100755 --- a/internal/controller/dbformariadb/configuration/zz_controller.go +++ b/internal/controller/dbformariadb/configuration/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbformariadb/v1beta1" @@ -36,11 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Configuration_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Configuration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mariadb_configuration"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mariadb_configuration"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Configuration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbformariadb/database/zz_controller.go b/internal/controller/dbformariadb/database/zz_controller.go index 2c9550c90..33a20cd6b 100755 --- a/internal/controller/dbformariadb/database/zz_controller.go +++ b/internal/controller/dbformariadb/database/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbformariadb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Database_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Database_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Database_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mariadb_database"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mariadb_database"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Database_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbformariadb/firewallrule/zz_controller.go b/internal/controller/dbformariadb/firewallrule/zz_controller.go index f87d6e37d..e9fb60a49 100755 --- a/internal/controller/dbformariadb/firewallrule/zz_controller.go +++ b/internal/controller/dbformariadb/firewallrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbformariadb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FirewallRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mariadb_firewall_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mariadb_firewall_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FirewallRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbformariadb/server/zz_controller.go b/internal/controller/dbformariadb/server/zz_controller.go index 859ce20ce..fef34a000 100755 --- a/internal/controller/dbformariadb/server/zz_controller.go +++ b/internal/controller/dbformariadb/server/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbformariadb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Server_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Server_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Server_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mariadb_server"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mariadb_server"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Server_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbformariadb/virtualnetworkrule/zz_controller.go b/internal/controller/dbformariadb/virtualnetworkrule/zz_controller.go index 98a512ade..5e48cb684 100755 --- a/internal/controller/dbformariadb/virtualnetworkrule/zz_controller.go +++ b/internal/controller/dbformariadb/virtualnetworkrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbformariadb/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualNetworkRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetworkRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetworkRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mariadb_virtual_network_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mariadb_virtual_network_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualNetworkRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbformysql/activedirectoryadministrator/zz_controller.go b/internal/controller/dbformysql/activedirectoryadministrator/zz_controller.go index 89dabbca3..e9658093a 100755 --- a/internal/controller/dbformysql/activedirectoryadministrator/zz_controller.go +++ b/internal/controller/dbformysql/activedirectoryadministrator/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbformysql/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ActiveDirectoryAdministrator_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ActiveDirectoryAdministrator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ActiveDirectoryAdministrator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_active_directory_administrator"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_active_directory_administrator"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ActiveDirectoryAdministrator_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbformysql/configuration/zz_controller.go b/internal/controller/dbformysql/configuration/zz_controller.go index 24a000734..fc47ed7da 100755 --- a/internal/controller/dbformysql/configuration/zz_controller.go +++ b/internal/controller/dbformysql/configuration/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbformysql/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Configuration_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Configuration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Configuration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_configuration"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_configuration"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Configuration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbformysql/database/zz_controller.go b/internal/controller/dbformysql/database/zz_controller.go index 840d8fd39..5e44da54c 100755 --- a/internal/controller/dbformysql/database/zz_controller.go +++ b/internal/controller/dbformysql/database/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbformysql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Database_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Database_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Database_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_database"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_database"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Database_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbformysql/firewallrule/zz_controller.go b/internal/controller/dbformysql/firewallrule/zz_controller.go index 7f05f779b..0c02ce232 100755 --- a/internal/controller/dbformysql/firewallrule/zz_controller.go +++ b/internal/controller/dbformysql/firewallrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbformysql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FirewallRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_firewall_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_firewall_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FirewallRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbformysql/flexibledatabase/zz_controller.go b/internal/controller/dbformysql/flexibledatabase/zz_controller.go index 8047899db..708c2558d 100755 --- a/internal/controller/dbformysql/flexibledatabase/zz_controller.go +++ b/internal/controller/dbformysql/flexibledatabase/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbformysql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FlexibleDatabase_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_flexible_database"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_flexible_database"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FlexibleDatabase_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbformysql/flexibleserver/zz_controller.go b/internal/controller/dbformysql/flexibleserver/zz_controller.go index 3aee4b759..026d5b12b 100755 --- a/internal/controller/dbformysql/flexibleserver/zz_controller.go +++ b/internal/controller/dbformysql/flexibleserver/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbformysql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FlexibleServer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_flexible_server"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_flexible_server"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FlexibleServer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbformysql/flexibleserverconfiguration/zz_controller.go b/internal/controller/dbformysql/flexibleserverconfiguration/zz_controller.go index e9d4ae74a..be1ce87f6 100755 --- a/internal/controller/dbformysql/flexibleserverconfiguration/zz_controller.go +++ b/internal/controller/dbformysql/flexibleserverconfiguration/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbformysql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FlexibleServerConfiguration_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServerConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServerConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_flexible_server_configuration"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_flexible_server_configuration"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FlexibleServerConfiguration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbformysql/flexibleserverfirewallrule/zz_controller.go b/internal/controller/dbformysql/flexibleserverfirewallrule/zz_controller.go index 798f9ef34..ca547650d 100755 --- a/internal/controller/dbformysql/flexibleserverfirewallrule/zz_controller.go +++ b/internal/controller/dbformysql/flexibleserverfirewallrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbformysql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FlexibleServerFirewallRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServerFirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServerFirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_flexible_server_firewall_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_flexible_server_firewall_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FlexibleServerFirewallRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbformysql/server/zz_controller.go b/internal/controller/dbformysql/server/zz_controller.go index 53a1aee64..f37c0087c 100755 --- a/internal/controller/dbformysql/server/zz_controller.go +++ b/internal/controller/dbformysql/server/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbformysql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Server_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Server_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Server_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_server"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_server"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Server_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbformysql/virtualnetworkrule/zz_controller.go b/internal/controller/dbformysql/virtualnetworkrule/zz_controller.go index 468efbf72..33f4d5962 100755 --- a/internal/controller/dbformysql/virtualnetworkrule/zz_controller.go +++ b/internal/controller/dbformysql/virtualnetworkrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbformysql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualNetworkRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetworkRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetworkRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_virtual_network_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_virtual_network_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualNetworkRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbforpostgresql/activedirectoryadministrator/zz_controller.go b/internal/controller/dbforpostgresql/activedirectoryadministrator/zz_controller.go index 773b1d50e..b6c4c640d 100755 --- a/internal/controller/dbforpostgresql/activedirectoryadministrator/zz_controller.go +++ b/internal/controller/dbforpostgresql/activedirectoryadministrator/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbforpostgresql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ActiveDirectoryAdministrator_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ActiveDirectoryAdministrator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ActiveDirectoryAdministrator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_active_directory_administrator"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_active_directory_administrator"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ActiveDirectoryAdministrator_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbforpostgresql/configuration/zz_controller.go b/internal/controller/dbforpostgresql/configuration/zz_controller.go index bce06d8bb..c67a03103 100755 --- a/internal/controller/dbforpostgresql/configuration/zz_controller.go +++ b/internal/controller/dbforpostgresql/configuration/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbforpostgresql/v1beta1" @@ -36,11 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Configuration_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Configuration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_configuration"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_configuration"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Configuration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbforpostgresql/database/zz_controller.go b/internal/controller/dbforpostgresql/database/zz_controller.go index e581d2337..139ab543d 100755 --- a/internal/controller/dbforpostgresql/database/zz_controller.go +++ b/internal/controller/dbforpostgresql/database/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbforpostgresql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Database_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Database_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Database_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_database"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_database"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Database_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbforpostgresql/firewallrule/zz_controller.go b/internal/controller/dbforpostgresql/firewallrule/zz_controller.go index 9db99950f..185c4c20b 100755 --- a/internal/controller/dbforpostgresql/firewallrule/zz_controller.go +++ b/internal/controller/dbforpostgresql/firewallrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbforpostgresql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FirewallRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_firewall_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_firewall_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FirewallRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbforpostgresql/flexibleserver/zz_controller.go b/internal/controller/dbforpostgresql/flexibleserver/zz_controller.go index 903255ddd..56caffb9d 100755 --- a/internal/controller/dbforpostgresql/flexibleserver/zz_controller.go +++ b/internal/controller/dbforpostgresql/flexibleserver/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbforpostgresql/v1beta1" @@ -40,14 +40,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FlexibleServer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_flexible_server"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_flexible_server"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FlexibleServer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbforpostgresql/flexibleserveractivedirectoryadministrator/zz_controller.go b/internal/controller/dbforpostgresql/flexibleserveractivedirectoryadministrator/zz_controller.go index 7eeb99241..d0fcfee9e 100755 --- a/internal/controller/dbforpostgresql/flexibleserveractivedirectoryadministrator/zz_controller.go +++ b/internal/controller/dbforpostgresql/flexibleserveractivedirectoryadministrator/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbforpostgresql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FlexibleServerActiveDirectoryAdministrator_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServerActiveDirectoryAdministrator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServerActiveDirectoryAdministrator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_flexible_server_active_directory_administrator"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_flexible_server_active_directory_administrator"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FlexibleServerActiveDirectoryAdministrator_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbforpostgresql/flexibleserverconfiguration/zz_controller.go b/internal/controller/dbforpostgresql/flexibleserverconfiguration/zz_controller.go index 8ce93705c..a81b61712 100755 --- a/internal/controller/dbforpostgresql/flexibleserverconfiguration/zz_controller.go +++ b/internal/controller/dbforpostgresql/flexibleserverconfiguration/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbforpostgresql/v1beta1" @@ -36,11 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FlexibleServerConfiguration_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServerConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_flexible_server_configuration"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_flexible_server_configuration"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FlexibleServerConfiguration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbforpostgresql/flexibleserverdatabase/zz_controller.go b/internal/controller/dbforpostgresql/flexibleserverdatabase/zz_controller.go index 9c9ebb6cd..5c51badf5 100755 --- a/internal/controller/dbforpostgresql/flexibleserverdatabase/zz_controller.go +++ b/internal/controller/dbforpostgresql/flexibleserverdatabase/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbforpostgresql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FlexibleServerDatabase_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServerDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServerDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_flexible_server_database"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_flexible_server_database"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FlexibleServerDatabase_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbforpostgresql/flexibleserverfirewallrule/zz_controller.go b/internal/controller/dbforpostgresql/flexibleserverfirewallrule/zz_controller.go index 43ae11206..751dea9ad 100755 --- a/internal/controller/dbforpostgresql/flexibleserverfirewallrule/zz_controller.go +++ b/internal/controller/dbforpostgresql/flexibleserverfirewallrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbforpostgresql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FlexibleServerFirewallRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServerFirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServerFirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_flexible_server_firewall_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_flexible_server_firewall_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FlexibleServerFirewallRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbforpostgresql/server/zz_controller.go b/internal/controller/dbforpostgresql/server/zz_controller.go index b050d8adb..f4445fd7a 100755 --- a/internal/controller/dbforpostgresql/server/zz_controller.go +++ b/internal/controller/dbforpostgresql/server/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbforpostgresql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Server_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Server_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Server_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_server"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_server"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Server_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbforpostgresql/serverkey/zz_controller.go b/internal/controller/dbforpostgresql/serverkey/zz_controller.go index 71db1ba13..875924aa7 100755 --- a/internal/controller/dbforpostgresql/serverkey/zz_controller.go +++ b/internal/controller/dbforpostgresql/serverkey/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbforpostgresql/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ServerKey_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ServerKey_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ServerKey_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_server_key"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_server_key"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ServerKey_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/dbforpostgresql/virtualnetworkrule/zz_controller.go b/internal/controller/dbforpostgresql/virtualnetworkrule/zz_controller.go index 01f688ec9..3f4d4b56c 100755 --- a/internal/controller/dbforpostgresql/virtualnetworkrule/zz_controller.go +++ b/internal/controller/dbforpostgresql/virtualnetworkrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/dbforpostgresql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualNetworkRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetworkRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetworkRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_virtual_network_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_virtual_network_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualNetworkRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devices/iothub/zz_controller.go b/internal/controller/devices/iothub/zz_controller.go index 22f59e7fd..8529325bf 100755 --- a/internal/controller/devices/iothub/zz_controller.go +++ b/internal/controller/devices/iothub/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iothub"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devices/iothubcertificate/zz_controller.go b/internal/controller/devices/iothubcertificate/zz_controller.go index 90f9cb702..c83332896 100755 --- a/internal/controller/devices/iothubcertificate/zz_controller.go +++ b/internal/controller/devices/iothubcertificate/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubCertificate_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubCertificate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubCertificate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_certificate"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_certificate"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubCertificate_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devices/iothubconsumergroup/zz_controller.go b/internal/controller/devices/iothubconsumergroup/zz_controller.go index 4f6e5cd3a..809d2c298 100755 --- a/internal/controller/devices/iothubconsumergroup/zz_controller.go +++ b/internal/controller/devices/iothubconsumergroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubConsumerGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubConsumerGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubConsumerGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_consumer_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_consumer_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubConsumerGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devices/iothubdps/zz_controller.go b/internal/controller/devices/iothubdps/zz_controller.go index 025d0b48a..6fa028635 100755 --- a/internal/controller/devices/iothubdps/zz_controller.go +++ b/internal/controller/devices/iothubdps/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubDPS_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubDPS_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubDPS_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_dps"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_dps"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubDPS_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devices/iothubdpscertificate/zz_controller.go b/internal/controller/devices/iothubdpscertificate/zz_controller.go index 2e84c3372..6315505ee 100755 --- a/internal/controller/devices/iothubdpscertificate/zz_controller.go +++ b/internal/controller/devices/iothubdpscertificate/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubDPSCertificate_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubDPSCertificate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubDPSCertificate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_dps_certificate"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_dps_certificate"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubDPSCertificate_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devices/iothubdpssharedaccesspolicy/zz_controller.go b/internal/controller/devices/iothubdpssharedaccesspolicy/zz_controller.go index b0846a850..fb0a50bcd 100755 --- a/internal/controller/devices/iothubdpssharedaccesspolicy/zz_controller.go +++ b/internal/controller/devices/iothubdpssharedaccesspolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubDPSSharedAccessPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubDPSSharedAccessPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubDPSSharedAccessPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_dps_shared_access_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_dps_shared_access_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubDPSSharedAccessPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devices/iothubendpointeventhub/zz_controller.go b/internal/controller/devices/iothubendpointeventhub/zz_controller.go index 99ba60604..2fa595308 100755 --- a/internal/controller/devices/iothubendpointeventhub/zz_controller.go +++ b/internal/controller/devices/iothubendpointeventhub/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubEndpointEventHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubEndpointEventHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubEndpointEventHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_endpoint_eventhub"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_endpoint_eventhub"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubEndpointEventHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devices/iothubendpointservicebusqueue/zz_controller.go b/internal/controller/devices/iothubendpointservicebusqueue/zz_controller.go index 6e533eb79..e74d1c016 100755 --- a/internal/controller/devices/iothubendpointservicebusqueue/zz_controller.go +++ b/internal/controller/devices/iothubendpointservicebusqueue/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubEndpointServiceBusQueue_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubEndpointServiceBusQueue_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubEndpointServiceBusQueue_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_endpoint_servicebus_queue"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_endpoint_servicebus_queue"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubEndpointServiceBusQueue_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devices/iothubendpointservicebustopic/zz_controller.go b/internal/controller/devices/iothubendpointservicebustopic/zz_controller.go index 31fb65cc7..5add9e638 100755 --- a/internal/controller/devices/iothubendpointservicebustopic/zz_controller.go +++ b/internal/controller/devices/iothubendpointservicebustopic/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubEndpointServiceBusTopic_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubEndpointServiceBusTopic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubEndpointServiceBusTopic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_endpoint_servicebus_topic"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_endpoint_servicebus_topic"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubEndpointServiceBusTopic_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devices/iothubendpointstoragecontainer/zz_controller.go b/internal/controller/devices/iothubendpointstoragecontainer/zz_controller.go index a27e1bae5..5a1a21799 100755 --- a/internal/controller/devices/iothubendpointstoragecontainer/zz_controller.go +++ b/internal/controller/devices/iothubendpointstoragecontainer/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubEndpointStorageContainer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubEndpointStorageContainer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubEndpointStorageContainer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_endpoint_storage_container"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_endpoint_storage_container"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubEndpointStorageContainer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devices/iothubenrichment/zz_controller.go b/internal/controller/devices/iothubenrichment/zz_controller.go index 64f56ac42..acc62423d 100755 --- a/internal/controller/devices/iothubenrichment/zz_controller.go +++ b/internal/controller/devices/iothubenrichment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devices/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubEnrichment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubEnrichment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubEnrichment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_enrichment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_enrichment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubEnrichment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devices/iothubfallbackroute/zz_controller.go b/internal/controller/devices/iothubfallbackroute/zz_controller.go index 94ed4b946..d04447f4b 100755 --- a/internal/controller/devices/iothubfallbackroute/zz_controller.go +++ b/internal/controller/devices/iothubfallbackroute/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubFallbackRoute_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubFallbackRoute_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubFallbackRoute_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_fallback_route"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_fallback_route"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubFallbackRoute_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devices/iothubroute/zz_controller.go b/internal/controller/devices/iothubroute/zz_controller.go index 19f11fd43..717824252 100755 --- a/internal/controller/devices/iothubroute/zz_controller.go +++ b/internal/controller/devices/iothubroute/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubRoute_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubRoute_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubRoute_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_route"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_route"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubRoute_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devices/iothubsharedaccesspolicy/zz_controller.go b/internal/controller/devices/iothubsharedaccesspolicy/zz_controller.go index 3260298ad..05f261c60 100755 --- a/internal/controller/devices/iothubsharedaccesspolicy/zz_controller.go +++ b/internal/controller/devices/iothubsharedaccesspolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubSharedAccessPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubSharedAccessPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubSharedAccessPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_shared_access_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_shared_access_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubSharedAccessPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/deviceupdate/iothubdeviceupdateaccount/zz_controller.go b/internal/controller/deviceupdate/iothubdeviceupdateaccount/zz_controller.go index 91bd081d0..b35d90d5d 100755 --- a/internal/controller/deviceupdate/iothubdeviceupdateaccount/zz_controller.go +++ b/internal/controller/deviceupdate/iothubdeviceupdateaccount/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/deviceupdate/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubDeviceUpdateAccount_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubDeviceUpdateAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubDeviceUpdateAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_device_update_account"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_device_update_account"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubDeviceUpdateAccount_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/deviceupdate/iothubdeviceupdateinstance/zz_controller.go b/internal/controller/deviceupdate/iothubdeviceupdateinstance/zz_controller.go index b6052fb25..bc2c511f8 100755 --- a/internal/controller/deviceupdate/iothubdeviceupdateinstance/zz_controller.go +++ b/internal/controller/deviceupdate/iothubdeviceupdateinstance/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/deviceupdate/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubDeviceUpdateInstance_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubDeviceUpdateInstance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubDeviceUpdateInstance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_device_update_instance"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_device_update_instance"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubDeviceUpdateInstance_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devtestlab/globalvmshutdownschedule/zz_controller.go b/internal/controller/devtestlab/globalvmshutdownschedule/zz_controller.go index 096902995..da9eb441a 100755 --- a/internal/controller/devtestlab/globalvmshutdownschedule/zz_controller.go +++ b/internal/controller/devtestlab/globalvmshutdownschedule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devtestlab/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.GlobalVMShutdownSchedule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GlobalVMShutdownSchedule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GlobalVMShutdownSchedule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_global_vm_shutdown_schedule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_global_vm_shutdown_schedule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.GlobalVMShutdownSchedule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devtestlab/lab/zz_controller.go b/internal/controller/devtestlab/lab/zz_controller.go index ead41b6ff..70b79fd62 100755 --- a/internal/controller/devtestlab/lab/zz_controller.go +++ b/internal/controller/devtestlab/lab/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devtestlab/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Lab_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Lab_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Lab_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_lab"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_lab"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Lab_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devtestlab/linuxvirtualmachine/zz_controller.go b/internal/controller/devtestlab/linuxvirtualmachine/zz_controller.go index 171e641f5..cbf576c4c 100755 --- a/internal/controller/devtestlab/linuxvirtualmachine/zz_controller.go +++ b/internal/controller/devtestlab/linuxvirtualmachine/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devtestlab/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinuxVirtualMachine_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_linux_virtual_machine"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_linux_virtual_machine"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinuxVirtualMachine_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devtestlab/policy/zz_controller.go b/internal/controller/devtestlab/policy/zz_controller.go index cc7bd4b07..b23c5d508 100755 --- a/internal/controller/devtestlab/policy/zz_controller.go +++ b/internal/controller/devtestlab/policy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devtestlab/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Policy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Policy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Policy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Policy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devtestlab/schedule/zz_controller.go b/internal/controller/devtestlab/schedule/zz_controller.go index 5984a118f..161d89de5 100755 --- a/internal/controller/devtestlab/schedule/zz_controller.go +++ b/internal/controller/devtestlab/schedule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devtestlab/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Schedule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Schedule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Schedule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_schedule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_schedule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Schedule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devtestlab/virtualnetwork/zz_controller.go b/internal/controller/devtestlab/virtualnetwork/zz_controller.go index 4655c6453..80a790e3c 100755 --- a/internal/controller/devtestlab/virtualnetwork/zz_controller.go +++ b/internal/controller/devtestlab/virtualnetwork/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devtestlab/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualNetwork_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetwork_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetwork_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_virtual_network"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_virtual_network"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualNetwork_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/devtestlab/windowsvirtualmachine/zz_controller.go b/internal/controller/devtestlab/windowsvirtualmachine/zz_controller.go index f96671659..a65eeae53 100755 --- a/internal/controller/devtestlab/windowsvirtualmachine/zz_controller.go +++ b/internal/controller/devtestlab/windowsvirtualmachine/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/devtestlab/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WindowsVirtualMachine_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_windows_virtual_machine"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_windows_virtual_machine"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WindowsVirtualMachine_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/digitaltwins/instance/zz_controller.go b/internal/controller/digitaltwins/instance/zz_controller.go index 86f4df285..67d9b7d58 100755 --- a/internal/controller/digitaltwins/instance/zz_controller.go +++ b/internal/controller/digitaltwins/instance/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/digitaltwins/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Instance_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Instance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Instance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_digital_twins_instance"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_digital_twins_instance"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Instance_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/elastic/cloudelasticsearch/zz_controller.go b/internal/controller/elastic/cloudelasticsearch/zz_controller.go index 43ba91562..c0794420e 100755 --- a/internal/controller/elastic/cloudelasticsearch/zz_controller.go +++ b/internal/controller/elastic/cloudelasticsearch/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/elastic/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CloudElasticsearch_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CloudElasticsearch_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CloudElasticsearch_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_elastic_cloud_elasticsearch"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_elastic_cloud_elasticsearch"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CloudElasticsearch_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/eventgrid/domain/zz_controller.go b/internal/controller/eventgrid/domain/zz_controller.go index b6a921f66..8e7e803e3 100755 --- a/internal/controller/eventgrid/domain/zz_controller.go +++ b/internal/controller/eventgrid/domain/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/eventgrid/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Domain_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Domain_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Domain_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_eventgrid_domain"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventgrid_domain"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Domain_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/eventgrid/domaintopic/zz_controller.go b/internal/controller/eventgrid/domaintopic/zz_controller.go index 96f419272..2cf54ffba 100755 --- a/internal/controller/eventgrid/domaintopic/zz_controller.go +++ b/internal/controller/eventgrid/domaintopic/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/eventgrid/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DomainTopic_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DomainTopic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DomainTopic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_eventgrid_domain_topic"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventgrid_domain_topic"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DomainTopic_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/eventgrid/eventsubscription/zz_controller.go b/internal/controller/eventgrid/eventsubscription/zz_controller.go index 32b747fcb..800300fe5 100755 --- a/internal/controller/eventgrid/eventsubscription/zz_controller.go +++ b/internal/controller/eventgrid/eventsubscription/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/eventgrid/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.EventSubscription_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventSubscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventSubscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_eventgrid_event_subscription"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventgrid_event_subscription"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.EventSubscription_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/eventgrid/systemtopic/zz_controller.go b/internal/controller/eventgrid/systemtopic/zz_controller.go index b6fd6b0df..4cb20a59a 100755 --- a/internal/controller/eventgrid/systemtopic/zz_controller.go +++ b/internal/controller/eventgrid/systemtopic/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/eventgrid/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SystemTopic_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SystemTopic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SystemTopic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_eventgrid_system_topic"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventgrid_system_topic"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SystemTopic_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/eventgrid/topic/zz_controller.go b/internal/controller/eventgrid/topic/zz_controller.go index a4a238fd4..e93ad400b 100755 --- a/internal/controller/eventgrid/topic/zz_controller.go +++ b/internal/controller/eventgrid/topic/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/eventgrid/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Topic_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Topic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Topic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_eventgrid_topic"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventgrid_topic"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Topic_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/eventhub/authorizationrule/zz_controller.go b/internal/controller/eventhub/authorizationrule/zz_controller.go index 61d44bcc1..dc159c99f 100755 --- a/internal/controller/eventhub/authorizationrule/zz_controller.go +++ b/internal/controller/eventhub/authorizationrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/eventhub/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AuthorizationRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AuthorizationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AuthorizationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_eventhub_authorization_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventhub_authorization_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AuthorizationRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/eventhub/consumergroup/zz_controller.go b/internal/controller/eventhub/consumergroup/zz_controller.go index c3a41f7ca..c0e7470a2 100755 --- a/internal/controller/eventhub/consumergroup/zz_controller.go +++ b/internal/controller/eventhub/consumergroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/eventhub/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ConsumerGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ConsumerGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ConsumerGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_eventhub_consumer_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventhub_consumer_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ConsumerGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/eventhub/eventhub/zz_controller.go b/internal/controller/eventhub/eventhub/zz_controller.go index f06a7fda8..a70888350 100755 --- a/internal/controller/eventhub/eventhub/zz_controller.go +++ b/internal/controller/eventhub/eventhub/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/eventhub/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.EventHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_eventhub"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventhub"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.EventHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/eventhub/eventhubnamespace/zz_controller.go b/internal/controller/eventhub/eventhubnamespace/zz_controller.go index 54b019c96..524cd2ce9 100755 --- a/internal/controller/eventhub/eventhubnamespace/zz_controller.go +++ b/internal/controller/eventhub/eventhubnamespace/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/eventhub/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.EventHubNamespace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventHubNamespace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventHubNamespace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_eventhub_namespace"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventhub_namespace"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.EventHubNamespace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/eventhub/namespaceauthorizationrule/zz_controller.go b/internal/controller/eventhub/namespaceauthorizationrule/zz_controller.go index bd31f4fdf..7fa781cb9 100755 --- a/internal/controller/eventhub/namespaceauthorizationrule/zz_controller.go +++ b/internal/controller/eventhub/namespaceauthorizationrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/eventhub/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NamespaceAuthorizationRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamespaceAuthorizationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamespaceAuthorizationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_eventhub_namespace_authorization_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventhub_namespace_authorization_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NamespaceAuthorizationRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/eventhub/namespacedisasterrecoveryconfig/zz_controller.go b/internal/controller/eventhub/namespacedisasterrecoveryconfig/zz_controller.go index 6d9bf36b2..324d056ca 100755 --- a/internal/controller/eventhub/namespacedisasterrecoveryconfig/zz_controller.go +++ b/internal/controller/eventhub/namespacedisasterrecoveryconfig/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/eventhub/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NamespaceDisasterRecoveryConfig_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamespaceDisasterRecoveryConfig_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamespaceDisasterRecoveryConfig_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_eventhub_namespace_disaster_recovery_config"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventhub_namespace_disaster_recovery_config"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NamespaceDisasterRecoveryConfig_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/eventhub/namespaceschemagroup/zz_controller.go b/internal/controller/eventhub/namespaceschemagroup/zz_controller.go index ee3ecfdc2..488b53b74 100755 --- a/internal/controller/eventhub/namespaceschemagroup/zz_controller.go +++ b/internal/controller/eventhub/namespaceschemagroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/eventhub/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NamespaceSchemaGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamespaceSchemaGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamespaceSchemaGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_eventhub_namespace_schema_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventhub_namespace_schema_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NamespaceSchemaGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/fluidrelay/server/zz_controller.go b/internal/controller/fluidrelay/server/zz_controller.go index 822620725..960a924b1 100755 --- a/internal/controller/fluidrelay/server/zz_controller.go +++ b/internal/controller/fluidrelay/server/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/fluidrelay/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Server_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Server_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Server_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_fluid_relay_server"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_fluid_relay_server"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Server_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/guestconfiguration/policyvirtualmachineconfigurationassignment/zz_controller.go b/internal/controller/guestconfiguration/policyvirtualmachineconfigurationassignment/zz_controller.go index 4d4292a5e..574845f1f 100755 --- a/internal/controller/guestconfiguration/policyvirtualmachineconfigurationassignment/zz_controller.go +++ b/internal/controller/guestconfiguration/policyvirtualmachineconfigurationassignment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/guestconfiguration/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PolicyVirtualMachineConfigurationAssignment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PolicyVirtualMachineConfigurationAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PolicyVirtualMachineConfigurationAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_policy_virtual_machine_configuration_assignment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_policy_virtual_machine_configuration_assignment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PolicyVirtualMachineConfigurationAssignment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/hdinsight/hadoopcluster/zz_controller.go b/internal/controller/hdinsight/hadoopcluster/zz_controller.go index 87f4ed461..b6e3bfc2a 100755 --- a/internal/controller/hdinsight/hadoopcluster/zz_controller.go +++ b/internal/controller/hdinsight/hadoopcluster/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/hdinsight/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HadoopCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HadoopCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HadoopCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_hdinsight_hadoop_cluster"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_hdinsight_hadoop_cluster"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HadoopCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/hdinsight/hbasecluster/zz_controller.go b/internal/controller/hdinsight/hbasecluster/zz_controller.go index 2408f0e49..f68a2b197 100755 --- a/internal/controller/hdinsight/hbasecluster/zz_controller.go +++ b/internal/controller/hdinsight/hbasecluster/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/hdinsight/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HBaseCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HBaseCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HBaseCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_hdinsight_hbase_cluster"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_hdinsight_hbase_cluster"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HBaseCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/hdinsight/interactivequerycluster/zz_controller.go b/internal/controller/hdinsight/interactivequerycluster/zz_controller.go index ba8d5d8a7..9a7a2e8b4 100755 --- a/internal/controller/hdinsight/interactivequerycluster/zz_controller.go +++ b/internal/controller/hdinsight/interactivequerycluster/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/hdinsight/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.InteractiveQueryCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.InteractiveQueryCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.InteractiveQueryCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_hdinsight_interactive_query_cluster"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_hdinsight_interactive_query_cluster"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.InteractiveQueryCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/hdinsight/kafkacluster/zz_controller.go b/internal/controller/hdinsight/kafkacluster/zz_controller.go index c35fd3816..a3da5458a 100755 --- a/internal/controller/hdinsight/kafkacluster/zz_controller.go +++ b/internal/controller/hdinsight/kafkacluster/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/hdinsight/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.KafkaCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.KafkaCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.KafkaCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_hdinsight_kafka_cluster"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_hdinsight_kafka_cluster"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.KafkaCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/hdinsight/sparkcluster/zz_controller.go b/internal/controller/hdinsight/sparkcluster/zz_controller.go index 0c1be3181..23ca8864c 100755 --- a/internal/controller/hdinsight/sparkcluster/zz_controller.go +++ b/internal/controller/hdinsight/sparkcluster/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/hdinsight/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SparkCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SparkCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SparkCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_hdinsight_spark_cluster"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_hdinsight_spark_cluster"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SparkCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/healthbot/healthbot/zz_controller.go b/internal/controller/healthbot/healthbot/zz_controller.go index a19720df0..b4888f7f0 100755 --- a/internal/controller/healthbot/healthbot/zz_controller.go +++ b/internal/controller/healthbot/healthbot/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/healthbot/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HealthBot_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthBot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthBot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_healthbot"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_healthbot"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HealthBot_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/healthcareapis/healthcaredicomservice/zz_controller.go b/internal/controller/healthcareapis/healthcaredicomservice/zz_controller.go index c4ffc21fb..e08c91926 100755 --- a/internal/controller/healthcareapis/healthcaredicomservice/zz_controller.go +++ b/internal/controller/healthcareapis/healthcaredicomservice/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/healthcareapis/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HealthcareDICOMService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthcareDICOMService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthcareDICOMService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_healthcare_dicom_service"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_healthcare_dicom_service"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HealthcareDICOMService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/healthcareapis/healthcarefhirservice/zz_controller.go b/internal/controller/healthcareapis/healthcarefhirservice/zz_controller.go index 57975583b..cad85ae0d 100755 --- a/internal/controller/healthcareapis/healthcarefhirservice/zz_controller.go +++ b/internal/controller/healthcareapis/healthcarefhirservice/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/healthcareapis/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HealthcareFHIRService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthcareFHIRService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthcareFHIRService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_healthcare_fhir_service"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_healthcare_fhir_service"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HealthcareFHIRService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/healthcareapis/healthcaremedtechservice/zz_controller.go b/internal/controller/healthcareapis/healthcaremedtechservice/zz_controller.go index 34faeb709..0f5f4ffdb 100755 --- a/internal/controller/healthcareapis/healthcaremedtechservice/zz_controller.go +++ b/internal/controller/healthcareapis/healthcaremedtechservice/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/healthcareapis/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HealthcareMedtechService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthcareMedtechService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthcareMedtechService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_healthcare_medtech_service"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_healthcare_medtech_service"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HealthcareMedtechService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/healthcareapis/healthcaremedtechservicefhirdestination/zz_controller.go b/internal/controller/healthcareapis/healthcaremedtechservicefhirdestination/zz_controller.go index ee3059824..eb3d2228d 100755 --- a/internal/controller/healthcareapis/healthcaremedtechservicefhirdestination/zz_controller.go +++ b/internal/controller/healthcareapis/healthcaremedtechservicefhirdestination/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/healthcareapis/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HealthcareMedtechServiceFHIRDestination_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthcareMedtechServiceFHIRDestination_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthcareMedtechServiceFHIRDestination_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_healthcare_medtech_service_fhir_destination"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_healthcare_medtech_service_fhir_destination"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HealthcareMedtechServiceFHIRDestination_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/healthcareapis/healthcareservice/zz_controller.go b/internal/controller/healthcareapis/healthcareservice/zz_controller.go index 8390754d1..1a982d669 100755 --- a/internal/controller/healthcareapis/healthcareservice/zz_controller.go +++ b/internal/controller/healthcareapis/healthcareservice/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/healthcareapis/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HealthcareService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthcareService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthcareService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_healthcare_service"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_healthcare_service"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HealthcareService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/healthcareapis/healthcareworkspace/zz_controller.go b/internal/controller/healthcareapis/healthcareworkspace/zz_controller.go index f09db2432..8365a3755 100755 --- a/internal/controller/healthcareapis/healthcareworkspace/zz_controller.go +++ b/internal/controller/healthcareapis/healthcareworkspace/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/healthcareapis/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HealthcareWorkspace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthcareWorkspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthcareWorkspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_healthcare_workspace"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_healthcare_workspace"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HealthcareWorkspace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/applicationinsights/zz_controller.go b/internal/controller/insights/applicationinsights/zz_controller.go index 18a5df242..4fa966262 100755 --- a/internal/controller/insights/applicationinsights/zz_controller.go +++ b/internal/controller/insights/applicationinsights/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ApplicationInsights_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsights_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsights_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ApplicationInsights_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/applicationinsightsanalyticsitem/zz_controller.go b/internal/controller/insights/applicationinsightsanalyticsitem/zz_controller.go index fe306d6b1..ac514b407 100755 --- a/internal/controller/insights/applicationinsightsanalyticsitem/zz_controller.go +++ b/internal/controller/insights/applicationinsightsanalyticsitem/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ApplicationInsightsAnalyticsItem_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsAnalyticsItem_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsAnalyticsItem_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights_analytics_item"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights_analytics_item"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ApplicationInsightsAnalyticsItem_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/applicationinsightsapikey/zz_controller.go b/internal/controller/insights/applicationinsightsapikey/zz_controller.go index 7dc1e3ea1..42afbdbfe 100755 --- a/internal/controller/insights/applicationinsightsapikey/zz_controller.go +++ b/internal/controller/insights/applicationinsightsapikey/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ApplicationInsightsAPIKey_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsAPIKey_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsAPIKey_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights_api_key"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights_api_key"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ApplicationInsightsAPIKey_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/applicationinsightssmartdetectionrule/zz_controller.go b/internal/controller/insights/applicationinsightssmartdetectionrule/zz_controller.go index a7f753d5e..5d327696f 100755 --- a/internal/controller/insights/applicationinsightssmartdetectionrule/zz_controller.go +++ b/internal/controller/insights/applicationinsightssmartdetectionrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ApplicationInsightsSmartDetectionRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsSmartDetectionRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsSmartDetectionRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights_smart_detection_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights_smart_detection_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ApplicationInsightsSmartDetectionRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/applicationinsightsstandardwebtest/zz_controller.go b/internal/controller/insights/applicationinsightsstandardwebtest/zz_controller.go index 191612b09..95feeb749 100755 --- a/internal/controller/insights/applicationinsightsstandardwebtest/zz_controller.go +++ b/internal/controller/insights/applicationinsightsstandardwebtest/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ApplicationInsightsStandardWebTest_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsStandardWebTest_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsStandardWebTest_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights_standard_web_test"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights_standard_web_test"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ApplicationInsightsStandardWebTest_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/applicationinsightswebtest/zz_controller.go b/internal/controller/insights/applicationinsightswebtest/zz_controller.go index 077ff2935..80b5badc8 100755 --- a/internal/controller/insights/applicationinsightswebtest/zz_controller.go +++ b/internal/controller/insights/applicationinsightswebtest/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ApplicationInsightsWebTest_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsWebTest_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsWebTest_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights_web_test"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights_web_test"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ApplicationInsightsWebTest_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/applicationinsightsworkbook/zz_controller.go b/internal/controller/insights/applicationinsightsworkbook/zz_controller.go index 8691fda33..a7b033085 100755 --- a/internal/controller/insights/applicationinsightsworkbook/zz_controller.go +++ b/internal/controller/insights/applicationinsightsworkbook/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ApplicationInsightsWorkbook_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsWorkbook_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsWorkbook_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights_workbook"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights_workbook"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ApplicationInsightsWorkbook_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/applicationinsightsworkbooktemplate/zz_controller.go b/internal/controller/insights/applicationinsightsworkbooktemplate/zz_controller.go index e1b12e848..f9984cbe8 100755 --- a/internal/controller/insights/applicationinsightsworkbooktemplate/zz_controller.go +++ b/internal/controller/insights/applicationinsightsworkbooktemplate/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ApplicationInsightsWorkbookTemplate_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsWorkbookTemplate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsWorkbookTemplate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights_workbook_template"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights_workbook_template"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ApplicationInsightsWorkbookTemplate_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/monitoractiongroup/zz_controller.go b/internal/controller/insights/monitoractiongroup/zz_controller.go index 0e6ec60b9..1013eb8ec 100755 --- a/internal/controller/insights/monitoractiongroup/zz_controller.go +++ b/internal/controller/insights/monitoractiongroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorActionGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorActionGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorActionGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_action_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_action_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorActionGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/monitoractivitylogalert/zz_controller.go b/internal/controller/insights/monitoractivitylogalert/zz_controller.go index 7bd5ddf0f..2cb3d67a2 100755 --- a/internal/controller/insights/monitoractivitylogalert/zz_controller.go +++ b/internal/controller/insights/monitoractivitylogalert/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorActivityLogAlert_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorActivityLogAlert_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorActivityLogAlert_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_activity_log_alert"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_activity_log_alert"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorActivityLogAlert_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/monitorautoscalesetting/zz_controller.go b/internal/controller/insights/monitorautoscalesetting/zz_controller.go index 4ef09a822..c2a72cc26 100755 --- a/internal/controller/insights/monitorautoscalesetting/zz_controller.go +++ b/internal/controller/insights/monitorautoscalesetting/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorAutoscaleSetting_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorAutoscaleSetting_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorAutoscaleSetting_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_autoscale_setting"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_autoscale_setting"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorAutoscaleSetting_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/monitordatacollectionendpoint/zz_controller.go b/internal/controller/insights/monitordatacollectionendpoint/zz_controller.go index 1595ac2ff..ff4d391b3 100755 --- a/internal/controller/insights/monitordatacollectionendpoint/zz_controller.go +++ b/internal/controller/insights/monitordatacollectionendpoint/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorDataCollectionEndpoint_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorDataCollectionEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorDataCollectionEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_data_collection_endpoint"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_data_collection_endpoint"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorDataCollectionEndpoint_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/monitordatacollectionrule/zz_controller.go b/internal/controller/insights/monitordatacollectionrule/zz_controller.go index 379ef7586..90a626e12 100755 --- a/internal/controller/insights/monitordatacollectionrule/zz_controller.go +++ b/internal/controller/insights/monitordatacollectionrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorDataCollectionRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorDataCollectionRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorDataCollectionRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_data_collection_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_data_collection_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorDataCollectionRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/monitordatacollectionruleassociation/zz_controller.go b/internal/controller/insights/monitordatacollectionruleassociation/zz_controller.go index 1b3633548..ec3bfd0b9 100755 --- a/internal/controller/insights/monitordatacollectionruleassociation/zz_controller.go +++ b/internal/controller/insights/monitordatacollectionruleassociation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorDataCollectionRuleAssociation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorDataCollectionRuleAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorDataCollectionRuleAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_data_collection_rule_association"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_data_collection_rule_association"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorDataCollectionRuleAssociation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/monitordiagnosticsetting/zz_controller.go b/internal/controller/insights/monitordiagnosticsetting/zz_controller.go index 2ede9bb43..8ca88bd83 100755 --- a/internal/controller/insights/monitordiagnosticsetting/zz_controller.go +++ b/internal/controller/insights/monitordiagnosticsetting/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorDiagnosticSetting_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorDiagnosticSetting_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorDiagnosticSetting_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_diagnostic_setting"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_diagnostic_setting"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorDiagnosticSetting_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/monitormetricalert/zz_controller.go b/internal/controller/insights/monitormetricalert/zz_controller.go index b44dd589b..6e03988b2 100755 --- a/internal/controller/insights/monitormetricalert/zz_controller.go +++ b/internal/controller/insights/monitormetricalert/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorMetricAlert_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorMetricAlert_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorMetricAlert_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_metric_alert"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_metric_alert"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorMetricAlert_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/monitorprivatelinkscope/zz_controller.go b/internal/controller/insights/monitorprivatelinkscope/zz_controller.go index 5bb5e5729..650b3cf0b 100755 --- a/internal/controller/insights/monitorprivatelinkscope/zz_controller.go +++ b/internal/controller/insights/monitorprivatelinkscope/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorPrivateLinkScope_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorPrivateLinkScope_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorPrivateLinkScope_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_private_link_scope"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_private_link_scope"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorPrivateLinkScope_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/monitorprivatelinkscopedservice/zz_controller.go b/internal/controller/insights/monitorprivatelinkscopedservice/zz_controller.go index 0f5b8f0cc..1cc7cbcbc 100755 --- a/internal/controller/insights/monitorprivatelinkscopedservice/zz_controller.go +++ b/internal/controller/insights/monitorprivatelinkscopedservice/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorPrivateLinkScopedService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorPrivateLinkScopedService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorPrivateLinkScopedService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_private_link_scoped_service"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_private_link_scoped_service"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorPrivateLinkScopedService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/monitorscheduledqueryrulesalert/zz_controller.go b/internal/controller/insights/monitorscheduledqueryrulesalert/zz_controller.go index 8d23eec17..ae3a2be53 100755 --- a/internal/controller/insights/monitorscheduledqueryrulesalert/zz_controller.go +++ b/internal/controller/insights/monitorscheduledqueryrulesalert/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorScheduledQueryRulesAlert_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorScheduledQueryRulesAlert_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorScheduledQueryRulesAlert_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_scheduled_query_rules_alert"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_scheduled_query_rules_alert"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorScheduledQueryRulesAlert_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/monitorscheduledqueryrulesalertv2/zz_controller.go b/internal/controller/insights/monitorscheduledqueryrulesalertv2/zz_controller.go index 4de6c5ddb..5fea870f9 100755 --- a/internal/controller/insights/monitorscheduledqueryrulesalertv2/zz_controller.go +++ b/internal/controller/insights/monitorscheduledqueryrulesalertv2/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorScheduledQueryRulesAlertV2_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorScheduledQueryRulesAlertV2_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorScheduledQueryRulesAlertV2_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_scheduled_query_rules_alert_v2"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_scheduled_query_rules_alert_v2"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorScheduledQueryRulesAlertV2_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/insights/monitorscheduledqueryruleslog/zz_controller.go b/internal/controller/insights/monitorscheduledqueryruleslog/zz_controller.go index e1c163f58..fbee43249 100755 --- a/internal/controller/insights/monitorscheduledqueryruleslog/zz_controller.go +++ b/internal/controller/insights/monitorscheduledqueryruleslog/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorScheduledQueryRulesLog_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorScheduledQueryRulesLog_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorScheduledQueryRulesLog_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_scheduled_query_rules_log"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_scheduled_query_rules_log"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorScheduledQueryRulesLog_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/iotcentral/application/zz_controller.go b/internal/controller/iotcentral/application/zz_controller.go index d7304ab7f..2f0f1a908 100755 --- a/internal/controller/iotcentral/application/zz_controller.go +++ b/internal/controller/iotcentral/application/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/iotcentral/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Application_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Application_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Application_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iotcentral_application"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iotcentral_application"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Application_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/iotcentral/applicationnetworkruleset/zz_controller.go b/internal/controller/iotcentral/applicationnetworkruleset/zz_controller.go index e57e4d985..a02b05585 100755 --- a/internal/controller/iotcentral/applicationnetworkruleset/zz_controller.go +++ b/internal/controller/iotcentral/applicationnetworkruleset/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/iotcentral/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ApplicationNetworkRuleSet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationNetworkRuleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationNetworkRuleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iotcentral_application_network_rule_set"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iotcentral_application_network_rule_set"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ApplicationNetworkRuleSet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/keyvault/accesspolicy/zz_controller.go b/internal/controller/keyvault/accesspolicy/zz_controller.go index fe482a510..e19e99f2e 100755 --- a/internal/controller/keyvault/accesspolicy/zz_controller.go +++ b/internal/controller/keyvault/accesspolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/keyvault/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AccessPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AccessPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AccessPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_access_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_access_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AccessPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/keyvault/certificate/zz_controller.go b/internal/controller/keyvault/certificate/zz_controller.go index aacf62024..150f1b3ea 100755 --- a/internal/controller/keyvault/certificate/zz_controller.go +++ b/internal/controller/keyvault/certificate/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/keyvault/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Certificate_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Certificate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Certificate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_certificate"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_certificate"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Certificate_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/keyvault/certificatecontacts/zz_controller.go b/internal/controller/keyvault/certificatecontacts/zz_controller.go index 2069baf12..d19fe558e 100755 --- a/internal/controller/keyvault/certificatecontacts/zz_controller.go +++ b/internal/controller/keyvault/certificatecontacts/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/keyvault/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CertificateContacts_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CertificateContacts_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CertificateContacts_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_certificate_contacts"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_certificate_contacts"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CertificateContacts_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/keyvault/certificateissuer/zz_controller.go b/internal/controller/keyvault/certificateissuer/zz_controller.go index afdf06b08..c32c35c9f 100755 --- a/internal/controller/keyvault/certificateissuer/zz_controller.go +++ b/internal/controller/keyvault/certificateissuer/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/keyvault/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CertificateIssuer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CertificateIssuer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CertificateIssuer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_certificate_issuer"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_certificate_issuer"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CertificateIssuer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/keyvault/key/zz_controller.go b/internal/controller/keyvault/key/zz_controller.go index bea722c02..52c0aef31 100755 --- a/internal/controller/keyvault/key/zz_controller.go +++ b/internal/controller/keyvault/key/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/keyvault/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Key_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Key_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Key_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_key"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_key"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Key_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/keyvault/managedhardwaresecuritymodule/zz_controller.go b/internal/controller/keyvault/managedhardwaresecuritymodule/zz_controller.go index 276e2bbe6..d7e89306c 100755 --- a/internal/controller/keyvault/managedhardwaresecuritymodule/zz_controller.go +++ b/internal/controller/keyvault/managedhardwaresecuritymodule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/keyvault/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagedHardwareSecurityModule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedHardwareSecurityModule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedHardwareSecurityModule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_managed_hardware_security_module"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_managed_hardware_security_module"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagedHardwareSecurityModule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/keyvault/managedstorageaccount/zz_controller.go b/internal/controller/keyvault/managedstorageaccount/zz_controller.go index dbe800a71..52393c103 100755 --- a/internal/controller/keyvault/managedstorageaccount/zz_controller.go +++ b/internal/controller/keyvault/managedstorageaccount/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/keyvault/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagedStorageAccount_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedStorageAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedStorageAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_managed_storage_account"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_managed_storage_account"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagedStorageAccount_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/keyvault/managedstorageaccountsastokendefinition/zz_controller.go b/internal/controller/keyvault/managedstorageaccountsastokendefinition/zz_controller.go index ee044a9f2..bcc4ef84d 100755 --- a/internal/controller/keyvault/managedstorageaccountsastokendefinition/zz_controller.go +++ b/internal/controller/keyvault/managedstorageaccountsastokendefinition/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/keyvault/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagedStorageAccountSASTokenDefinition_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedStorageAccountSASTokenDefinition_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedStorageAccountSASTokenDefinition_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_managed_storage_account_sas_token_definition"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_managed_storage_account_sas_token_definition"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagedStorageAccountSASTokenDefinition_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/keyvault/secret/zz_controller.go b/internal/controller/keyvault/secret/zz_controller.go index 897bbb340..b959796f0 100755 --- a/internal/controller/keyvault/secret/zz_controller.go +++ b/internal/controller/keyvault/secret/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/keyvault/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Secret_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Secret_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Secret_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_secret"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_secret"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Secret_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/keyvault/vault/zz_controller.go b/internal/controller/keyvault/vault/zz_controller.go index 9242958d2..5f99bbb1e 100755 --- a/internal/controller/keyvault/vault/zz_controller.go +++ b/internal/controller/keyvault/vault/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/keyvault/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Vault_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Vault_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Vault_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Vault_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/kusto/attacheddatabaseconfiguration/zz_controller.go b/internal/controller/kusto/attacheddatabaseconfiguration/zz_controller.go index 1a321f8c3..7d6450b6b 100755 --- a/internal/controller/kusto/attacheddatabaseconfiguration/zz_controller.go +++ b/internal/controller/kusto/attacheddatabaseconfiguration/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/kusto/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AttachedDatabaseConfiguration_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AttachedDatabaseConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AttachedDatabaseConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_attached_database_configuration"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_attached_database_configuration"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AttachedDatabaseConfiguration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/kusto/cluster/zz_controller.go b/internal/controller/kusto/cluster/zz_controller.go index 4242aa6d4..d914380f6 100755 --- a/internal/controller/kusto/cluster/zz_controller.go +++ b/internal/controller/kusto/cluster/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/kusto/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Cluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Cluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Cluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_cluster"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_cluster"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Cluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/kusto/clustermanagedprivateendpoint/zz_controller.go b/internal/controller/kusto/clustermanagedprivateendpoint/zz_controller.go index 30b534241..3dc6c3635 100755 --- a/internal/controller/kusto/clustermanagedprivateendpoint/zz_controller.go +++ b/internal/controller/kusto/clustermanagedprivateendpoint/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/kusto/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ClusterManagedPrivateEndpoint_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ClusterManagedPrivateEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ClusterManagedPrivateEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_cluster_managed_private_endpoint"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_cluster_managed_private_endpoint"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ClusterManagedPrivateEndpoint_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/kusto/clusterprincipalassignment/zz_controller.go b/internal/controller/kusto/clusterprincipalassignment/zz_controller.go index 49b9e4da9..190ecc4ac 100755 --- a/internal/controller/kusto/clusterprincipalassignment/zz_controller.go +++ b/internal/controller/kusto/clusterprincipalassignment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/kusto/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ClusterPrincipalAssignment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ClusterPrincipalAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ClusterPrincipalAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_cluster_principal_assignment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_cluster_principal_assignment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ClusterPrincipalAssignment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/kusto/database/zz_controller.go b/internal/controller/kusto/database/zz_controller.go index 498f69b67..da724d4a0 100755 --- a/internal/controller/kusto/database/zz_controller.go +++ b/internal/controller/kusto/database/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/kusto/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Database_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Database_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Database_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_database"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_database"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Database_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/kusto/databaseprincipalassignment/zz_controller.go b/internal/controller/kusto/databaseprincipalassignment/zz_controller.go index 9f1407274..56a56981e 100755 --- a/internal/controller/kusto/databaseprincipalassignment/zz_controller.go +++ b/internal/controller/kusto/databaseprincipalassignment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/kusto/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DatabasePrincipalAssignment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DatabasePrincipalAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DatabasePrincipalAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_database_principal_assignment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_database_principal_assignment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DatabasePrincipalAssignment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/kusto/eventgriddataconnection/zz_controller.go b/internal/controller/kusto/eventgriddataconnection/zz_controller.go index af7e62eb2..0bc551f4b 100755 --- a/internal/controller/kusto/eventgriddataconnection/zz_controller.go +++ b/internal/controller/kusto/eventgriddataconnection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/kusto/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.EventGridDataConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventGridDataConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventGridDataConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_eventgrid_data_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_eventgrid_data_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.EventGridDataConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/kusto/eventhubdataconnection/zz_controller.go b/internal/controller/kusto/eventhubdataconnection/zz_controller.go index 7455f272d..60122a5d3 100755 --- a/internal/controller/kusto/eventhubdataconnection/zz_controller.go +++ b/internal/controller/kusto/eventhubdataconnection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/kusto/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.EventHubDataConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventHubDataConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventHubDataConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_eventhub_data_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_eventhub_data_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.EventHubDataConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/kusto/iothubdataconnection/zz_controller.go b/internal/controller/kusto/iothubdataconnection/zz_controller.go index 95d9122c8..e2075a0cf 100755 --- a/internal/controller/kusto/iothubdataconnection/zz_controller.go +++ b/internal/controller/kusto/iothubdataconnection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/kusto/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubDataConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubDataConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubDataConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_iothub_data_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_iothub_data_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubDataConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/labservices/labservicelab/zz_controller.go b/internal/controller/labservices/labservicelab/zz_controller.go index 6febafc5b..4510ae9d5 100755 --- a/internal/controller/labservices/labservicelab/zz_controller.go +++ b/internal/controller/labservices/labservicelab/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/labservices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LabServiceLab_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LabServiceLab_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LabServiceLab_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_lab_service_lab"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_lab_service_lab"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LabServiceLab_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/labservices/labserviceplan/zz_controller.go b/internal/controller/labservices/labserviceplan/zz_controller.go index df0023e48..342a6a506 100755 --- a/internal/controller/labservices/labserviceplan/zz_controller.go +++ b/internal/controller/labservices/labserviceplan/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/labservices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LabServicePlan_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LabServicePlan_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LabServicePlan_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_lab_service_plan"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_lab_service_plan"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LabServicePlan_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/loadtestservice/loadtest/zz_controller.go b/internal/controller/loadtestservice/loadtest/zz_controller.go index d7f3ef0ee..5ec3e112a 100755 --- a/internal/controller/loadtestservice/loadtest/zz_controller.go +++ b/internal/controller/loadtestservice/loadtest/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/loadtestservice/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LoadTest_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadTest_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadTest_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_load_test"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_load_test"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LoadTest_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/logic/appactioncustom/zz_controller.go b/internal/controller/logic/appactioncustom/zz_controller.go index 3e4b78219..a71cc0a84 100755 --- a/internal/controller/logic/appactioncustom/zz_controller.go +++ b/internal/controller/logic/appactioncustom/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/logic/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppActionCustom_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppActionCustom_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppActionCustom_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_action_custom"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_action_custom"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppActionCustom_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/logic/appactionhttp/zz_controller.go b/internal/controller/logic/appactionhttp/zz_controller.go index ef5920eae..e8ae6962a 100755 --- a/internal/controller/logic/appactionhttp/zz_controller.go +++ b/internal/controller/logic/appactionhttp/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/logic/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppActionHTTP_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppActionHTTP_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppActionHTTP_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_action_http"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_action_http"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppActionHTTP_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/logic/appintegrationaccount/zz_controller.go b/internal/controller/logic/appintegrationaccount/zz_controller.go index dab91bf9c..e87bf1baf 100755 --- a/internal/controller/logic/appintegrationaccount/zz_controller.go +++ b/internal/controller/logic/appintegrationaccount/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/logic/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppIntegrationAccount_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppIntegrationAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppIntegrationAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_integration_account"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_integration_account"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppIntegrationAccount_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/logic/appintegrationaccountbatchconfiguration/zz_controller.go b/internal/controller/logic/appintegrationaccountbatchconfiguration/zz_controller.go index a337f72d5..d19394cb0 100755 --- a/internal/controller/logic/appintegrationaccountbatchconfiguration/zz_controller.go +++ b/internal/controller/logic/appintegrationaccountbatchconfiguration/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/logic/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppIntegrationAccountBatchConfiguration_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppIntegrationAccountBatchConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppIntegrationAccountBatchConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_integration_account_batch_configuration"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_integration_account_batch_configuration"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppIntegrationAccountBatchConfiguration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/logic/appintegrationaccountpartner/zz_controller.go b/internal/controller/logic/appintegrationaccountpartner/zz_controller.go index 8fec65ea3..a91cf3901 100755 --- a/internal/controller/logic/appintegrationaccountpartner/zz_controller.go +++ b/internal/controller/logic/appintegrationaccountpartner/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/logic/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppIntegrationAccountPartner_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppIntegrationAccountPartner_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppIntegrationAccountPartner_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_integration_account_partner"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_integration_account_partner"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppIntegrationAccountPartner_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/logic/appintegrationaccountschema/zz_controller.go b/internal/controller/logic/appintegrationaccountschema/zz_controller.go index fd31d4f75..5b2f0e0f4 100755 --- a/internal/controller/logic/appintegrationaccountschema/zz_controller.go +++ b/internal/controller/logic/appintegrationaccountschema/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/logic/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppIntegrationAccountSchema_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppIntegrationAccountSchema_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppIntegrationAccountSchema_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_integration_account_schema"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_integration_account_schema"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppIntegrationAccountSchema_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/logic/appintegrationaccountsession/zz_controller.go b/internal/controller/logic/appintegrationaccountsession/zz_controller.go index 3f5ba69fa..3fb77be65 100755 --- a/internal/controller/logic/appintegrationaccountsession/zz_controller.go +++ b/internal/controller/logic/appintegrationaccountsession/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/logic/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppIntegrationAccountSession_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppIntegrationAccountSession_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppIntegrationAccountSession_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_integration_account_session"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_integration_account_session"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppIntegrationAccountSession_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/logic/apptriggercustom/zz_controller.go b/internal/controller/logic/apptriggercustom/zz_controller.go index f590d3826..fb46d9712 100755 --- a/internal/controller/logic/apptriggercustom/zz_controller.go +++ b/internal/controller/logic/apptriggercustom/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/logic/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppTriggerCustom_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppTriggerCustom_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppTriggerCustom_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_trigger_custom"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_trigger_custom"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppTriggerCustom_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/logic/apptriggerhttprequest/zz_controller.go b/internal/controller/logic/apptriggerhttprequest/zz_controller.go index 56715a180..f9d6c7e2d 100755 --- a/internal/controller/logic/apptriggerhttprequest/zz_controller.go +++ b/internal/controller/logic/apptriggerhttprequest/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/logic/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppTriggerHTTPRequest_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppTriggerHTTPRequest_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppTriggerHTTPRequest_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_trigger_http_request"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_trigger_http_request"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppTriggerHTTPRequest_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/logic/apptriggerrecurrence/zz_controller.go b/internal/controller/logic/apptriggerrecurrence/zz_controller.go index 15315ec59..6a1815f9c 100755 --- a/internal/controller/logic/apptriggerrecurrence/zz_controller.go +++ b/internal/controller/logic/apptriggerrecurrence/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/logic/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppTriggerRecurrence_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppTriggerRecurrence_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppTriggerRecurrence_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_trigger_recurrence"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_trigger_recurrence"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppTriggerRecurrence_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/logic/appworkflow/zz_controller.go b/internal/controller/logic/appworkflow/zz_controller.go index 0d7e61200..002502a09 100755 --- a/internal/controller/logic/appworkflow/zz_controller.go +++ b/internal/controller/logic/appworkflow/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/logic/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppWorkflow_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppWorkflow_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppWorkflow_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_workflow"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_workflow"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppWorkflow_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/logic/integrationserviceenvironment/zz_controller.go b/internal/controller/logic/integrationserviceenvironment/zz_controller.go index f757c4590..70d9a2aaf 100755 --- a/internal/controller/logic/integrationserviceenvironment/zz_controller.go +++ b/internal/controller/logic/integrationserviceenvironment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/logic/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IntegrationServiceEnvironment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IntegrationServiceEnvironment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IntegrationServiceEnvironment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_integration_service_environment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_integration_service_environment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IntegrationServiceEnvironment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/logz/monitor/zz_controller.go b/internal/controller/logz/monitor/zz_controller.go index 2695c4c62..336ff8c49 100755 --- a/internal/controller/logz/monitor/zz_controller.go +++ b/internal/controller/logz/monitor/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/logz/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Monitor_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Monitor_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Monitor_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_logz_monitor"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logz_monitor"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Monitor_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/logz/subaccount/zz_controller.go b/internal/controller/logz/subaccount/zz_controller.go index 7d9461201..b758742bc 100755 --- a/internal/controller/logz/subaccount/zz_controller.go +++ b/internal/controller/logz/subaccount/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/logz/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SubAccount_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_logz_sub_account"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logz_sub_account"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SubAccount_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/logz/subaccounttagrule/zz_controller.go b/internal/controller/logz/subaccounttagrule/zz_controller.go index 14d37399a..f28df994f 100755 --- a/internal/controller/logz/subaccounttagrule/zz_controller.go +++ b/internal/controller/logz/subaccounttagrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/logz/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SubAccountTagRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubAccountTagRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubAccountTagRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_logz_sub_account_tag_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logz_sub_account_tag_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SubAccountTagRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/logz/tagrule/zz_controller.go b/internal/controller/logz/tagrule/zz_controller.go index f00ef4663..e3b28703e 100755 --- a/internal/controller/logz/tagrule/zz_controller.go +++ b/internal/controller/logz/tagrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/logz/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.TagRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TagRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TagRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_logz_tag_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logz_tag_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.TagRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/machinelearningservices/computecluster/zz_controller.go b/internal/controller/machinelearningservices/computecluster/zz_controller.go index 71cebb3e3..2f770725c 100755 --- a/internal/controller/machinelearningservices/computecluster/zz_controller.go +++ b/internal/controller/machinelearningservices/computecluster/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/machinelearningservices/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ComputeCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ComputeCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ComputeCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_machine_learning_compute_cluster"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_machine_learning_compute_cluster"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ComputeCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/machinelearningservices/computeinstance/zz_controller.go b/internal/controller/machinelearningservices/computeinstance/zz_controller.go index 034ff558c..0013b6442 100755 --- a/internal/controller/machinelearningservices/computeinstance/zz_controller.go +++ b/internal/controller/machinelearningservices/computeinstance/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/machinelearningservices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ComputeInstance_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ComputeInstance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ComputeInstance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_machine_learning_compute_instance"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_machine_learning_compute_instance"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ComputeInstance_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/machinelearningservices/synapsespark/zz_controller.go b/internal/controller/machinelearningservices/synapsespark/zz_controller.go index ca1a84e66..07909f4de 100755 --- a/internal/controller/machinelearningservices/synapsespark/zz_controller.go +++ b/internal/controller/machinelearningservices/synapsespark/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/machinelearningservices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SynapseSpark_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SynapseSpark_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SynapseSpark_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_machine_learning_synapse_spark"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_machine_learning_synapse_spark"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SynapseSpark_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/machinelearningservices/workspace/zz_controller.go b/internal/controller/machinelearningservices/workspace/zz_controller.go index 49659bd4f..3e0deb48f 100755 --- a/internal/controller/machinelearningservices/workspace/zz_controller.go +++ b/internal/controller/machinelearningservices/workspace/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/machinelearningservices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Workspace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Workspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Workspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_machine_learning_workspace"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_machine_learning_workspace"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Workspace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/maintenance/maintenanceassignmentdedicatedhost/zz_controller.go b/internal/controller/maintenance/maintenanceassignmentdedicatedhost/zz_controller.go index a7e1bca9b..a32935cc4 100755 --- a/internal/controller/maintenance/maintenanceassignmentdedicatedhost/zz_controller.go +++ b/internal/controller/maintenance/maintenanceassignmentdedicatedhost/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/maintenance/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MaintenanceAssignmentDedicatedHost_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MaintenanceAssignmentDedicatedHost_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MaintenanceAssignmentDedicatedHost_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_maintenance_assignment_dedicated_host"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_maintenance_assignment_dedicated_host"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MaintenanceAssignmentDedicatedHost_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/maintenance/maintenanceassignmentvirtualmachine/zz_controller.go b/internal/controller/maintenance/maintenanceassignmentvirtualmachine/zz_controller.go index 935fc0fc2..69252bda5 100755 --- a/internal/controller/maintenance/maintenanceassignmentvirtualmachine/zz_controller.go +++ b/internal/controller/maintenance/maintenanceassignmentvirtualmachine/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/maintenance/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MaintenanceAssignmentVirtualMachine_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MaintenanceAssignmentVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MaintenanceAssignmentVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_maintenance_assignment_virtual_machine"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_maintenance_assignment_virtual_machine"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MaintenanceAssignmentVirtualMachine_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/maintenance/maintenanceconfiguration/zz_controller.go b/internal/controller/maintenance/maintenanceconfiguration/zz_controller.go index 39da8fc6b..5f39e82e2 100755 --- a/internal/controller/maintenance/maintenanceconfiguration/zz_controller.go +++ b/internal/controller/maintenance/maintenanceconfiguration/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/maintenance/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MaintenanceConfiguration_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MaintenanceConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MaintenanceConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_maintenance_configuration"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_maintenance_configuration"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MaintenanceConfiguration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/managedidentity/federatedidentitycredential/zz_controller.go b/internal/controller/managedidentity/federatedidentitycredential/zz_controller.go index 8bcf2c2c2..11955c4e4 100755 --- a/internal/controller/managedidentity/federatedidentitycredential/zz_controller.go +++ b/internal/controller/managedidentity/federatedidentitycredential/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/managedidentity/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FederatedIdentityCredential_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FederatedIdentityCredential_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FederatedIdentityCredential_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_federated_identity_credential"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_federated_identity_credential"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FederatedIdentityCredential_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/managedidentity/userassignedidentity/zz_controller.go b/internal/controller/managedidentity/userassignedidentity/zz_controller.go index f54ce21b9..9377f0dc2 100755 --- a/internal/controller/managedidentity/userassignedidentity/zz_controller.go +++ b/internal/controller/managedidentity/userassignedidentity/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/managedidentity/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.UserAssignedIdentity_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.UserAssignedIdentity_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.UserAssignedIdentity_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_user_assigned_identity"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_user_assigned_identity"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.UserAssignedIdentity_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/management/managementgroup/zz_controller.go b/internal/controller/management/managementgroup/zz_controller.go index 4790aeaa3..49a0dac00 100755 --- a/internal/controller/management/managementgroup/zz_controller.go +++ b/internal/controller/management/managementgroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/management/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagementGroup_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagementGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_management_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_management_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagementGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/management/managementgroupsubscriptionassociation/zz_controller.go b/internal/controller/management/managementgroupsubscriptionassociation/zz_controller.go index 71fd95099..2fc4fb659 100755 --- a/internal/controller/management/managementgroupsubscriptionassociation/zz_controller.go +++ b/internal/controller/management/managementgroupsubscriptionassociation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/management/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagementGroupSubscriptionAssociation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagementGroupSubscriptionAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagementGroupSubscriptionAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_management_group_subscription_association"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_management_group_subscription_association"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagementGroupSubscriptionAssociation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/maps/account/zz_controller.go b/internal/controller/maps/account/zz_controller.go index 897cd15d6..25669018f 100755 --- a/internal/controller/maps/account/zz_controller.go +++ b/internal/controller/maps/account/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/maps/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Account_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_maps_account"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_maps_account"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Account_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/maps/creator/zz_controller.go b/internal/controller/maps/creator/zz_controller.go index 051d01520..538655ef9 100755 --- a/internal/controller/maps/creator/zz_controller.go +++ b/internal/controller/maps/creator/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/maps/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Creator_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Creator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Creator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_maps_creator"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_maps_creator"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Creator_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/marketplaceordering/marketplaceagreement/zz_controller.go b/internal/controller/marketplaceordering/marketplaceagreement/zz_controller.go index a723370d6..9d9df9d3c 100755 --- a/internal/controller/marketplaceordering/marketplaceagreement/zz_controller.go +++ b/internal/controller/marketplaceordering/marketplaceagreement/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/marketplaceordering/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MarketplaceAgreement_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MarketplaceAgreement_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MarketplaceAgreement_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_marketplace_agreement"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_marketplace_agreement"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MarketplaceAgreement_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/media/asset/zz_controller.go b/internal/controller/media/asset/zz_controller.go index 7cecd0b79..ffaf2ee57 100755 --- a/internal/controller/media/asset/zz_controller.go +++ b/internal/controller/media/asset/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Asset_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Asset_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Asset_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_media_asset"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_asset"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Asset_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/media/assetfilter/zz_controller.go b/internal/controller/media/assetfilter/zz_controller.go index d55e301d1..3c18bf83b 100755 --- a/internal/controller/media/assetfilter/zz_controller.go +++ b/internal/controller/media/assetfilter/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AssetFilter_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AssetFilter_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AssetFilter_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_media_asset_filter"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_asset_filter"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AssetFilter_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/media/contentkeypolicy/zz_controller.go b/internal/controller/media/contentkeypolicy/zz_controller.go index 6cf61b811..b8e9f2d68 100755 --- a/internal/controller/media/contentkeypolicy/zz_controller.go +++ b/internal/controller/media/contentkeypolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ContentKeyPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ContentKeyPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ContentKeyPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_media_content_key_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_content_key_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ContentKeyPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/media/job/zz_controller.go b/internal/controller/media/job/zz_controller.go index f456f3d2d..51752ea60 100755 --- a/internal/controller/media/job/zz_controller.go +++ b/internal/controller/media/job/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Job_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Job_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Job_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_media_job"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_job"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Job_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/media/liveevent/zz_controller.go b/internal/controller/media/liveevent/zz_controller.go index 6787b538c..3b476f811 100755 --- a/internal/controller/media/liveevent/zz_controller.go +++ b/internal/controller/media/liveevent/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LiveEvent_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LiveEvent_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LiveEvent_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_media_live_event"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_live_event"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LiveEvent_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/media/liveeventoutput/zz_controller.go b/internal/controller/media/liveeventoutput/zz_controller.go index d6506d2e0..07d562240 100755 --- a/internal/controller/media/liveeventoutput/zz_controller.go +++ b/internal/controller/media/liveeventoutput/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LiveEventOutput_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LiveEventOutput_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LiveEventOutput_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_media_live_event_output"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_live_event_output"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LiveEventOutput_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/media/servicesaccount/zz_controller.go b/internal/controller/media/servicesaccount/zz_controller.go index 1751de1dd..312258e97 100755 --- a/internal/controller/media/servicesaccount/zz_controller.go +++ b/internal/controller/media/servicesaccount/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ServicesAccount_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ServicesAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ServicesAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_media_services_account"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_services_account"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ServicesAccount_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/media/servicesaccountfilter/zz_controller.go b/internal/controller/media/servicesaccountfilter/zz_controller.go index 1522a6240..9f3b312d8 100755 --- a/internal/controller/media/servicesaccountfilter/zz_controller.go +++ b/internal/controller/media/servicesaccountfilter/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ServicesAccountFilter_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ServicesAccountFilter_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ServicesAccountFilter_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_media_services_account_filter"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_services_account_filter"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ServicesAccountFilter_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/media/streamingendpoint/zz_controller.go b/internal/controller/media/streamingendpoint/zz_controller.go index ae002f0fb..e7d5cb5ed 100755 --- a/internal/controller/media/streamingendpoint/zz_controller.go +++ b/internal/controller/media/streamingendpoint/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.StreamingEndpoint_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamingEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamingEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_media_streaming_endpoint"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_streaming_endpoint"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.StreamingEndpoint_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/media/streaminglocator/zz_controller.go b/internal/controller/media/streaminglocator/zz_controller.go index 02487a98a..c69ec0273 100755 --- a/internal/controller/media/streaminglocator/zz_controller.go +++ b/internal/controller/media/streaminglocator/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.StreamingLocator_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamingLocator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamingLocator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_media_streaming_locator"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_streaming_locator"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.StreamingLocator_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/media/streamingpolicy/zz_controller.go b/internal/controller/media/streamingpolicy/zz_controller.go index 98faaba00..5a4678bd0 100755 --- a/internal/controller/media/streamingpolicy/zz_controller.go +++ b/internal/controller/media/streamingpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.StreamingPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamingPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamingPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_media_streaming_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_streaming_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.StreamingPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/media/transform/zz_controller.go b/internal/controller/media/transform/zz_controller.go index cc0e55ee1..f0ca92a56 100755 --- a/internal/controller/media/transform/zz_controller.go +++ b/internal/controller/media/transform/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Transform_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Transform_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Transform_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_media_transform"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_transform"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Transform_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/mixedreality/spatialanchorsaccount/zz_controller.go b/internal/controller/mixedreality/spatialanchorsaccount/zz_controller.go index 21b21f86d..519356d28 100755 --- a/internal/controller/mixedreality/spatialanchorsaccount/zz_controller.go +++ b/internal/controller/mixedreality/spatialanchorsaccount/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/mixedreality/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpatialAnchorsAccount_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpatialAnchorsAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpatialAnchorsAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spatial_anchors_account"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spatial_anchors_account"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpatialAnchorsAccount_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/netapp/account/zz_controller.go b/internal/controller/netapp/account/zz_controller.go index ff91ff0e6..8d71e6b4b 100755 --- a/internal/controller/netapp/account/zz_controller.go +++ b/internal/controller/netapp/account/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/netapp/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Account_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_netapp_account"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_netapp_account"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Account_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/netapp/pool/zz_controller.go b/internal/controller/netapp/pool/zz_controller.go index bea5bb5ba..5aa3a86ba 100755 --- a/internal/controller/netapp/pool/zz_controller.go +++ b/internal/controller/netapp/pool/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/netapp/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Pool_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Pool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Pool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_netapp_pool"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_netapp_pool"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Pool_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/netapp/snapshot/zz_controller.go b/internal/controller/netapp/snapshot/zz_controller.go index b23e43166..f3aee820d 100755 --- a/internal/controller/netapp/snapshot/zz_controller.go +++ b/internal/controller/netapp/snapshot/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/netapp/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Snapshot_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Snapshot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Snapshot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_netapp_snapshot"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_netapp_snapshot"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Snapshot_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/netapp/snapshotpolicy/zz_controller.go b/internal/controller/netapp/snapshotpolicy/zz_controller.go index 69b739536..16c4f2aab 100755 --- a/internal/controller/netapp/snapshotpolicy/zz_controller.go +++ b/internal/controller/netapp/snapshotpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/netapp/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SnapshotPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SnapshotPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SnapshotPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_netapp_snapshot_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_netapp_snapshot_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SnapshotPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/netapp/volume/zz_controller.go b/internal/controller/netapp/volume/zz_controller.go index b9dd202a0..4d8c71819 100755 --- a/internal/controller/netapp/volume/zz_controller.go +++ b/internal/controller/netapp/volume/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/netapp/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Volume_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Volume_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Volume_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_netapp_volume"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_netapp_volume"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Volume_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/applicationgateway/zz_controller.go b/internal/controller/network/applicationgateway/zz_controller.go index 7deec9523..3903d4974 100755 --- a/internal/controller/network/applicationgateway/zz_controller.go +++ b/internal/controller/network/applicationgateway/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ApplicationGateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_application_gateway"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_application_gateway"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ApplicationGateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/applicationsecuritygroup/zz_controller.go b/internal/controller/network/applicationsecuritygroup/zz_controller.go index a6ea7aae7..a244b7d9c 100755 --- a/internal/controller/network/applicationsecuritygroup/zz_controller.go +++ b/internal/controller/network/applicationsecuritygroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ApplicationSecurityGroup_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationSecurityGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_application_security_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_application_security_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ApplicationSecurityGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/connectionmonitor/zz_controller.go b/internal/controller/network/connectionmonitor/zz_controller.go index 7231d3e73..9f3ae25a1 100755 --- a/internal/controller/network/connectionmonitor/zz_controller.go +++ b/internal/controller/network/connectionmonitor/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ConnectionMonitor_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ConnectionMonitor_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_connection_monitor"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_connection_monitor"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ConnectionMonitor_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/ddosprotectionplan/zz_controller.go b/internal/controller/network/ddosprotectionplan/zz_controller.go index 8c462c4a8..737fed3cc 100755 --- a/internal/controller/network/ddosprotectionplan/zz_controller.go +++ b/internal/controller/network/ddosprotectionplan/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DDoSProtectionPlan_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DDoSProtectionPlan_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_ddos_protection_plan"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_ddos_protection_plan"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DDoSProtectionPlan_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/dnsaaaarecord/zz_controller.go b/internal/controller/network/dnsaaaarecord/zz_controller.go index b75013fe0..2c32b159b 100755 --- a/internal/controller/network/dnsaaaarecord/zz_controller.go +++ b/internal/controller/network/dnsaaaarecord/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DNSAAAARecord_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSAAAARecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSAAAARecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dns_aaaa_record"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dns_aaaa_record"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DNSAAAARecord_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/dnsarecord/zz_controller.go b/internal/controller/network/dnsarecord/zz_controller.go index 0dbe71feb..c054196a6 100755 --- a/internal/controller/network/dnsarecord/zz_controller.go +++ b/internal/controller/network/dnsarecord/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DNSARecord_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSARecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSARecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dns_a_record"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dns_a_record"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DNSARecord_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/dnscaarecord/zz_controller.go b/internal/controller/network/dnscaarecord/zz_controller.go index 86733b7d9..ac1bca723 100755 --- a/internal/controller/network/dnscaarecord/zz_controller.go +++ b/internal/controller/network/dnscaarecord/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DNSCAARecord_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSCAARecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSCAARecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dns_caa_record"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dns_caa_record"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DNSCAARecord_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/dnscnamerecord/zz_controller.go b/internal/controller/network/dnscnamerecord/zz_controller.go index f07fe22db..d92e70b58 100755 --- a/internal/controller/network/dnscnamerecord/zz_controller.go +++ b/internal/controller/network/dnscnamerecord/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DNSCNAMERecord_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSCNAMERecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSCNAMERecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dns_cname_record"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dns_cname_record"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DNSCNAMERecord_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/dnsmxrecord/zz_controller.go b/internal/controller/network/dnsmxrecord/zz_controller.go index f50631a5c..3fd7b3eeb 100755 --- a/internal/controller/network/dnsmxrecord/zz_controller.go +++ b/internal/controller/network/dnsmxrecord/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DNSMXRecord_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSMXRecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSMXRecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dns_mx_record"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dns_mx_record"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DNSMXRecord_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/dnsnsrecord/zz_controller.go b/internal/controller/network/dnsnsrecord/zz_controller.go index 8fd414120..7f7cfab11 100755 --- a/internal/controller/network/dnsnsrecord/zz_controller.go +++ b/internal/controller/network/dnsnsrecord/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DNSNSRecord_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSNSRecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSNSRecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dns_ns_record"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dns_ns_record"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DNSNSRecord_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/dnsptrrecord/zz_controller.go b/internal/controller/network/dnsptrrecord/zz_controller.go index 6347a92bb..0046d1fa7 100755 --- a/internal/controller/network/dnsptrrecord/zz_controller.go +++ b/internal/controller/network/dnsptrrecord/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DNSPTRRecord_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSPTRRecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSPTRRecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dns_ptr_record"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dns_ptr_record"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DNSPTRRecord_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/dnssrvrecord/zz_controller.go b/internal/controller/network/dnssrvrecord/zz_controller.go index 43740b42f..a4c4e8a3e 100755 --- a/internal/controller/network/dnssrvrecord/zz_controller.go +++ b/internal/controller/network/dnssrvrecord/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DNSSRVRecord_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSSRVRecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSSRVRecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dns_srv_record"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dns_srv_record"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DNSSRVRecord_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/dnstxtrecord/zz_controller.go b/internal/controller/network/dnstxtrecord/zz_controller.go index c6d350a9d..2e58f6f24 100755 --- a/internal/controller/network/dnstxtrecord/zz_controller.go +++ b/internal/controller/network/dnstxtrecord/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DNSTXTRecord_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSTXTRecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSTXTRecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dns_txt_record"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dns_txt_record"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DNSTXTRecord_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/dnszone/zz_controller.go b/internal/controller/network/dnszone/zz_controller.go index 45b68bd55..fe0f8186d 100755 --- a/internal/controller/network/dnszone/zz_controller.go +++ b/internal/controller/network/dnszone/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DNSZone_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSZone_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSZone_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_dns_zone"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dns_zone"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DNSZone_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/expressroutecircuit/zz_controller.go b/internal/controller/network/expressroutecircuit/zz_controller.go index c5db549c9..e6ab39cb8 100755 --- a/internal/controller/network/expressroutecircuit/zz_controller.go +++ b/internal/controller/network/expressroutecircuit/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ExpressRouteCircuit_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteCircuit_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteCircuit_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_circuit"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_circuit"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ExpressRouteCircuit_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/expressroutecircuitauthorization/zz_controller.go b/internal/controller/network/expressroutecircuitauthorization/zz_controller.go index 97b5ff271..27363b7c6 100755 --- a/internal/controller/network/expressroutecircuitauthorization/zz_controller.go +++ b/internal/controller/network/expressroutecircuitauthorization/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ExpressRouteCircuitAuthorization_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteCircuitAuthorization_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteCircuitAuthorization_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_circuit_authorization"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_circuit_authorization"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ExpressRouteCircuitAuthorization_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/expressroutecircuitconnection/zz_controller.go b/internal/controller/network/expressroutecircuitconnection/zz_controller.go index d479d0521..7d3ea70f3 100755 --- a/internal/controller/network/expressroutecircuitconnection/zz_controller.go +++ b/internal/controller/network/expressroutecircuitconnection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ExpressRouteCircuitConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteCircuitConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteCircuitConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_circuit_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_circuit_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ExpressRouteCircuitConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/expressroutecircuitpeering/zz_controller.go b/internal/controller/network/expressroutecircuitpeering/zz_controller.go index 00c0c21c8..92ee7ebfd 100755 --- a/internal/controller/network/expressroutecircuitpeering/zz_controller.go +++ b/internal/controller/network/expressroutecircuitpeering/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ExpressRouteCircuitPeering_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteCircuitPeering_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteCircuitPeering_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_circuit_peering"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_circuit_peering"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ExpressRouteCircuitPeering_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/expressrouteconnection/zz_controller.go b/internal/controller/network/expressrouteconnection/zz_controller.go index 333782469..011a33552 100755 --- a/internal/controller/network/expressrouteconnection/zz_controller.go +++ b/internal/controller/network/expressrouteconnection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ExpressRouteConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ExpressRouteConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/expressroutegateway/zz_controller.go b/internal/controller/network/expressroutegateway/zz_controller.go index dd1f07ba1..5a90119ac 100755 --- a/internal/controller/network/expressroutegateway/zz_controller.go +++ b/internal/controller/network/expressroutegateway/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ExpressRouteGateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_gateway"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_gateway"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ExpressRouteGateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/expressrouteport/zz_controller.go b/internal/controller/network/expressrouteport/zz_controller.go index a0fdd1e87..316cef538 100755 --- a/internal/controller/network/expressrouteport/zz_controller.go +++ b/internal/controller/network/expressrouteport/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ExpressRoutePort_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRoutePort_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRoutePort_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_port"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_port"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ExpressRoutePort_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/firewall/zz_controller.go b/internal/controller/network/firewall/zz_controller.go index 797da1263..d528663de 100755 --- a/internal/controller/network/firewall/zz_controller.go +++ b/internal/controller/network/firewall/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Firewall_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Firewall_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Firewall_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_firewall"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_firewall"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Firewall_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/firewallapplicationrulecollection/zz_controller.go b/internal/controller/network/firewallapplicationrulecollection/zz_controller.go index 4cff337ab..a6e7296b9 100755 --- a/internal/controller/network/firewallapplicationrulecollection/zz_controller.go +++ b/internal/controller/network/firewallapplicationrulecollection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FirewallApplicationRuleCollection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallApplicationRuleCollection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallApplicationRuleCollection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_firewall_application_rule_collection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_firewall_application_rule_collection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FirewallApplicationRuleCollection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/firewallnatrulecollection/zz_controller.go b/internal/controller/network/firewallnatrulecollection/zz_controller.go index 34d0790f5..3f9ea01f0 100755 --- a/internal/controller/network/firewallnatrulecollection/zz_controller.go +++ b/internal/controller/network/firewallnatrulecollection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FirewallNATRuleCollection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallNATRuleCollection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallNATRuleCollection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_firewall_nat_rule_collection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_firewall_nat_rule_collection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FirewallNATRuleCollection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/firewallnetworkrulecollection/zz_controller.go b/internal/controller/network/firewallnetworkrulecollection/zz_controller.go index 57838ebe8..285462ec2 100755 --- a/internal/controller/network/firewallnetworkrulecollection/zz_controller.go +++ b/internal/controller/network/firewallnetworkrulecollection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FirewallNetworkRuleCollection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallNetworkRuleCollection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallNetworkRuleCollection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_firewall_network_rule_collection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_firewall_network_rule_collection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FirewallNetworkRuleCollection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/firewallpolicy/zz_controller.go b/internal/controller/network/firewallpolicy/zz_controller.go index c5e3b2728..09b87b495 100755 --- a/internal/controller/network/firewallpolicy/zz_controller.go +++ b/internal/controller/network/firewallpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FirewallPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_firewall_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_firewall_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FirewallPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/firewallpolicyrulecollectiongroup/zz_controller.go b/internal/controller/network/firewallpolicyrulecollectiongroup/zz_controller.go index 258f9eb5b..cf1392ed0 100755 --- a/internal/controller/network/firewallpolicyrulecollectiongroup/zz_controller.go +++ b/internal/controller/network/firewallpolicyrulecollectiongroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FirewallPolicyRuleCollectionGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallPolicyRuleCollectionGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallPolicyRuleCollectionGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_firewall_policy_rule_collection_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_firewall_policy_rule_collection_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FirewallPolicyRuleCollectionGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/frontdoor/zz_controller.go b/internal/controller/network/frontdoor/zz_controller.go index e67354163..85fc48b16 100755 --- a/internal/controller/network/frontdoor/zz_controller.go +++ b/internal/controller/network/frontdoor/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontDoor_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontDoor_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_frontdoor"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_frontdoor"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontDoor_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/frontdoorcustomhttpsconfiguration/zz_controller.go b/internal/controller/network/frontdoorcustomhttpsconfiguration/zz_controller.go index a53518bdd..076a7829a 100755 --- a/internal/controller/network/frontdoorcustomhttpsconfiguration/zz_controller.go +++ b/internal/controller/network/frontdoorcustomhttpsconfiguration/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorCustomHTTPSConfiguration_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorCustomHTTPSConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorCustomHTTPSConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_frontdoor_custom_https_configuration"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_frontdoor_custom_https_configuration"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorCustomHTTPSConfiguration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/frontdoorfirewallpolicy/zz_controller.go b/internal/controller/network/frontdoorfirewallpolicy/zz_controller.go index 17c658f80..fa03a51e6 100755 --- a/internal/controller/network/frontdoorfirewallpolicy/zz_controller.go +++ b/internal/controller/network/frontdoorfirewallpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorFirewallPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorFirewallPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorFirewallPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_frontdoor_firewall_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_frontdoor_firewall_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorFirewallPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/frontdoorrulesengine/zz_controller.go b/internal/controller/network/frontdoorrulesengine/zz_controller.go index d713a4a1f..5bf471122 100755 --- a/internal/controller/network/frontdoorrulesengine/zz_controller.go +++ b/internal/controller/network/frontdoorrulesengine/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorRulesEngine_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorRulesEngine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorRulesEngine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_frontdoor_rules_engine"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_frontdoor_rules_engine"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorRulesEngine_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/ipgroup/zz_controller.go b/internal/controller/network/ipgroup/zz_controller.go index 24a726487..fbb7ef35a 100755 --- a/internal/controller/network/ipgroup/zz_controller.go +++ b/internal/controller/network/ipgroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IPGroup_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IPGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_ip_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_ip_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IPGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/loadbalancer/zz_controller.go b/internal/controller/network/loadbalancer/zz_controller.go index 20c2e8af4..561af13fe 100755 --- a/internal/controller/network/loadbalancer/zz_controller.go +++ b/internal/controller/network/loadbalancer/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LoadBalancer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadBalancer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadBalancer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_lb"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_lb"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LoadBalancer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/loadbalancerbackendaddresspool/zz_controller.go b/internal/controller/network/loadbalancerbackendaddresspool/zz_controller.go index f7ebbdf2d..663797a95 100755 --- a/internal/controller/network/loadbalancerbackendaddresspool/zz_controller.go +++ b/internal/controller/network/loadbalancerbackendaddresspool/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LoadBalancerBackendAddressPool_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadBalancerBackendAddressPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadBalancerBackendAddressPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_lb_backend_address_pool"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_lb_backend_address_pool"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LoadBalancerBackendAddressPool_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/loadbalancerbackendaddresspooladdress/zz_controller.go b/internal/controller/network/loadbalancerbackendaddresspooladdress/zz_controller.go index af5c55ff1..694f66962 100755 --- a/internal/controller/network/loadbalancerbackendaddresspooladdress/zz_controller.go +++ b/internal/controller/network/loadbalancerbackendaddresspooladdress/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LoadBalancerBackendAddressPoolAddress_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadBalancerBackendAddressPoolAddress_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadBalancerBackendAddressPoolAddress_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_lb_backend_address_pool_address"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_lb_backend_address_pool_address"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LoadBalancerBackendAddressPoolAddress_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/loadbalancernatpool/zz_controller.go b/internal/controller/network/loadbalancernatpool/zz_controller.go index f1b450b70..7aa15fbff 100755 --- a/internal/controller/network/loadbalancernatpool/zz_controller.go +++ b/internal/controller/network/loadbalancernatpool/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LoadBalancerNatPool_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadBalancerNatPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadBalancerNatPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_lb_nat_pool"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_lb_nat_pool"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LoadBalancerNatPool_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/loadbalancernatrule/zz_controller.go b/internal/controller/network/loadbalancernatrule/zz_controller.go index 1cf8cfb23..e1b4cff79 100755 --- a/internal/controller/network/loadbalancernatrule/zz_controller.go +++ b/internal/controller/network/loadbalancernatrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LoadBalancerNatRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadBalancerNatRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadBalancerNatRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_lb_nat_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_lb_nat_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LoadBalancerNatRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/loadbalanceroutboundrule/zz_controller.go b/internal/controller/network/loadbalanceroutboundrule/zz_controller.go index a0b86f853..62df5b3f0 100755 --- a/internal/controller/network/loadbalanceroutboundrule/zz_controller.go +++ b/internal/controller/network/loadbalanceroutboundrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LoadBalancerOutboundRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadBalancerOutboundRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadBalancerOutboundRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_lb_outbound_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_lb_outbound_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LoadBalancerOutboundRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/loadbalancerprobe/zz_controller.go b/internal/controller/network/loadbalancerprobe/zz_controller.go index 08fe2ca6b..6feaf82ac 100755 --- a/internal/controller/network/loadbalancerprobe/zz_controller.go +++ b/internal/controller/network/loadbalancerprobe/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LoadBalancerProbe_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadBalancerProbe_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadBalancerProbe_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_lb_probe"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_lb_probe"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LoadBalancerProbe_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/loadbalancerrule/zz_controller.go b/internal/controller/network/loadbalancerrule/zz_controller.go index 4fdc7a4c3..36e66bebe 100755 --- a/internal/controller/network/loadbalancerrule/zz_controller.go +++ b/internal/controller/network/loadbalancerrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LoadBalancerRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadBalancerRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadBalancerRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_lb_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_lb_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LoadBalancerRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/localnetworkgateway/zz_controller.go b/internal/controller/network/localnetworkgateway/zz_controller.go index 482c412c5..61def34a6 100755 --- a/internal/controller/network/localnetworkgateway/zz_controller.go +++ b/internal/controller/network/localnetworkgateway/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LocalNetworkGateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LocalNetworkGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LocalNetworkGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_local_network_gateway"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_local_network_gateway"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LocalNetworkGateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/manager/zz_controller.go b/internal/controller/network/manager/zz_controller.go index c425673c4..d9dfbfe8f 100755 --- a/internal/controller/network/manager/zz_controller.go +++ b/internal/controller/network/manager/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Manager_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Manager_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Manager_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_manager"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_manager"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Manager_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/managermanagementgroupconnection/zz_controller.go b/internal/controller/network/managermanagementgroupconnection/zz_controller.go index f00d9e5ce..1f5af24a1 100755 --- a/internal/controller/network/managermanagementgroupconnection/zz_controller.go +++ b/internal/controller/network/managermanagementgroupconnection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagerManagementGroupConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagerManagementGroupConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagerManagementGroupConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_manager_management_group_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_manager_management_group_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagerManagementGroupConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/managernetworkgroup/zz_controller.go b/internal/controller/network/managernetworkgroup/zz_controller.go index 0342830a0..658e9f3ae 100755 --- a/internal/controller/network/managernetworkgroup/zz_controller.go +++ b/internal/controller/network/managernetworkgroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagerNetworkGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagerNetworkGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagerNetworkGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_manager_network_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_manager_network_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagerNetworkGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/managerstaticmember/zz_controller.go b/internal/controller/network/managerstaticmember/zz_controller.go index a288c3880..53308b4a0 100755 --- a/internal/controller/network/managerstaticmember/zz_controller.go +++ b/internal/controller/network/managerstaticmember/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagerStaticMember_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagerStaticMember_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagerStaticMember_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_manager_static_member"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_manager_static_member"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagerStaticMember_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/managersubscriptionconnection/zz_controller.go b/internal/controller/network/managersubscriptionconnection/zz_controller.go index 729a5889f..69f782f68 100755 --- a/internal/controller/network/managersubscriptionconnection/zz_controller.go +++ b/internal/controller/network/managersubscriptionconnection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagerSubscriptionConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagerSubscriptionConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagerSubscriptionConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_manager_subscription_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_manager_subscription_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagerSubscriptionConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/natgateway/zz_controller.go b/internal/controller/network/natgateway/zz_controller.go index 8be4efd37..93c52d186 100755 --- a/internal/controller/network/natgateway/zz_controller.go +++ b/internal/controller/network/natgateway/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NATGateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NATGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NATGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_nat_gateway"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_nat_gateway"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NATGateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/natgatewaypublicipassociation/zz_controller.go b/internal/controller/network/natgatewaypublicipassociation/zz_controller.go index c858a896b..55eb44607 100755 --- a/internal/controller/network/natgatewaypublicipassociation/zz_controller.go +++ b/internal/controller/network/natgatewaypublicipassociation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NATGatewayPublicIPAssociation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NATGatewayPublicIPAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NATGatewayPublicIPAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_nat_gateway_public_ip_association"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_nat_gateway_public_ip_association"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NATGatewayPublicIPAssociation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/natgatewaypublicipprefixassociation/zz_controller.go b/internal/controller/network/natgatewaypublicipprefixassociation/zz_controller.go index 706d068e5..5d74f2c14 100755 --- a/internal/controller/network/natgatewaypublicipprefixassociation/zz_controller.go +++ b/internal/controller/network/natgatewaypublicipprefixassociation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NATGatewayPublicIPPrefixAssociation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NATGatewayPublicIPPrefixAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NATGatewayPublicIPPrefixAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_nat_gateway_public_ip_prefix_association"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_nat_gateway_public_ip_prefix_association"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NATGatewayPublicIPPrefixAssociation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/networkinterface/zz_controller.go b/internal/controller/network/networkinterface/zz_controller.go index 05afe4a5d..14a0feb46 100755 --- a/internal/controller/network/networkinterface/zz_controller.go +++ b/internal/controller/network/networkinterface/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NetworkInterface_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NetworkInterface_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_interface"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_interface"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NetworkInterface_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/networkinterfaceapplicationsecuritygroupassociation/zz_controller.go b/internal/controller/network/networkinterfaceapplicationsecuritygroupassociation/zz_controller.go index d82a8e849..ff9cdcc15 100755 --- a/internal/controller/network/networkinterfaceapplicationsecuritygroupassociation/zz_controller.go +++ b/internal/controller/network/networkinterfaceapplicationsecuritygroupassociation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NetworkInterfaceApplicationSecurityGroupAssociation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NetworkInterfaceApplicationSecurityGroupAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NetworkInterfaceApplicationSecurityGroupAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_interface_application_security_group_association"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_interface_application_security_group_association"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NetworkInterfaceApplicationSecurityGroupAssociation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/networkinterfacebackendaddresspoolassociation/zz_controller.go b/internal/controller/network/networkinterfacebackendaddresspoolassociation/zz_controller.go index 8f9b16629..186f50651 100755 --- a/internal/controller/network/networkinterfacebackendaddresspoolassociation/zz_controller.go +++ b/internal/controller/network/networkinterfacebackendaddresspoolassociation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NetworkInterfaceBackendAddressPoolAssociation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NetworkInterfaceBackendAddressPoolAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NetworkInterfaceBackendAddressPoolAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_interface_backend_address_pool_association"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_interface_backend_address_pool_association"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NetworkInterfaceBackendAddressPoolAssociation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/networkinterfacenatruleassociation/zz_controller.go b/internal/controller/network/networkinterfacenatruleassociation/zz_controller.go index eaf9b460b..269686c77 100755 --- a/internal/controller/network/networkinterfacenatruleassociation/zz_controller.go +++ b/internal/controller/network/networkinterfacenatruleassociation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NetworkInterfaceNatRuleAssociation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NetworkInterfaceNatRuleAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NetworkInterfaceNatRuleAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_interface_nat_rule_association"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_interface_nat_rule_association"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NetworkInterfaceNatRuleAssociation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/networkinterfacesecuritygroupassociation/zz_controller.go b/internal/controller/network/networkinterfacesecuritygroupassociation/zz_controller.go index 2a2d6c490..6194ebe5c 100755 --- a/internal/controller/network/networkinterfacesecuritygroupassociation/zz_controller.go +++ b/internal/controller/network/networkinterfacesecuritygroupassociation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NetworkInterfaceSecurityGroupAssociation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NetworkInterfaceSecurityGroupAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NetworkInterfaceSecurityGroupAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_interface_security_group_association"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_interface_security_group_association"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NetworkInterfaceSecurityGroupAssociation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/packetcapture/zz_controller.go b/internal/controller/network/packetcapture/zz_controller.go index 730b28345..ace9dbca9 100755 --- a/internal/controller/network/packetcapture/zz_controller.go +++ b/internal/controller/network/packetcapture/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PacketCapture_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PacketCapture_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PacketCapture_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_packet_capture"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_packet_capture"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PacketCapture_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/pointtositevpngateway/zz_controller.go b/internal/controller/network/pointtositevpngateway/zz_controller.go index 758d12f28..4bb7d7749 100755 --- a/internal/controller/network/pointtositevpngateway/zz_controller.go +++ b/internal/controller/network/pointtositevpngateway/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PointToSiteVPNGateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PointToSiteVPNGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PointToSiteVPNGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_point_to_site_vpn_gateway"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_point_to_site_vpn_gateway"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PointToSiteVPNGateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/privatednsaaaarecord/zz_controller.go b/internal/controller/network/privatednsaaaarecord/zz_controller.go index 5a4a6798a..d073df67b 100755 --- a/internal/controller/network/privatednsaaaarecord/zz_controller.go +++ b/internal/controller/network/privatednsaaaarecord/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PrivateDNSAAAARecord_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateDNSAAAARecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_aaaa_record"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_aaaa_record"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PrivateDNSAAAARecord_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/privatednsarecord/zz_controller.go b/internal/controller/network/privatednsarecord/zz_controller.go index d5277c7b9..c5461c322 100755 --- a/internal/controller/network/privatednsarecord/zz_controller.go +++ b/internal/controller/network/privatednsarecord/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PrivateDNSARecord_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateDNSARecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_a_record"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_a_record"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PrivateDNSARecord_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/privatednscnamerecord/zz_controller.go b/internal/controller/network/privatednscnamerecord/zz_controller.go index 2e024db1b..4dbf12cd8 100755 --- a/internal/controller/network/privatednscnamerecord/zz_controller.go +++ b/internal/controller/network/privatednscnamerecord/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PrivateDNSCNAMERecord_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateDNSCNAMERecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateDNSCNAMERecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_cname_record"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_cname_record"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PrivateDNSCNAMERecord_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/privatednsmxrecord/zz_controller.go b/internal/controller/network/privatednsmxrecord/zz_controller.go index 302853e88..7b4ded4c3 100755 --- a/internal/controller/network/privatednsmxrecord/zz_controller.go +++ b/internal/controller/network/privatednsmxrecord/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PrivateDNSMXRecord_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateDNSMXRecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_mx_record"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_mx_record"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PrivateDNSMXRecord_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/privatednsptrrecord/zz_controller.go b/internal/controller/network/privatednsptrrecord/zz_controller.go index 27d11f0ca..5ab8a2a5c 100755 --- a/internal/controller/network/privatednsptrrecord/zz_controller.go +++ b/internal/controller/network/privatednsptrrecord/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PrivateDNSPTRRecord_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateDNSPTRRecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_ptr_record"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_ptr_record"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PrivateDNSPTRRecord_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/privatednsresolver/zz_controller.go b/internal/controller/network/privatednsresolver/zz_controller.go index 0f5275523..f6bf5bd00 100755 --- a/internal/controller/network/privatednsresolver/zz_controller.go +++ b/internal/controller/network/privatednsresolver/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PrivateDNSResolver_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateDNSResolver_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateDNSResolver_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_resolver"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_resolver"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PrivateDNSResolver_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/privatednssrvrecord/zz_controller.go b/internal/controller/network/privatednssrvrecord/zz_controller.go index 7e4605292..4cc7c20e5 100755 --- a/internal/controller/network/privatednssrvrecord/zz_controller.go +++ b/internal/controller/network/privatednssrvrecord/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PrivateDNSSRVRecord_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateDNSSRVRecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_srv_record"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_srv_record"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PrivateDNSSRVRecord_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/privatednstxtrecord/zz_controller.go b/internal/controller/network/privatednstxtrecord/zz_controller.go index 9d735da0a..86904354e 100755 --- a/internal/controller/network/privatednstxtrecord/zz_controller.go +++ b/internal/controller/network/privatednstxtrecord/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PrivateDNSTXTRecord_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateDNSTXTRecord_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_txt_record"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_txt_record"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PrivateDNSTXTRecord_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/privatednszone/zz_controller.go b/internal/controller/network/privatednszone/zz_controller.go index 4ce64be51..78b3e26b1 100755 --- a/internal/controller/network/privatednszone/zz_controller.go +++ b/internal/controller/network/privatednszone/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PrivateDNSZone_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateDNSZone_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_zone"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_zone"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PrivateDNSZone_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/privatednszonevirtualnetworklink/zz_controller.go b/internal/controller/network/privatednszonevirtualnetworklink/zz_controller.go index bb08188de..133b202c3 100755 --- a/internal/controller/network/privatednszonevirtualnetworklink/zz_controller.go +++ b/internal/controller/network/privatednszonevirtualnetworklink/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PrivateDNSZoneVirtualNetworkLink_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateDNSZoneVirtualNetworkLink_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateDNSZoneVirtualNetworkLink_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_zone_virtual_network_link"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_zone_virtual_network_link"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PrivateDNSZoneVirtualNetworkLink_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/privateendpoint/zz_controller.go b/internal/controller/network/privateendpoint/zz_controller.go index 49c92ba03..770a1140d 100755 --- a/internal/controller/network/privateendpoint/zz_controller.go +++ b/internal/controller/network/privateendpoint/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PrivateEndpoint_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_private_endpoint"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_private_endpoint"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PrivateEndpoint_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/privateendpointapplicationsecuritygroupassociation/zz_controller.go b/internal/controller/network/privateendpointapplicationsecuritygroupassociation/zz_controller.go index 5f3f950ca..532fd7f4e 100755 --- a/internal/controller/network/privateendpointapplicationsecuritygroupassociation/zz_controller.go +++ b/internal/controller/network/privateendpointapplicationsecuritygroupassociation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PrivateEndpointApplicationSecurityGroupAssociation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateEndpointApplicationSecurityGroupAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateEndpointApplicationSecurityGroupAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_private_endpoint_application_security_group_association"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_private_endpoint_application_security_group_association"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PrivateEndpointApplicationSecurityGroupAssociation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/privatelinkservice/zz_controller.go b/internal/controller/network/privatelinkservice/zz_controller.go index c403c7f66..63bb20469 100755 --- a/internal/controller/network/privatelinkservice/zz_controller.go +++ b/internal/controller/network/privatelinkservice/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PrivateLinkService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateLinkService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateLinkService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_private_link_service"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_private_link_service"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PrivateLinkService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/profile/zz_controller.go b/internal/controller/network/profile/zz_controller.go index f2c3c824e..0a6fb3116 100755 --- a/internal/controller/network/profile/zz_controller.go +++ b/internal/controller/network/profile/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Profile_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Profile_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_profile"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_profile"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Profile_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/publicip/zz_controller.go b/internal/controller/network/publicip/zz_controller.go index f9ff6632b..0df497884 100755 --- a/internal/controller/network/publicip/zz_controller.go +++ b/internal/controller/network/publicip/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PublicIP_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PublicIP_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_public_ip"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_public_ip"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PublicIP_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/publicipprefix/zz_controller.go b/internal/controller/network/publicipprefix/zz_controller.go index 5deec7e94..cf4f452d5 100755 --- a/internal/controller/network/publicipprefix/zz_controller.go +++ b/internal/controller/network/publicipprefix/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PublicIPPrefix_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PublicIPPrefix_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_public_ip_prefix"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_public_ip_prefix"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PublicIPPrefix_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/route/zz_controller.go b/internal/controller/network/route/zz_controller.go index a4d9d682d..65db3f80f 100755 --- a/internal/controller/network/route/zz_controller.go +++ b/internal/controller/network/route/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Route_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Route_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Route_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_route"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_route"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Route_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/routefilter/zz_controller.go b/internal/controller/network/routefilter/zz_controller.go index bf6409637..236384bfd 100755 --- a/internal/controller/network/routefilter/zz_controller.go +++ b/internal/controller/network/routefilter/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RouteFilter_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RouteFilter_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RouteFilter_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_route_filter"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_route_filter"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RouteFilter_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/routemap/zz_controller.go b/internal/controller/network/routemap/zz_controller.go index 70cf51e42..784fe6609 100755 --- a/internal/controller/network/routemap/zz_controller.go +++ b/internal/controller/network/routemap/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RouteMap_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RouteMap_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RouteMap_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_route_map"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_route_map"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RouteMap_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/routeserver/zz_controller.go b/internal/controller/network/routeserver/zz_controller.go index 188d7fc93..67a5d76de 100755 --- a/internal/controller/network/routeserver/zz_controller.go +++ b/internal/controller/network/routeserver/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RouteServer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RouteServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RouteServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_route_server"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_route_server"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RouteServer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/routeserverbgpconnection/zz_controller.go b/internal/controller/network/routeserverbgpconnection/zz_controller.go index 03c4e2432..4dca31bbf 100755 --- a/internal/controller/network/routeserverbgpconnection/zz_controller.go +++ b/internal/controller/network/routeserverbgpconnection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RouteServerBGPConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RouteServerBGPConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RouteServerBGPConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_route_server_bgp_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_route_server_bgp_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RouteServerBGPConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/routetable/zz_controller.go b/internal/controller/network/routetable/zz_controller.go index 5ea1d3c68..e8375a369 100755 --- a/internal/controller/network/routetable/zz_controller.go +++ b/internal/controller/network/routetable/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RouteTable_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RouteTable_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RouteTable_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_route_table"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_route_table"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RouteTable_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/securitygroup/zz_controller.go b/internal/controller/network/securitygroup/zz_controller.go index 19ce093ef..2e02dec9f 100755 --- a/internal/controller/network/securitygroup/zz_controller.go +++ b/internal/controller/network/securitygroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SecurityGroup_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_security_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_security_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SecurityGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/securityrule/zz_controller.go b/internal/controller/network/securityrule/zz_controller.go index 3683c35be..7204807d0 100755 --- a/internal/controller/network/securityrule/zz_controller.go +++ b/internal/controller/network/securityrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SecurityRule_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_security_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_security_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SecurityRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/subnet/zz_controller.go b/internal/controller/network/subnet/zz_controller.go index 7ad51584f..2a67411bb 100755 --- a/internal/controller/network/subnet/zz_controller.go +++ b/internal/controller/network/subnet/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Subnet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Subnet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Subnet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_subnet"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_subnet"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Subnet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/subnetnatgatewayassociation/zz_controller.go b/internal/controller/network/subnetnatgatewayassociation/zz_controller.go index 13cf7419a..a34f9edb8 100755 --- a/internal/controller/network/subnetnatgatewayassociation/zz_controller.go +++ b/internal/controller/network/subnetnatgatewayassociation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SubnetNATGatewayAssociation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubnetNATGatewayAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubnetNATGatewayAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_subnet_nat_gateway_association"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_subnet_nat_gateway_association"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SubnetNATGatewayAssociation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/subnetnetworksecuritygroupassociation/zz_controller.go b/internal/controller/network/subnetnetworksecuritygroupassociation/zz_controller.go index fb51be2c7..ffffbe284 100755 --- a/internal/controller/network/subnetnetworksecuritygroupassociation/zz_controller.go +++ b/internal/controller/network/subnetnetworksecuritygroupassociation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SubnetNetworkSecurityGroupAssociation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubnetNetworkSecurityGroupAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubnetNetworkSecurityGroupAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_subnet_network_security_group_association"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_subnet_network_security_group_association"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SubnetNetworkSecurityGroupAssociation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/subnetroutetableassociation/zz_controller.go b/internal/controller/network/subnetroutetableassociation/zz_controller.go index 32081efc1..4edd1ea8c 100755 --- a/internal/controller/network/subnetroutetableassociation/zz_controller.go +++ b/internal/controller/network/subnetroutetableassociation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SubnetRouteTableAssociation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubnetRouteTableAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubnetRouteTableAssociation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_subnet_route_table_association"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_subnet_route_table_association"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SubnetRouteTableAssociation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/subnetserviceendpointstoragepolicy/zz_controller.go b/internal/controller/network/subnetserviceendpointstoragepolicy/zz_controller.go index aeca4cc89..f944a392d 100755 --- a/internal/controller/network/subnetserviceendpointstoragepolicy/zz_controller.go +++ b/internal/controller/network/subnetserviceendpointstoragepolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SubnetServiceEndpointStoragePolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubnetServiceEndpointStoragePolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubnetServiceEndpointStoragePolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_subnet_service_endpoint_storage_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_subnet_service_endpoint_storage_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SubnetServiceEndpointStoragePolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/trafficmanagerazureendpoint/zz_controller.go b/internal/controller/network/trafficmanagerazureendpoint/zz_controller.go index 7d613ca91..cb8d6b268 100755 --- a/internal/controller/network/trafficmanagerazureendpoint/zz_controller.go +++ b/internal/controller/network/trafficmanagerazureendpoint/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.TrafficManagerAzureEndpoint_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TrafficManagerAzureEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TrafficManagerAzureEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_traffic_manager_azure_endpoint"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_traffic_manager_azure_endpoint"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.TrafficManagerAzureEndpoint_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/trafficmanagerexternalendpoint/zz_controller.go b/internal/controller/network/trafficmanagerexternalendpoint/zz_controller.go index bbcb81a30..abae229ab 100755 --- a/internal/controller/network/trafficmanagerexternalendpoint/zz_controller.go +++ b/internal/controller/network/trafficmanagerexternalendpoint/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.TrafficManagerExternalEndpoint_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TrafficManagerExternalEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TrafficManagerExternalEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_traffic_manager_external_endpoint"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_traffic_manager_external_endpoint"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.TrafficManagerExternalEndpoint_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/trafficmanagernestedendpoint/zz_controller.go b/internal/controller/network/trafficmanagernestedendpoint/zz_controller.go index 24643335a..c5bba305b 100755 --- a/internal/controller/network/trafficmanagernestedendpoint/zz_controller.go +++ b/internal/controller/network/trafficmanagernestedendpoint/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.TrafficManagerNestedEndpoint_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TrafficManagerNestedEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TrafficManagerNestedEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_traffic_manager_nested_endpoint"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_traffic_manager_nested_endpoint"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.TrafficManagerNestedEndpoint_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/trafficmanagerprofile/zz_controller.go b/internal/controller/network/trafficmanagerprofile/zz_controller.go index a0be475bf..2cdaa0da0 100755 --- a/internal/controller/network/trafficmanagerprofile/zz_controller.go +++ b/internal/controller/network/trafficmanagerprofile/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.TrafficManagerProfile_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TrafficManagerProfile_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TrafficManagerProfile_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_traffic_manager_profile"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_traffic_manager_profile"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.TrafficManagerProfile_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/virtualhub/zz_controller.go b/internal/controller/network/virtualhub/zz_controller.go index 228ed64cf..af9da1aa1 100755 --- a/internal/controller/network/virtualhub/zz_controller.go +++ b/internal/controller/network/virtualhub/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_hub"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_hub"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/virtualhubconnection/zz_controller.go b/internal/controller/network/virtualhubconnection/zz_controller.go index d61156e70..390b29b07 100755 --- a/internal/controller/network/virtualhubconnection/zz_controller.go +++ b/internal/controller/network/virtualhubconnection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualHubConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualHubConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualHubConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_hub_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_hub_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualHubConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/virtualhubip/zz_controller.go b/internal/controller/network/virtualhubip/zz_controller.go index 8a68f6e3b..3f6f22e61 100755 --- a/internal/controller/network/virtualhubip/zz_controller.go +++ b/internal/controller/network/virtualhubip/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualHubIP_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualHubIP_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualHubIP_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_hub_ip"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_hub_ip"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualHubIP_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/virtualhubroutetable/zz_controller.go b/internal/controller/network/virtualhubroutetable/zz_controller.go index 88f4a1462..46cc5976f 100755 --- a/internal/controller/network/virtualhubroutetable/zz_controller.go +++ b/internal/controller/network/virtualhubroutetable/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualHubRouteTable_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualHubRouteTable_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualHubRouteTable_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_hub_route_table"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_hub_route_table"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualHubRouteTable_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/virtualhubroutetableroute/zz_controller.go b/internal/controller/network/virtualhubroutetableroute/zz_controller.go index 75dc0f74c..15e8924ca 100755 --- a/internal/controller/network/virtualhubroutetableroute/zz_controller.go +++ b/internal/controller/network/virtualhubroutetableroute/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualHubRouteTableRoute_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualHubRouteTableRoute_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualHubRouteTableRoute_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_hub_route_table_route"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_hub_route_table_route"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualHubRouteTableRoute_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/virtualhubsecuritypartnerprovider/zz_controller.go b/internal/controller/network/virtualhubsecuritypartnerprovider/zz_controller.go index 9ece5a830..dceed79cf 100755 --- a/internal/controller/network/virtualhubsecuritypartnerprovider/zz_controller.go +++ b/internal/controller/network/virtualhubsecuritypartnerprovider/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualHubSecurityPartnerProvider_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualHubSecurityPartnerProvider_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualHubSecurityPartnerProvider_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_hub_security_partner_provider"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_hub_security_partner_provider"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualHubSecurityPartnerProvider_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/virtualnetwork/zz_controller.go b/internal/controller/network/virtualnetwork/zz_controller.go index f85b2f40f..8fae91755 100755 --- a/internal/controller/network/virtualnetwork/zz_controller.go +++ b/internal/controller/network/virtualnetwork/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualNetwork_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetwork_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_network"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_network"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualNetwork_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/virtualnetworkgateway/zz_controller.go b/internal/controller/network/virtualnetworkgateway/zz_controller.go index 685dec84f..96f2e8b72 100755 --- a/internal/controller/network/virtualnetworkgateway/zz_controller.go +++ b/internal/controller/network/virtualnetworkgateway/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualNetworkGateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetworkGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetworkGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_network_gateway"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_network_gateway"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualNetworkGateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/virtualnetworkgatewayconnection/zz_controller.go b/internal/controller/network/virtualnetworkgatewayconnection/zz_controller.go index 0c25e447f..942742345 100755 --- a/internal/controller/network/virtualnetworkgatewayconnection/zz_controller.go +++ b/internal/controller/network/virtualnetworkgatewayconnection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualNetworkGatewayConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetworkGatewayConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetworkGatewayConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_network_gateway_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_network_gateway_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualNetworkGatewayConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/virtualnetworkpeering/zz_controller.go b/internal/controller/network/virtualnetworkpeering/zz_controller.go index f6a75f47f..8de07a84e 100755 --- a/internal/controller/network/virtualnetworkpeering/zz_controller.go +++ b/internal/controller/network/virtualnetworkpeering/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualNetworkPeering_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetworkPeering_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetworkPeering_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_network_peering"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_network_peering"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualNetworkPeering_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/virtualwan/zz_controller.go b/internal/controller/network/virtualwan/zz_controller.go index 1c8e39e99..b2cbd48b9 100755 --- a/internal/controller/network/virtualwan/zz_controller.go +++ b/internal/controller/network/virtualwan/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualWAN_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualWAN_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualWAN_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_wan"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_wan"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualWAN_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/vpngateway/zz_controller.go b/internal/controller/network/vpngateway/zz_controller.go index 0c1643214..1d0a5ca06 100755 --- a/internal/controller/network/vpngateway/zz_controller.go +++ b/internal/controller/network/vpngateway/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VPNGateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPNGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPNGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_vpn_gateway"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_vpn_gateway"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VPNGateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/vpngatewayconnection/zz_controller.go b/internal/controller/network/vpngatewayconnection/zz_controller.go index 1442c6c39..ba858de46 100755 --- a/internal/controller/network/vpngatewayconnection/zz_controller.go +++ b/internal/controller/network/vpngatewayconnection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VPNGatewayConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPNGatewayConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPNGatewayConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_vpn_gateway_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_vpn_gateway_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VPNGatewayConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/vpnserverconfiguration/zz_controller.go b/internal/controller/network/vpnserverconfiguration/zz_controller.go index e7547d36d..63a8e606d 100755 --- a/internal/controller/network/vpnserverconfiguration/zz_controller.go +++ b/internal/controller/network/vpnserverconfiguration/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VPNServerConfiguration_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPNServerConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPNServerConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_vpn_server_configuration"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_vpn_server_configuration"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VPNServerConfiguration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/vpnserverconfigurationpolicygroup/zz_controller.go b/internal/controller/network/vpnserverconfigurationpolicygroup/zz_controller.go index 6ac3a82f3..b49536b9f 100755 --- a/internal/controller/network/vpnserverconfigurationpolicygroup/zz_controller.go +++ b/internal/controller/network/vpnserverconfigurationpolicygroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VPNServerConfigurationPolicyGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPNServerConfigurationPolicyGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPNServerConfigurationPolicyGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_vpn_server_configuration_policy_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_vpn_server_configuration_policy_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VPNServerConfigurationPolicyGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/vpnsite/zz_controller.go b/internal/controller/network/vpnsite/zz_controller.go index 159e1e4c6..11f83c395 100755 --- a/internal/controller/network/vpnsite/zz_controller.go +++ b/internal/controller/network/vpnsite/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VPNSite_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPNSite_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPNSite_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_vpn_site"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_vpn_site"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VPNSite_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/watcher/zz_controller.go b/internal/controller/network/watcher/zz_controller.go index 4fc8afb58..1957177d5 100755 --- a/internal/controller/network/watcher/zz_controller.go +++ b/internal/controller/network/watcher/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Watcher_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Watcher_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_watcher"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_watcher"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Watcher_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/watcherflowlog/zz_controller.go b/internal/controller/network/watcherflowlog/zz_controller.go index 2fbf2879d..de997f199 100755 --- a/internal/controller/network/watcherflowlog/zz_controller.go +++ b/internal/controller/network/watcherflowlog/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WatcherFlowLog_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WatcherFlowLog_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_network_watcher_flow_log"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_watcher_flow_log"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WatcherFlowLog_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/network/webapplicationfirewallpolicy/zz_controller.go b/internal/controller/network/webapplicationfirewallpolicy/zz_controller.go index 1d36eba6c..05e2c1f7b 100755 --- a/internal/controller/network/webapplicationfirewallpolicy/zz_controller.go +++ b/internal/controller/network/webapplicationfirewallpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WebApplicationFirewallPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WebApplicationFirewallPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WebApplicationFirewallPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_web_application_firewall_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_web_application_firewall_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WebApplicationFirewallPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/notificationhubs/authorizationrule/zz_controller.go b/internal/controller/notificationhubs/authorizationrule/zz_controller.go index e3180dfaf..d8215d9f2 100755 --- a/internal/controller/notificationhubs/authorizationrule/zz_controller.go +++ b/internal/controller/notificationhubs/authorizationrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/notificationhubs/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AuthorizationRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AuthorizationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AuthorizationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_notification_hub_authorization_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_notification_hub_authorization_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AuthorizationRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/notificationhubs/notificationhub/zz_controller.go b/internal/controller/notificationhubs/notificationhub/zz_controller.go index be24bf915..463e5b43e 100755 --- a/internal/controller/notificationhubs/notificationhub/zz_controller.go +++ b/internal/controller/notificationhubs/notificationhub/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/notificationhubs/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NotificationHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NotificationHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NotificationHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_notification_hub"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_notification_hub"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NotificationHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/notificationhubs/notificationhubnamespace/zz_controller.go b/internal/controller/notificationhubs/notificationhubnamespace/zz_controller.go index c27d18b07..1eeac89d8 100755 --- a/internal/controller/notificationhubs/notificationhubnamespace/zz_controller.go +++ b/internal/controller/notificationhubs/notificationhubnamespace/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/notificationhubs/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NotificationHubNamespace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NotificationHubNamespace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NotificationHubNamespace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_notification_hub_namespace"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_notification_hub_namespace"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NotificationHubNamespace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/operationalinsights/loganalyticsdataexportrule/zz_controller.go b/internal/controller/operationalinsights/loganalyticsdataexportrule/zz_controller.go index 6bc43f310..ca6cbe0ac 100755 --- a/internal/controller/operationalinsights/loganalyticsdataexportrule/zz_controller.go +++ b/internal/controller/operationalinsights/loganalyticsdataexportrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/operationalinsights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LogAnalyticsDataExportRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsDataExportRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsDataExportRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_data_export_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_data_export_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LogAnalyticsDataExportRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/operationalinsights/loganalyticsdatasourcewindowsevent/zz_controller.go b/internal/controller/operationalinsights/loganalyticsdatasourcewindowsevent/zz_controller.go index 0e4098e81..bc1ce6b45 100755 --- a/internal/controller/operationalinsights/loganalyticsdatasourcewindowsevent/zz_controller.go +++ b/internal/controller/operationalinsights/loganalyticsdatasourcewindowsevent/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/operationalinsights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LogAnalyticsDataSourceWindowsEvent_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsDataSourceWindowsEvent_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsDataSourceWindowsEvent_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_datasource_windows_event"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_datasource_windows_event"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LogAnalyticsDataSourceWindowsEvent_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/operationalinsights/loganalyticsdatasourcewindowsperformancecounter/zz_controller.go b/internal/controller/operationalinsights/loganalyticsdatasourcewindowsperformancecounter/zz_controller.go index 962d2ae3b..5a54b24d1 100755 --- a/internal/controller/operationalinsights/loganalyticsdatasourcewindowsperformancecounter/zz_controller.go +++ b/internal/controller/operationalinsights/loganalyticsdatasourcewindowsperformancecounter/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/operationalinsights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LogAnalyticsDataSourceWindowsPerformanceCounter_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsDataSourceWindowsPerformanceCounter_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsDataSourceWindowsPerformanceCounter_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_datasource_windows_performance_counter"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_datasource_windows_performance_counter"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LogAnalyticsDataSourceWindowsPerformanceCounter_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/operationalinsights/loganalyticslinkedservice/zz_controller.go b/internal/controller/operationalinsights/loganalyticslinkedservice/zz_controller.go index 9b9f02579..2c1430396 100755 --- a/internal/controller/operationalinsights/loganalyticslinkedservice/zz_controller.go +++ b/internal/controller/operationalinsights/loganalyticslinkedservice/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/operationalinsights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LogAnalyticsLinkedService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsLinkedService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsLinkedService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_linked_service"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_linked_service"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LogAnalyticsLinkedService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/operationalinsights/loganalyticslinkedstorageaccount/zz_controller.go b/internal/controller/operationalinsights/loganalyticslinkedstorageaccount/zz_controller.go index 62bf77c30..7401318fd 100755 --- a/internal/controller/operationalinsights/loganalyticslinkedstorageaccount/zz_controller.go +++ b/internal/controller/operationalinsights/loganalyticslinkedstorageaccount/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/operationalinsights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LogAnalyticsLinkedStorageAccount_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsLinkedStorageAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsLinkedStorageAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_linked_storage_account"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_linked_storage_account"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LogAnalyticsLinkedStorageAccount_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/operationalinsights/loganalyticsquerypack/zz_controller.go b/internal/controller/operationalinsights/loganalyticsquerypack/zz_controller.go index da870b921..178ef447b 100755 --- a/internal/controller/operationalinsights/loganalyticsquerypack/zz_controller.go +++ b/internal/controller/operationalinsights/loganalyticsquerypack/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/operationalinsights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LogAnalyticsQueryPack_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsQueryPack_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsQueryPack_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_query_pack"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_query_pack"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LogAnalyticsQueryPack_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/operationalinsights/loganalyticsquerypackquery/zz_controller.go b/internal/controller/operationalinsights/loganalyticsquerypackquery/zz_controller.go index 019b7531f..31b9cc985 100755 --- a/internal/controller/operationalinsights/loganalyticsquerypackquery/zz_controller.go +++ b/internal/controller/operationalinsights/loganalyticsquerypackquery/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/operationalinsights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LogAnalyticsQueryPackQuery_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsQueryPackQuery_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsQueryPackQuery_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_query_pack_query"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_query_pack_query"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LogAnalyticsQueryPackQuery_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/operationalinsights/loganalyticssavedsearch/zz_controller.go b/internal/controller/operationalinsights/loganalyticssavedsearch/zz_controller.go index 22f8ef1ad..8d8c763dc 100755 --- a/internal/controller/operationalinsights/loganalyticssavedsearch/zz_controller.go +++ b/internal/controller/operationalinsights/loganalyticssavedsearch/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/operationalinsights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LogAnalyticsSavedSearch_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsSavedSearch_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsSavedSearch_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_saved_search"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_saved_search"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LogAnalyticsSavedSearch_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/operationalinsights/workspace/zz_controller.go b/internal/controller/operationalinsights/workspace/zz_controller.go index d37b140af..78461f1f4 100755 --- a/internal/controller/operationalinsights/workspace/zz_controller.go +++ b/internal/controller/operationalinsights/workspace/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/operationalinsights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Workspace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Workspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Workspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_workspace"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_workspace"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Workspace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/operationsmanagement/loganalyticssolution/zz_controller.go b/internal/controller/operationsmanagement/loganalyticssolution/zz_controller.go index abc1604e1..96ff295e6 100755 --- a/internal/controller/operationsmanagement/loganalyticssolution/zz_controller.go +++ b/internal/controller/operationsmanagement/loganalyticssolution/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/operationsmanagement/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LogAnalyticsSolution_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsSolution_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsSolution_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_solution"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_solution"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LogAnalyticsSolution_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/orbital/contactprofile/zz_controller.go b/internal/controller/orbital/contactprofile/zz_controller.go index 319da99a6..23e1e1dea 100755 --- a/internal/controller/orbital/contactprofile/zz_controller.go +++ b/internal/controller/orbital/contactprofile/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/orbital/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ContactProfile_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ContactProfile_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ContactProfile_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_orbital_contact_profile"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_orbital_contact_profile"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ContactProfile_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/orbital/spacecraft/zz_controller.go b/internal/controller/orbital/spacecraft/zz_controller.go index 3dded8199..9abb8a0d4 100755 --- a/internal/controller/orbital/spacecraft/zz_controller.go +++ b/internal/controller/orbital/spacecraft/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/orbital/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Spacecraft_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Spacecraft_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Spacecraft_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_orbital_spacecraft"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_orbital_spacecraft"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Spacecraft_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/policyinsights/resourcepolicyremediation/zz_controller.go b/internal/controller/policyinsights/resourcepolicyremediation/zz_controller.go index 07f7ad1cf..e26139f33 100755 --- a/internal/controller/policyinsights/resourcepolicyremediation/zz_controller.go +++ b/internal/controller/policyinsights/resourcepolicyremediation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/policyinsights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ResourcePolicyRemediation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourcePolicyRemediation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourcePolicyRemediation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_resource_policy_remediation"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_resource_policy_remediation"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ResourcePolicyRemediation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/policyinsights/subscriptionpolicyremediation/zz_controller.go b/internal/controller/policyinsights/subscriptionpolicyremediation/zz_controller.go index 40d2dfb0d..acfba5c33 100755 --- a/internal/controller/policyinsights/subscriptionpolicyremediation/zz_controller.go +++ b/internal/controller/policyinsights/subscriptionpolicyremediation/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/policyinsights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SubscriptionPolicyRemediation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubscriptionPolicyRemediation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubscriptionPolicyRemediation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_subscription_policy_remediation"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_subscription_policy_remediation"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SubscriptionPolicyRemediation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/portal/dashboard/zz_controller.go b/internal/controller/portal/dashboard/zz_controller.go index bc3624aea..433e436a2 100755 --- a/internal/controller/portal/dashboard/zz_controller.go +++ b/internal/controller/portal/dashboard/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/portal/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Dashboard_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Dashboard_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Dashboard_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_portal_dashboard"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_portal_dashboard"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Dashboard_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/powerbidedicated/powerbiembedded/zz_controller.go b/internal/controller/powerbidedicated/powerbiembedded/zz_controller.go index 0c5b56bd5..57197d09d 100755 --- a/internal/controller/powerbidedicated/powerbiembedded/zz_controller.go +++ b/internal/controller/powerbidedicated/powerbiembedded/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/powerbidedicated/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PowerBIEmbedded_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PowerBIEmbedded_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PowerBIEmbedded_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_powerbi_embedded"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_powerbi_embedded"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PowerBIEmbedded_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/purview/account/zz_controller.go b/internal/controller/purview/account/zz_controller.go index db5ce98c6..fe3e01247 100755 --- a/internal/controller/purview/account/zz_controller.go +++ b/internal/controller/purview/account/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/purview/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Account_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_purview_account"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_purview_account"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Account_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/recoveryservices/backupcontainerstorageaccount/zz_controller.go b/internal/controller/recoveryservices/backupcontainerstorageaccount/zz_controller.go index 530626012..2ca907647 100755 --- a/internal/controller/recoveryservices/backupcontainerstorageaccount/zz_controller.go +++ b/internal/controller/recoveryservices/backupcontainerstorageaccount/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupContainerStorageAccount_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupContainerStorageAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupContainerStorageAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_backup_container_storage_account"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_backup_container_storage_account"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupContainerStorageAccount_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/recoveryservices/backuppolicyfileshare/zz_controller.go b/internal/controller/recoveryservices/backuppolicyfileshare/zz_controller.go index 2f5207d15..2b77d9780 100755 --- a/internal/controller/recoveryservices/backuppolicyfileshare/zz_controller.go +++ b/internal/controller/recoveryservices/backuppolicyfileshare/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupPolicyFileShare_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyFileShare_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyFileShare_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_backup_policy_file_share"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_backup_policy_file_share"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupPolicyFileShare_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/recoveryservices/backuppolicyvm/zz_controller.go b/internal/controller/recoveryservices/backuppolicyvm/zz_controller.go index 81989c6da..ee4c18328 100755 --- a/internal/controller/recoveryservices/backuppolicyvm/zz_controller.go +++ b/internal/controller/recoveryservices/backuppolicyvm/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupPolicyVM_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyVM_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyVM_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_backup_policy_vm"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_backup_policy_vm"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupPolicyVM_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/recoveryservices/backuppolicyvmworkload/zz_controller.go b/internal/controller/recoveryservices/backuppolicyvmworkload/zz_controller.go index d574d6614..36047e298 100755 --- a/internal/controller/recoveryservices/backuppolicyvmworkload/zz_controller.go +++ b/internal/controller/recoveryservices/backuppolicyvmworkload/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupPolicyVMWorkload_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyVMWorkload_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyVMWorkload_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_backup_policy_vm_workload"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_backup_policy_vm_workload"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupPolicyVMWorkload_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/recoveryservices/backupprotectedfileshare/zz_controller.go b/internal/controller/recoveryservices/backupprotectedfileshare/zz_controller.go index 72b4f46a1..d4db9dde5 100755 --- a/internal/controller/recoveryservices/backupprotectedfileshare/zz_controller.go +++ b/internal/controller/recoveryservices/backupprotectedfileshare/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupProtectedFileShare_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupProtectedFileShare_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupProtectedFileShare_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_backup_protected_file_share"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_backup_protected_file_share"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupProtectedFileShare_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/recoveryservices/backupprotectedvm/zz_controller.go b/internal/controller/recoveryservices/backupprotectedvm/zz_controller.go index 1b56ec2c1..3547f6597 100755 --- a/internal/controller/recoveryservices/backupprotectedvm/zz_controller.go +++ b/internal/controller/recoveryservices/backupprotectedvm/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupProtectedVM_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupProtectedVM_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupProtectedVM_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_backup_protected_vm"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_backup_protected_vm"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupProtectedVM_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/recoveryservices/siterecoveryfabric/zz_controller.go b/internal/controller/recoveryservices/siterecoveryfabric/zz_controller.go index a69698f58..db3369dbc 100755 --- a/internal/controller/recoveryservices/siterecoveryfabric/zz_controller.go +++ b/internal/controller/recoveryservices/siterecoveryfabric/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SiteRecoveryFabric_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SiteRecoveryFabric_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SiteRecoveryFabric_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_site_recovery_fabric"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_site_recovery_fabric"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SiteRecoveryFabric_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/recoveryservices/siterecoverynetworkmapping/zz_controller.go b/internal/controller/recoveryservices/siterecoverynetworkmapping/zz_controller.go index 3dc03e479..c8b640adf 100755 --- a/internal/controller/recoveryservices/siterecoverynetworkmapping/zz_controller.go +++ b/internal/controller/recoveryservices/siterecoverynetworkmapping/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SiteRecoveryNetworkMapping_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SiteRecoveryNetworkMapping_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SiteRecoveryNetworkMapping_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_site_recovery_network_mapping"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_site_recovery_network_mapping"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SiteRecoveryNetworkMapping_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/recoveryservices/siterecoveryprotectioncontainer/zz_controller.go b/internal/controller/recoveryservices/siterecoveryprotectioncontainer/zz_controller.go index 292003718..b61e07dd1 100755 --- a/internal/controller/recoveryservices/siterecoveryprotectioncontainer/zz_controller.go +++ b/internal/controller/recoveryservices/siterecoveryprotectioncontainer/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SiteRecoveryProtectionContainer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SiteRecoveryProtectionContainer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SiteRecoveryProtectionContainer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_site_recovery_protection_container"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_site_recovery_protection_container"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SiteRecoveryProtectionContainer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/recoveryservices/siterecoveryprotectioncontainermapping/zz_controller.go b/internal/controller/recoveryservices/siterecoveryprotectioncontainermapping/zz_controller.go index bf93158db..edac7dcf5 100755 --- a/internal/controller/recoveryservices/siterecoveryprotectioncontainermapping/zz_controller.go +++ b/internal/controller/recoveryservices/siterecoveryprotectioncontainermapping/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SiteRecoveryProtectionContainerMapping_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SiteRecoveryProtectionContainerMapping_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SiteRecoveryProtectionContainerMapping_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_site_recovery_protection_container_mapping"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_site_recovery_protection_container_mapping"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SiteRecoveryProtectionContainerMapping_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/recoveryservices/siterecoveryreplicationpolicy/zz_controller.go b/internal/controller/recoveryservices/siterecoveryreplicationpolicy/zz_controller.go index 936ff89d2..82534f810 100755 --- a/internal/controller/recoveryservices/siterecoveryreplicationpolicy/zz_controller.go +++ b/internal/controller/recoveryservices/siterecoveryreplicationpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SiteRecoveryReplicationPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SiteRecoveryReplicationPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SiteRecoveryReplicationPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_site_recovery_replication_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_site_recovery_replication_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SiteRecoveryReplicationPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/recoveryservices/vault/zz_controller.go b/internal/controller/recoveryservices/vault/zz_controller.go index 57ac77058..42c2af57b 100755 --- a/internal/controller/recoveryservices/vault/zz_controller.go +++ b/internal/controller/recoveryservices/vault/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Vault_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Vault_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Vault_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_recovery_services_vault"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_recovery_services_vault"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Vault_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/relay/eventrelaynamespace/zz_controller.go b/internal/controller/relay/eventrelaynamespace/zz_controller.go index 4d1fd1d3f..d76ef509d 100755 --- a/internal/controller/relay/eventrelaynamespace/zz_controller.go +++ b/internal/controller/relay/eventrelaynamespace/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/relay/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.EventRelayNamespace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventRelayNamespace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventRelayNamespace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_relay_namespace"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_relay_namespace"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.EventRelayNamespace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/relay/hybridconnection/zz_controller.go b/internal/controller/relay/hybridconnection/zz_controller.go index 4b5908eda..bb80cb16b 100755 --- a/internal/controller/relay/hybridconnection/zz_controller.go +++ b/internal/controller/relay/hybridconnection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/relay/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HybridConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HybridConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HybridConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_relay_hybrid_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_relay_hybrid_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HybridConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/relay/hybridconnectionauthorizationrule/zz_controller.go b/internal/controller/relay/hybridconnectionauthorizationrule/zz_controller.go index 53555ec29..0f0ee2764 100755 --- a/internal/controller/relay/hybridconnectionauthorizationrule/zz_controller.go +++ b/internal/controller/relay/hybridconnectionauthorizationrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/relay/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HybridConnectionAuthorizationRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HybridConnectionAuthorizationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HybridConnectionAuthorizationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_relay_hybrid_connection_authorization_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_relay_hybrid_connection_authorization_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HybridConnectionAuthorizationRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/relay/namespaceauthorizationrule/zz_controller.go b/internal/controller/relay/namespaceauthorizationrule/zz_controller.go index 91c89efd6..54ac49439 100755 --- a/internal/controller/relay/namespaceauthorizationrule/zz_controller.go +++ b/internal/controller/relay/namespaceauthorizationrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/relay/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NamespaceAuthorizationRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamespaceAuthorizationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamespaceAuthorizationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_relay_namespace_authorization_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_relay_namespace_authorization_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NamespaceAuthorizationRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/resources/resourcedeploymentscriptazurecli/zz_controller.go b/internal/controller/resources/resourcedeploymentscriptazurecli/zz_controller.go index 90b08cc18..472a4b8b8 100755 --- a/internal/controller/resources/resourcedeploymentscriptazurecli/zz_controller.go +++ b/internal/controller/resources/resourcedeploymentscriptazurecli/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/resources/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ResourceDeploymentScriptAzureCli_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceDeploymentScriptAzureCli_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceDeploymentScriptAzureCli_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_resource_deployment_script_azure_cli"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_resource_deployment_script_azure_cli"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ResourceDeploymentScriptAzureCli_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/resources/resourcedeploymentscriptazurepowershell/zz_controller.go b/internal/controller/resources/resourcedeploymentscriptazurepowershell/zz_controller.go index c1cbcda45..a23f914d5 100755 --- a/internal/controller/resources/resourcedeploymentscriptazurepowershell/zz_controller.go +++ b/internal/controller/resources/resourcedeploymentscriptazurepowershell/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/resources/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ResourceDeploymentScriptAzurePowerShell_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceDeploymentScriptAzurePowerShell_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceDeploymentScriptAzurePowerShell_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_resource_deployment_script_azure_power_shell"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_resource_deployment_script_azure_power_shell"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ResourceDeploymentScriptAzurePowerShell_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/resources/resourcegrouptemplatedeployment/zz_controller.go b/internal/controller/resources/resourcegrouptemplatedeployment/zz_controller.go index c494f64a2..6d56dee05 100755 --- a/internal/controller/resources/resourcegrouptemplatedeployment/zz_controller.go +++ b/internal/controller/resources/resourcegrouptemplatedeployment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/resources/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ResourceGroupTemplateDeployment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceGroupTemplateDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceGroupTemplateDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_resource_group_template_deployment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_resource_group_template_deployment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ResourceGroupTemplateDeployment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/resources/subscriptiontemplatedeployment/zz_controller.go b/internal/controller/resources/subscriptiontemplatedeployment/zz_controller.go index d37955cb2..c8f6f7e59 100755 --- a/internal/controller/resources/subscriptiontemplatedeployment/zz_controller.go +++ b/internal/controller/resources/subscriptiontemplatedeployment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/resources/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SubscriptionTemplateDeployment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubscriptionTemplateDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubscriptionTemplateDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_subscription_template_deployment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_subscription_template_deployment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SubscriptionTemplateDeployment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/search/service/zz_controller.go b/internal/controller/search/service/zz_controller.go index 0f750a2cd..da531dcbe 100755 --- a/internal/controller/search/service/zz_controller.go +++ b/internal/controller/search/service/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/search/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Service_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Service_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Service_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_search_service"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_search_service"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Service_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/search/sharedprivatelinkservice/zz_controller.go b/internal/controller/search/sharedprivatelinkservice/zz_controller.go index 8b051327e..cef110730 100755 --- a/internal/controller/search/sharedprivatelinkservice/zz_controller.go +++ b/internal/controller/search/sharedprivatelinkservice/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/search/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SharedPrivateLinkService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SharedPrivateLinkService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SharedPrivateLinkService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_search_shared_private_link_service"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_search_shared_private_link_service"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SharedPrivateLinkService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/security/advancedthreatprotection/zz_controller.go b/internal/controller/security/advancedthreatprotection/zz_controller.go index 07a6f2abc..c7cf08c7d 100755 --- a/internal/controller/security/advancedthreatprotection/zz_controller.go +++ b/internal/controller/security/advancedthreatprotection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/security/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AdvancedThreatProtection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AdvancedThreatProtection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AdvancedThreatProtection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_advanced_threat_protection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_advanced_threat_protection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AdvancedThreatProtection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/security/iotsecuritydevicegroup/zz_controller.go b/internal/controller/security/iotsecuritydevicegroup/zz_controller.go index 9610f07c1..eda6bcd79 100755 --- a/internal/controller/security/iotsecuritydevicegroup/zz_controller.go +++ b/internal/controller/security/iotsecuritydevicegroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/security/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTSecurityDeviceGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTSecurityDeviceGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTSecurityDeviceGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iot_security_device_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iot_security_device_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTSecurityDeviceGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/security/iotsecuritysolution/zz_controller.go b/internal/controller/security/iotsecuritysolution/zz_controller.go index 579b2ece5..f2d94bf8a 100755 --- a/internal/controller/security/iotsecuritysolution/zz_controller.go +++ b/internal/controller/security/iotsecuritysolution/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/security/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTSecuritySolution_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTSecuritySolution_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTSecuritySolution_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iot_security_solution"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iot_security_solution"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTSecuritySolution_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/security/securitycenterassessment/zz_controller.go b/internal/controller/security/securitycenterassessment/zz_controller.go index 4fb9ef937..a33961d01 100755 --- a/internal/controller/security/securitycenterassessment/zz_controller.go +++ b/internal/controller/security/securitycenterassessment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/security/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SecurityCenterAssessment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_assessment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_assessment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SecurityCenterAssessment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/security/securitycenterassessmentpolicy/zz_controller.go b/internal/controller/security/securitycenterassessmentpolicy/zz_controller.go index 8d3853371..b7cb116eb 100755 --- a/internal/controller/security/securitycenterassessmentpolicy/zz_controller.go +++ b/internal/controller/security/securitycenterassessmentpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/security/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SecurityCenterAssessmentPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterAssessmentPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterAssessmentPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_assessment_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_assessment_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SecurityCenterAssessmentPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/security/securitycenterautoprovisioning/zz_controller.go b/internal/controller/security/securitycenterautoprovisioning/zz_controller.go index 54f85a70c..a25416f76 100755 --- a/internal/controller/security/securitycenterautoprovisioning/zz_controller.go +++ b/internal/controller/security/securitycenterautoprovisioning/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/security/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SecurityCenterAutoProvisioning_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterAutoProvisioning_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterAutoProvisioning_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_auto_provisioning"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_auto_provisioning"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SecurityCenterAutoProvisioning_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/security/securitycentercontact/zz_controller.go b/internal/controller/security/securitycentercontact/zz_controller.go index d4de3a36b..a2e26e41a 100755 --- a/internal/controller/security/securitycentercontact/zz_controller.go +++ b/internal/controller/security/securitycentercontact/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/security/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SecurityCenterContact_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterContact_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterContact_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_contact"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_contact"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SecurityCenterContact_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/security/securitycenterservervulnerabilityassessment/zz_controller.go b/internal/controller/security/securitycenterservervulnerabilityassessment/zz_controller.go index fe50d2028..de1976d61 100755 --- a/internal/controller/security/securitycenterservervulnerabilityassessment/zz_controller.go +++ b/internal/controller/security/securitycenterservervulnerabilityassessment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/security/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SecurityCenterServerVulnerabilityAssessment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterServerVulnerabilityAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterServerVulnerabilityAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_server_vulnerability_assessment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_server_vulnerability_assessment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SecurityCenterServerVulnerabilityAssessment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/security/securitycenterservervulnerabilityassessmentvirtualmachine/zz_controller.go b/internal/controller/security/securitycenterservervulnerabilityassessmentvirtualmachine/zz_controller.go index de0533ab6..37ce66647 100755 --- a/internal/controller/security/securitycenterservervulnerabilityassessmentvirtualmachine/zz_controller.go +++ b/internal/controller/security/securitycenterservervulnerabilityassessmentvirtualmachine/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/security/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SecurityCenterServerVulnerabilityAssessmentVirtualMachine_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterServerVulnerabilityAssessmentVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterServerVulnerabilityAssessmentVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_server_vulnerability_assessment_virtual_machine"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_server_vulnerability_assessment_virtual_machine"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SecurityCenterServerVulnerabilityAssessmentVirtualMachine_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/security/securitycentersetting/zz_controller.go b/internal/controller/security/securitycentersetting/zz_controller.go index ca32134fb..66cbf3579 100755 --- a/internal/controller/security/securitycentersetting/zz_controller.go +++ b/internal/controller/security/securitycentersetting/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/security/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SecurityCenterSetting_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterSetting_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterSetting_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_setting"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_setting"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SecurityCenterSetting_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/security/securitycentersubscriptionpricing/zz_controller.go b/internal/controller/security/securitycentersubscriptionpricing/zz_controller.go index 986325054..6bc8d2ffa 100755 --- a/internal/controller/security/securitycentersubscriptionpricing/zz_controller.go +++ b/internal/controller/security/securitycentersubscriptionpricing/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/security/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SecurityCenterSubscriptionPricing_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterSubscriptionPricing_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterSubscriptionPricing_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_subscription_pricing"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_subscription_pricing"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SecurityCenterSubscriptionPricing_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/security/securitycenterworkspace/zz_controller.go b/internal/controller/security/securitycenterworkspace/zz_controller.go index 7a4d9b337..a9d9ba9b6 100755 --- a/internal/controller/security/securitycenterworkspace/zz_controller.go +++ b/internal/controller/security/securitycenterworkspace/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/security/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SecurityCenterWorkspace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterWorkspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterWorkspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_workspace"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_workspace"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SecurityCenterWorkspace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/securityinsights/sentinelalertrulefusion/zz_controller.go b/internal/controller/securityinsights/sentinelalertrulefusion/zz_controller.go index 1c80ba5ad..f8577cab3 100755 --- a/internal/controller/securityinsights/sentinelalertrulefusion/zz_controller.go +++ b/internal/controller/securityinsights/sentinelalertrulefusion/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/securityinsights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SentinelAlertRuleFusion_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SentinelAlertRuleFusion_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SentinelAlertRuleFusion_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_sentinel_alert_rule_fusion"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_sentinel_alert_rule_fusion"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SentinelAlertRuleFusion_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/securityinsights/sentinelalertrulemachinelearningbehavioranalytics/zz_controller.go b/internal/controller/securityinsights/sentinelalertrulemachinelearningbehavioranalytics/zz_controller.go index 6db00e8ae..ace389690 100755 --- a/internal/controller/securityinsights/sentinelalertrulemachinelearningbehavioranalytics/zz_controller.go +++ b/internal/controller/securityinsights/sentinelalertrulemachinelearningbehavioranalytics/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/securityinsights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SentinelAlertRuleMachineLearningBehaviorAnalytics_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SentinelAlertRuleMachineLearningBehaviorAnalytics_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SentinelAlertRuleMachineLearningBehaviorAnalytics_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_sentinel_alert_rule_machine_learning_behavior_analytics"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_sentinel_alert_rule_machine_learning_behavior_analytics"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SentinelAlertRuleMachineLearningBehaviorAnalytics_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/securityinsights/sentinelalertrulemssecurityincident/zz_controller.go b/internal/controller/securityinsights/sentinelalertrulemssecurityincident/zz_controller.go index 96b17d974..ec89a9d66 100755 --- a/internal/controller/securityinsights/sentinelalertrulemssecurityincident/zz_controller.go +++ b/internal/controller/securityinsights/sentinelalertrulemssecurityincident/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/securityinsights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SentinelAlertRuleMSSecurityIncident_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SentinelAlertRuleMSSecurityIncident_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SentinelAlertRuleMSSecurityIncident_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_sentinel_alert_rule_ms_security_incident"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_sentinel_alert_rule_ms_security_incident"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SentinelAlertRuleMSSecurityIncident_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/securityinsights/sentinelautomationrule/zz_controller.go b/internal/controller/securityinsights/sentinelautomationrule/zz_controller.go index 6db0ed474..32ab60fd1 100755 --- a/internal/controller/securityinsights/sentinelautomationrule/zz_controller.go +++ b/internal/controller/securityinsights/sentinelautomationrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/securityinsights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SentinelAutomationRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SentinelAutomationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SentinelAutomationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_sentinel_automation_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_sentinel_automation_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SentinelAutomationRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/securityinsights/sentineldataconnectoriot/zz_controller.go b/internal/controller/securityinsights/sentineldataconnectoriot/zz_controller.go index 19c521e3a..7fbd7ffa1 100755 --- a/internal/controller/securityinsights/sentineldataconnectoriot/zz_controller.go +++ b/internal/controller/securityinsights/sentineldataconnectoriot/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/securityinsights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SentinelDataConnectorIOT_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SentinelDataConnectorIOT_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SentinelDataConnectorIOT_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_sentinel_data_connector_iot"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_sentinel_data_connector_iot"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SentinelDataConnectorIOT_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/securityinsights/sentinelloganalyticsworkspaceonboarding/zz_controller.go b/internal/controller/securityinsights/sentinelloganalyticsworkspaceonboarding/zz_controller.go index 1420d68a2..88852b32a 100755 --- a/internal/controller/securityinsights/sentinelloganalyticsworkspaceonboarding/zz_controller.go +++ b/internal/controller/securityinsights/sentinelloganalyticsworkspaceonboarding/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/securityinsights/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SentinelLogAnalyticsWorkspaceOnboarding_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SentinelLogAnalyticsWorkspaceOnboarding_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SentinelLogAnalyticsWorkspaceOnboarding_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_sentinel_log_analytics_workspace_onboarding"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_sentinel_log_analytics_workspace_onboarding"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SentinelLogAnalyticsWorkspaceOnboarding_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/securityinsights/sentinelwatchlist/zz_controller.go b/internal/controller/securityinsights/sentinelwatchlist/zz_controller.go index 8d6d40816..7840449ae 100755 --- a/internal/controller/securityinsights/sentinelwatchlist/zz_controller.go +++ b/internal/controller/securityinsights/sentinelwatchlist/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/securityinsights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SentinelWatchlist_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SentinelWatchlist_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SentinelWatchlist_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_sentinel_watchlist"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_sentinel_watchlist"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SentinelWatchlist_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/servicebus/namespaceauthorizationrule/zz_controller.go b/internal/controller/servicebus/namespaceauthorizationrule/zz_controller.go index e4cf78e03..e94a71749 100755 --- a/internal/controller/servicebus/namespaceauthorizationrule/zz_controller.go +++ b/internal/controller/servicebus/namespaceauthorizationrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/servicebus/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NamespaceAuthorizationRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamespaceAuthorizationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamespaceAuthorizationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_namespace_authorization_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_namespace_authorization_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NamespaceAuthorizationRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/servicebus/namespacedisasterrecoveryconfig/zz_controller.go b/internal/controller/servicebus/namespacedisasterrecoveryconfig/zz_controller.go index b1451c4a8..54ea196fb 100755 --- a/internal/controller/servicebus/namespacedisasterrecoveryconfig/zz_controller.go +++ b/internal/controller/servicebus/namespacedisasterrecoveryconfig/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/servicebus/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NamespaceDisasterRecoveryConfig_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamespaceDisasterRecoveryConfig_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamespaceDisasterRecoveryConfig_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_namespace_disaster_recovery_config"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_namespace_disaster_recovery_config"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NamespaceDisasterRecoveryConfig_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/servicebus/namespacenetworkruleset/zz_controller.go b/internal/controller/servicebus/namespacenetworkruleset/zz_controller.go index 4d5fa3954..11483c24d 100755 --- a/internal/controller/servicebus/namespacenetworkruleset/zz_controller.go +++ b/internal/controller/servicebus/namespacenetworkruleset/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/servicebus/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NamespaceNetworkRuleSet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamespaceNetworkRuleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamespaceNetworkRuleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_namespace_network_rule_set"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_namespace_network_rule_set"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NamespaceNetworkRuleSet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/servicebus/queue/zz_controller.go b/internal/controller/servicebus/queue/zz_controller.go index 68d2589d5..c22458adb 100755 --- a/internal/controller/servicebus/queue/zz_controller.go +++ b/internal/controller/servicebus/queue/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/servicebus/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Queue_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Queue_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Queue_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_queue"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_queue"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Queue_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/servicebus/queueauthorizationrule/zz_controller.go b/internal/controller/servicebus/queueauthorizationrule/zz_controller.go index 661cb7aed..a6a393e02 100755 --- a/internal/controller/servicebus/queueauthorizationrule/zz_controller.go +++ b/internal/controller/servicebus/queueauthorizationrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/servicebus/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.QueueAuthorizationRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.QueueAuthorizationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.QueueAuthorizationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_queue_authorization_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_queue_authorization_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.QueueAuthorizationRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/servicebus/servicebusnamespace/zz_controller.go b/internal/controller/servicebus/servicebusnamespace/zz_controller.go index 26a0bce90..661fedf41 100755 --- a/internal/controller/servicebus/servicebusnamespace/zz_controller.go +++ b/internal/controller/servicebus/servicebusnamespace/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/servicebus/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ServiceBusNamespace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ServiceBusNamespace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ServiceBusNamespace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_namespace"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_namespace"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ServiceBusNamespace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/servicebus/subscription/zz_controller.go b/internal/controller/servicebus/subscription/zz_controller.go index ac29cc309..95b275610 100755 --- a/internal/controller/servicebus/subscription/zz_controller.go +++ b/internal/controller/servicebus/subscription/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/servicebus/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Subscription_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Subscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Subscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_subscription"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_subscription"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Subscription_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/servicebus/subscriptionrule/zz_controller.go b/internal/controller/servicebus/subscriptionrule/zz_controller.go index 3d55251f4..6a0436cfe 100755 --- a/internal/controller/servicebus/subscriptionrule/zz_controller.go +++ b/internal/controller/servicebus/subscriptionrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/servicebus/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SubscriptionRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubscriptionRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubscriptionRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_subscription_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_subscription_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SubscriptionRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/servicebus/topic/zz_controller.go b/internal/controller/servicebus/topic/zz_controller.go index 462cd6242..61a072fab 100755 --- a/internal/controller/servicebus/topic/zz_controller.go +++ b/internal/controller/servicebus/topic/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/servicebus/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Topic_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Topic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Topic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_topic"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_topic"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Topic_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/servicebus/topicauthorizationrule/zz_controller.go b/internal/controller/servicebus/topicauthorizationrule/zz_controller.go index 609d9a714..30c85ed04 100755 --- a/internal/controller/servicebus/topicauthorizationrule/zz_controller.go +++ b/internal/controller/servicebus/topicauthorizationrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/servicebus/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.TopicAuthorizationRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TopicAuthorizationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TopicAuthorizationRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_topic_authorization_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_topic_authorization_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.TopicAuthorizationRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/servicefabric/cluster/zz_controller.go b/internal/controller/servicefabric/cluster/zz_controller.go index 33795e921..3b6fda8a2 100755 --- a/internal/controller/servicefabric/cluster/zz_controller.go +++ b/internal/controller/servicefabric/cluster/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/servicefabric/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Cluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Cluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Cluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_service_fabric_cluster"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_service_fabric_cluster"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Cluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/servicefabric/managedcluster/zz_controller.go b/internal/controller/servicefabric/managedcluster/zz_controller.go index 8c1da3d25..54cfc13cb 100755 --- a/internal/controller/servicefabric/managedcluster/zz_controller.go +++ b/internal/controller/servicefabric/managedcluster/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/servicefabric/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagedCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_service_fabric_managed_cluster"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_service_fabric_managed_cluster"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagedCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/servicelinker/springcloudconnection/zz_controller.go b/internal/controller/servicelinker/springcloudconnection/zz_controller.go index 9c416179e..36faa38a2 100755 --- a/internal/controller/servicelinker/springcloudconnection/zz_controller.go +++ b/internal/controller/servicelinker/springcloudconnection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/servicelinker/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/signalrservice/networkacl/zz_controller.go b/internal/controller/signalrservice/networkacl/zz_controller.go index a6c145039..b675d9f77 100755 --- a/internal/controller/signalrservice/networkacl/zz_controller.go +++ b/internal/controller/signalrservice/networkacl/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/signalrservice/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NetworkACL_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NetworkACL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NetworkACL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_signalr_service_network_acl"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_signalr_service_network_acl"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NetworkACL_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/signalrservice/service/zz_controller.go b/internal/controller/signalrservice/service/zz_controller.go index 4f250fb2c..104a9b824 100755 --- a/internal/controller/signalrservice/service/zz_controller.go +++ b/internal/controller/signalrservice/service/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/signalrservice/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Service_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Service_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Service_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_signalr_service"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_signalr_service"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Service_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/signalrservice/signalrsharedprivatelinkresource/zz_controller.go b/internal/controller/signalrservice/signalrsharedprivatelinkresource/zz_controller.go index 4c36840be..6af5a576b 100755 --- a/internal/controller/signalrservice/signalrsharedprivatelinkresource/zz_controller.go +++ b/internal/controller/signalrservice/signalrsharedprivatelinkresource/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/signalrservice/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SignalrSharedPrivateLinkResource_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SignalrSharedPrivateLinkResource_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SignalrSharedPrivateLinkResource_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_signalr_shared_private_link_resource"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_signalr_shared_private_link_resource"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SignalrSharedPrivateLinkResource_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/signalrservice/webpubsub/zz_controller.go b/internal/controller/signalrservice/webpubsub/zz_controller.go index 59f68bbe1..675ba9436 100755 --- a/internal/controller/signalrservice/webpubsub/zz_controller.go +++ b/internal/controller/signalrservice/webpubsub/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/signalrservice/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WebPubsub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WebPubsub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WebPubsub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_web_pubsub"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_web_pubsub"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WebPubsub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/signalrservice/webpubsubhub/zz_controller.go b/internal/controller/signalrservice/webpubsubhub/zz_controller.go index 2f253de7e..2c9cca175 100755 --- a/internal/controller/signalrservice/webpubsubhub/zz_controller.go +++ b/internal/controller/signalrservice/webpubsubhub/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/signalrservice/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WebPubsubHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WebPubsubHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WebPubsubHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_web_pubsub_hub"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_web_pubsub_hub"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WebPubsubHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/signalrservice/webpubsubnetworkacl/zz_controller.go b/internal/controller/signalrservice/webpubsubnetworkacl/zz_controller.go index 051183ea1..c356e4ad3 100755 --- a/internal/controller/signalrservice/webpubsubnetworkacl/zz_controller.go +++ b/internal/controller/signalrservice/webpubsubnetworkacl/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/signalrservice/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WebPubsubNetworkACL_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WebPubsubNetworkACL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WebPubsubNetworkACL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_web_pubsub_network_acl"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_web_pubsub_network_acl"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WebPubsubNetworkACL_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/solutions/managedapplicationdefinition/zz_controller.go b/internal/controller/solutions/managedapplicationdefinition/zz_controller.go index f73f5da68..1a3656fd6 100755 --- a/internal/controller/solutions/managedapplicationdefinition/zz_controller.go +++ b/internal/controller/solutions/managedapplicationdefinition/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/solutions/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagedApplicationDefinition_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedApplicationDefinition_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedApplicationDefinition_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_managed_application_definition"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_managed_application_definition"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagedApplicationDefinition_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/spring/cloudapplicationliveview/zz_controller.go b/internal/controller/spring/cloudapplicationliveview/zz_controller.go index b91ab68e6..e819ccc7e 100755 --- a/internal/controller/spring/cloudapplicationliveview/zz_controller.go +++ b/internal/controller/spring/cloudapplicationliveview/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/spring/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CloudApplicationLiveView_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CloudApplicationLiveView_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CloudApplicationLiveView_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_application_live_view"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_application_live_view"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CloudApplicationLiveView_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqldatabase/zz_controller.go b/internal/controller/sql/mssqldatabase/zz_controller.go index 9e57ed5fb..e01e1ba39 100755 --- a/internal/controller/sql/mssqldatabase/zz_controller.go +++ b/internal/controller/sql/mssqldatabase/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLDatabase_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_database"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_database"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLDatabase_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqldatabaseextendedauditingpolicy/zz_controller.go b/internal/controller/sql/mssqldatabaseextendedauditingpolicy/zz_controller.go index 7d98f7fe6..e3d92f792 100755 --- a/internal/controller/sql/mssqldatabaseextendedauditingpolicy/zz_controller.go +++ b/internal/controller/sql/mssqldatabaseextendedauditingpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLDatabaseExtendedAuditingPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLDatabaseExtendedAuditingPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLDatabaseExtendedAuditingPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_database_extended_auditing_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_database_extended_auditing_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLDatabaseExtendedAuditingPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqldatabasevulnerabilityassessmentrulebaseline/zz_controller.go b/internal/controller/sql/mssqldatabasevulnerabilityassessmentrulebaseline/zz_controller.go index a17152f9c..041251143 100755 --- a/internal/controller/sql/mssqldatabasevulnerabilityassessmentrulebaseline/zz_controller.go +++ b/internal/controller/sql/mssqldatabasevulnerabilityassessmentrulebaseline/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLDatabaseVulnerabilityAssessmentRuleBaseline_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLDatabaseVulnerabilityAssessmentRuleBaseline_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLDatabaseVulnerabilityAssessmentRuleBaseline_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_database_vulnerability_assessment_rule_baseline"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_database_vulnerability_assessment_rule_baseline"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLDatabaseVulnerabilityAssessmentRuleBaseline_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqlelasticpool/zz_controller.go b/internal/controller/sql/mssqlelasticpool/zz_controller.go index 29377e57f..7b30136d8 100755 --- a/internal/controller/sql/mssqlelasticpool/zz_controller.go +++ b/internal/controller/sql/mssqlelasticpool/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLElasticPool_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLElasticPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLElasticPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_elasticpool"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_elasticpool"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLElasticPool_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqlfailovergroup/zz_controller.go b/internal/controller/sql/mssqlfailovergroup/zz_controller.go index f1dc322d2..1b031ba4d 100755 --- a/internal/controller/sql/mssqlfailovergroup/zz_controller.go +++ b/internal/controller/sql/mssqlfailovergroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLFailoverGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLFailoverGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLFailoverGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_failover_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_failover_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLFailoverGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqlfirewallrule/zz_controller.go b/internal/controller/sql/mssqlfirewallrule/zz_controller.go index e66e2388f..38e7bb73b 100755 --- a/internal/controller/sql/mssqlfirewallrule/zz_controller.go +++ b/internal/controller/sql/mssqlfirewallrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLFirewallRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLFirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLFirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_firewall_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_firewall_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLFirewallRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqljobagent/zz_controller.go b/internal/controller/sql/mssqljobagent/zz_controller.go index e65e5f43e..179492014 100755 --- a/internal/controller/sql/mssqljobagent/zz_controller.go +++ b/internal/controller/sql/mssqljobagent/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLJobAgent_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLJobAgent_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLJobAgent_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_job_agent"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_job_agent"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLJobAgent_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqljobcredential/zz_controller.go b/internal/controller/sql/mssqljobcredential/zz_controller.go index eebf5f875..1b0d99257 100755 --- a/internal/controller/sql/mssqljobcredential/zz_controller.go +++ b/internal/controller/sql/mssqljobcredential/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLJobCredential_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLJobCredential_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLJobCredential_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_job_credential"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_job_credential"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLJobCredential_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqlmanageddatabase/zz_controller.go b/internal/controller/sql/mssqlmanageddatabase/zz_controller.go index 3a228390c..767b2b96a 100755 --- a/internal/controller/sql/mssqlmanageddatabase/zz_controller.go +++ b/internal/controller/sql/mssqlmanageddatabase/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLManagedDatabase_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_managed_database"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_managed_database"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLManagedDatabase_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqlmanagedinstance/zz_controller.go b/internal/controller/sql/mssqlmanagedinstance/zz_controller.go index c38282014..a0d67f655 100755 --- a/internal/controller/sql/mssqlmanagedinstance/zz_controller.go +++ b/internal/controller/sql/mssqlmanagedinstance/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLManagedInstance_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedInstance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedInstance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_managed_instance"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_managed_instance"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLManagedInstance_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqlmanagedinstanceactivedirectoryadministrator/zz_controller.go b/internal/controller/sql/mssqlmanagedinstanceactivedirectoryadministrator/zz_controller.go index 2adfddb49..131dc5efe 100755 --- a/internal/controller/sql/mssqlmanagedinstanceactivedirectoryadministrator/zz_controller.go +++ b/internal/controller/sql/mssqlmanagedinstanceactivedirectoryadministrator/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLManagedInstanceActiveDirectoryAdministrator_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedInstanceActiveDirectoryAdministrator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedInstanceActiveDirectoryAdministrator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_managed_instance_active_directory_administrator"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_managed_instance_active_directory_administrator"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLManagedInstanceActiveDirectoryAdministrator_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqlmanagedinstancefailovergroup/zz_controller.go b/internal/controller/sql/mssqlmanagedinstancefailovergroup/zz_controller.go index ef06765d5..c70f4f4f3 100755 --- a/internal/controller/sql/mssqlmanagedinstancefailovergroup/zz_controller.go +++ b/internal/controller/sql/mssqlmanagedinstancefailovergroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLManagedInstanceFailoverGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedInstanceFailoverGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedInstanceFailoverGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_managed_instance_failover_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_managed_instance_failover_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLManagedInstanceFailoverGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqlmanagedinstancevulnerabilityassessment/zz_controller.go b/internal/controller/sql/mssqlmanagedinstancevulnerabilityassessment/zz_controller.go index e6ee95b12..cbda0b1b0 100755 --- a/internal/controller/sql/mssqlmanagedinstancevulnerabilityassessment/zz_controller.go +++ b/internal/controller/sql/mssqlmanagedinstancevulnerabilityassessment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLManagedInstanceVulnerabilityAssessment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedInstanceVulnerabilityAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedInstanceVulnerabilityAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_managed_instance_vulnerability_assessment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_managed_instance_vulnerability_assessment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLManagedInstanceVulnerabilityAssessment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqloutboundfirewallrule/zz_controller.go b/internal/controller/sql/mssqloutboundfirewallrule/zz_controller.go index e4de9e98a..2d2b8cccc 100755 --- a/internal/controller/sql/mssqloutboundfirewallrule/zz_controller.go +++ b/internal/controller/sql/mssqloutboundfirewallrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLOutboundFirewallRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLOutboundFirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLOutboundFirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_outbound_firewall_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_outbound_firewall_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLOutboundFirewallRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqlserver/zz_controller.go b/internal/controller/sql/mssqlserver/zz_controller.go index f40bb18e7..9f870c3e5 100755 --- a/internal/controller/sql/mssqlserver/zz_controller.go +++ b/internal/controller/sql/mssqlserver/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLServer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_server"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_server"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLServer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqlserverdnsalias/zz_controller.go b/internal/controller/sql/mssqlserverdnsalias/zz_controller.go index b42cee0d6..1ba2ca60a 100755 --- a/internal/controller/sql/mssqlserverdnsalias/zz_controller.go +++ b/internal/controller/sql/mssqlserverdnsalias/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLServerDNSAlias_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLServerDNSAlias_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLServerDNSAlias_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_server_dns_alias"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_server_dns_alias"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLServerDNSAlias_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqlservermicrosoftsupportauditingpolicy/zz_controller.go b/internal/controller/sql/mssqlservermicrosoftsupportauditingpolicy/zz_controller.go index c5c350ddb..25fe17ec2 100755 --- a/internal/controller/sql/mssqlservermicrosoftsupportauditingpolicy/zz_controller.go +++ b/internal/controller/sql/mssqlservermicrosoftsupportauditingpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLServerMicrosoftSupportAuditingPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLServerMicrosoftSupportAuditingPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLServerMicrosoftSupportAuditingPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_server_microsoft_support_auditing_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_server_microsoft_support_auditing_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLServerMicrosoftSupportAuditingPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqlserversecurityalertpolicy/zz_controller.go b/internal/controller/sql/mssqlserversecurityalertpolicy/zz_controller.go index 7496dad1e..b0cbd3ae7 100755 --- a/internal/controller/sql/mssqlserversecurityalertpolicy/zz_controller.go +++ b/internal/controller/sql/mssqlserversecurityalertpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLServerSecurityAlertPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLServerSecurityAlertPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLServerSecurityAlertPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_server_security_alert_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_server_security_alert_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLServerSecurityAlertPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqlservertransparentdataencryption/zz_controller.go b/internal/controller/sql/mssqlservertransparentdataencryption/zz_controller.go index 83f79b828..b3bf5b91d 100755 --- a/internal/controller/sql/mssqlservertransparentdataencryption/zz_controller.go +++ b/internal/controller/sql/mssqlservertransparentdataencryption/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLServerTransparentDataEncryption_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLServerTransparentDataEncryption_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_server_transparent_data_encryption"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_server_transparent_data_encryption"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLServerTransparentDataEncryption_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqlservervulnerabilityassessment/zz_controller.go b/internal/controller/sql/mssqlservervulnerabilityassessment/zz_controller.go index 1875276f3..f31fe551a 100755 --- a/internal/controller/sql/mssqlservervulnerabilityassessment/zz_controller.go +++ b/internal/controller/sql/mssqlservervulnerabilityassessment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLServerVulnerabilityAssessment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLServerVulnerabilityAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLServerVulnerabilityAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_server_vulnerability_assessment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_server_vulnerability_assessment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLServerVulnerabilityAssessment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/sql/mssqlvirtualnetworkrule/zz_controller.go b/internal/controller/sql/mssqlvirtualnetworkrule/zz_controller.go index 1c08eb53c..6a9608271 100755 --- a/internal/controller/sql/mssqlvirtualnetworkrule/zz_controller.go +++ b/internal/controller/sql/mssqlvirtualnetworkrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLVirtualNetworkRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLVirtualNetworkRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLVirtualNetworkRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_virtual_network_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_virtual_network_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLVirtualNetworkRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storage/account/zz_controller.go b/internal/controller/storage/account/zz_controller.go index 2728985e1..3c3b643c2 100755 --- a/internal/controller/storage/account/zz_controller.go +++ b/internal/controller/storage/account/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Account_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_account"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_account"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Account_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storage/accountlocaluser/zz_controller.go b/internal/controller/storage/accountlocaluser/zz_controller.go index f1544a3b4..c447866a9 100755 --- a/internal/controller/storage/accountlocaluser/zz_controller.go +++ b/internal/controller/storage/accountlocaluser/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AccountLocalUser_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AccountLocalUser_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AccountLocalUser_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_account_local_user"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_account_local_user"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AccountLocalUser_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storage/accountnetworkrules/zz_controller.go b/internal/controller/storage/accountnetworkrules/zz_controller.go index 278d7fed0..b6e2f8227 100755 --- a/internal/controller/storage/accountnetworkrules/zz_controller.go +++ b/internal/controller/storage/accountnetworkrules/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AccountNetworkRules_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AccountNetworkRules_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AccountNetworkRules_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_account_network_rules"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_account_network_rules"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AccountNetworkRules_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storage/blob/zz_controller.go b/internal/controller/storage/blob/zz_controller.go index 150bbd235..1489d82ae 100755 --- a/internal/controller/storage/blob/zz_controller.go +++ b/internal/controller/storage/blob/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Blob_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Blob_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Blob_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_blob"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_blob"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Blob_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storage/blobinventorypolicy/zz_controller.go b/internal/controller/storage/blobinventorypolicy/zz_controller.go index 38041fffe..7c3b407d6 100755 --- a/internal/controller/storage/blobinventorypolicy/zz_controller.go +++ b/internal/controller/storage/blobinventorypolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" @@ -31,20 +31,23 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1beta1.BlobInventoryPolicy_GroupVersionKind.String()) var initializers managed.InitializerChain - initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BlobInventoryPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BlobInventoryPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BlobInventoryPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_blob_inventory_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_blob_inventory_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BlobInventoryPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storage/container/zz_controller.go b/internal/controller/storage/container/zz_controller.go index b9350dee4..244518eda 100755 --- a/internal/controller/storage/container/zz_controller.go +++ b/internal/controller/storage/container/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Container_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Container_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Container_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_container"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_container"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Container_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storage/datalakegen2filesystem/zz_controller.go b/internal/controller/storage/datalakegen2filesystem/zz_controller.go index 2d39e026e..b45568258 100755 --- a/internal/controller/storage/datalakegen2filesystem/zz_controller.go +++ b/internal/controller/storage/datalakegen2filesystem/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataLakeGen2FileSystem_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataLakeGen2FileSystem_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataLakeGen2FileSystem_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_data_lake_gen2_filesystem"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_data_lake_gen2_filesystem"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataLakeGen2FileSystem_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storage/datalakegen2path/zz_controller.go b/internal/controller/storage/datalakegen2path/zz_controller.go index 2039f85f5..219ed5257 100755 --- a/internal/controller/storage/datalakegen2path/zz_controller.go +++ b/internal/controller/storage/datalakegen2path/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataLakeGen2Path_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataLakeGen2Path_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataLakeGen2Path_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_data_lake_gen2_path"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_data_lake_gen2_path"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataLakeGen2Path_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storage/encryptionscope/zz_controller.go b/internal/controller/storage/encryptionscope/zz_controller.go index 192e9148a..48fcce8e8 100755 --- a/internal/controller/storage/encryptionscope/zz_controller.go +++ b/internal/controller/storage/encryptionscope/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.EncryptionScope_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EncryptionScope_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EncryptionScope_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_encryption_scope"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_encryption_scope"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.EncryptionScope_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storage/managementpolicy/zz_controller.go b/internal/controller/storage/managementpolicy/zz_controller.go index 2766eb622..ea2b13e7a 100755 --- a/internal/controller/storage/managementpolicy/zz_controller.go +++ b/internal/controller/storage/managementpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagementPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagementPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagementPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_management_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_management_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagementPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storage/objectreplication/zz_controller.go b/internal/controller/storage/objectreplication/zz_controller.go index eb2036700..6ef756b54 100755 --- a/internal/controller/storage/objectreplication/zz_controller.go +++ b/internal/controller/storage/objectreplication/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ObjectReplication_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ObjectReplication_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ObjectReplication_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_object_replication"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_object_replication"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ObjectReplication_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storage/queue/zz_controller.go b/internal/controller/storage/queue/zz_controller.go index 88a503aca..94a874e98 100755 --- a/internal/controller/storage/queue/zz_controller.go +++ b/internal/controller/storage/queue/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Queue_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Queue_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Queue_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_queue"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_queue"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Queue_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storage/share/zz_controller.go b/internal/controller/storage/share/zz_controller.go index 114e9977b..552dbb426 100755 --- a/internal/controller/storage/share/zz_controller.go +++ b/internal/controller/storage/share/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Share_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Share_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Share_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_share"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_share"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Share_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storage/sharedirectory/zz_controller.go b/internal/controller/storage/sharedirectory/zz_controller.go index 2b090f179..2378f545d 100755 --- a/internal/controller/storage/sharedirectory/zz_controller.go +++ b/internal/controller/storage/sharedirectory/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ShareDirectory_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ShareDirectory_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ShareDirectory_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_share_directory"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_share_directory"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ShareDirectory_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storage/table/zz_controller.go b/internal/controller/storage/table/zz_controller.go index 759f858a9..02b59c6ab 100755 --- a/internal/controller/storage/table/zz_controller.go +++ b/internal/controller/storage/table/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Table_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Table_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Table_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_table"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_table"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Table_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storage/tableentity/zz_controller.go b/internal/controller/storage/tableentity/zz_controller.go index e74ac5171..17c16593c 100755 --- a/internal/controller/storage/tableentity/zz_controller.go +++ b/internal/controller/storage/tableentity/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.TableEntity_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TableEntity_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TableEntity_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_table_entity"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_table_entity"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.TableEntity_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storagecache/hpccache/zz_controller.go b/internal/controller/storagecache/hpccache/zz_controller.go index 3d4312c24..38b7e592a 100755 --- a/internal/controller/storagecache/hpccache/zz_controller.go +++ b/internal/controller/storagecache/hpccache/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storagecache/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HPCCache_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HPCCache_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HPCCache_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_hpc_cache"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_hpc_cache"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HPCCache_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storagecache/hpccacheaccesspolicy/zz_controller.go b/internal/controller/storagecache/hpccacheaccesspolicy/zz_controller.go index 3f561f23f..e8a2aa29e 100755 --- a/internal/controller/storagecache/hpccacheaccesspolicy/zz_controller.go +++ b/internal/controller/storagecache/hpccacheaccesspolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storagecache/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HPCCacheAccessPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HPCCacheAccessPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HPCCacheAccessPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_hpc_cache_access_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_hpc_cache_access_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HPCCacheAccessPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storagecache/hpccacheblobnfstarget/zz_controller.go b/internal/controller/storagecache/hpccacheblobnfstarget/zz_controller.go index 77e359ebe..9b53cfa5a 100755 --- a/internal/controller/storagecache/hpccacheblobnfstarget/zz_controller.go +++ b/internal/controller/storagecache/hpccacheblobnfstarget/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storagecache/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HPCCacheBlobNFSTarget_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HPCCacheBlobNFSTarget_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HPCCacheBlobNFSTarget_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_hpc_cache_blob_nfs_target"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_hpc_cache_blob_nfs_target"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HPCCacheBlobNFSTarget_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storagecache/hpccacheblobtarget/zz_controller.go b/internal/controller/storagecache/hpccacheblobtarget/zz_controller.go index fa8f82eba..6d1775d9c 100755 --- a/internal/controller/storagecache/hpccacheblobtarget/zz_controller.go +++ b/internal/controller/storagecache/hpccacheblobtarget/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storagecache/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HPCCacheBlobTarget_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HPCCacheBlobTarget_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HPCCacheBlobTarget_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_hpc_cache_blob_target"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_hpc_cache_blob_target"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HPCCacheBlobTarget_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storagecache/hpccachenfstarget/zz_controller.go b/internal/controller/storagecache/hpccachenfstarget/zz_controller.go index 318322220..586fc934d 100755 --- a/internal/controller/storagecache/hpccachenfstarget/zz_controller.go +++ b/internal/controller/storagecache/hpccachenfstarget/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storagecache/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HPCCacheNFSTarget_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HPCCacheNFSTarget_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HPCCacheNFSTarget_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_hpc_cache_nfs_target"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_hpc_cache_nfs_target"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HPCCacheNFSTarget_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storagepool/diskpool/zz_controller.go b/internal/controller/storagepool/diskpool/zz_controller.go index 9cd023a5a..12e7d5705 100755 --- a/internal/controller/storagepool/diskpool/zz_controller.go +++ b/internal/controller/storagepool/diskpool/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storagepool/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DiskPool_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DiskPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DiskPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_disk_pool"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_disk_pool"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DiskPool_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/storagesync/storagesync/zz_controller.go b/internal/controller/storagesync/storagesync/zz_controller.go index 2b9435209..31b450f69 100755 --- a/internal/controller/storagesync/storagesync/zz_controller.go +++ b/internal/controller/storagesync/storagesync/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/storagesync/v1beta1" @@ -37,11 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.StorageSync_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StorageSync_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_storage_sync"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler))), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_sync"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.StorageSync_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/cluster/zz_controller.go b/internal/controller/streamanalytics/cluster/zz_controller.go index fa998605e..1410d4f80 100755 --- a/internal/controller/streamanalytics/cluster/zz_controller.go +++ b/internal/controller/streamanalytics/cluster/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Cluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Cluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Cluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_cluster"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_cluster"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Cluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/functionjavascriptuda/zz_controller.go b/internal/controller/streamanalytics/functionjavascriptuda/zz_controller.go index 1d0a80c6b..784684d3f 100755 --- a/internal/controller/streamanalytics/functionjavascriptuda/zz_controller.go +++ b/internal/controller/streamanalytics/functionjavascriptuda/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FunctionJavascriptUda_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FunctionJavascriptUda_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FunctionJavascriptUda_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_function_javascript_uda"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_function_javascript_uda"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FunctionJavascriptUda_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/job/zz_controller.go b/internal/controller/streamanalytics/job/zz_controller.go index 3e01cff59..bbb13d646 100755 --- a/internal/controller/streamanalytics/job/zz_controller.go +++ b/internal/controller/streamanalytics/job/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Job_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Job_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Job_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_job"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_job"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Job_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/managedprivateendpoint/zz_controller.go b/internal/controller/streamanalytics/managedprivateendpoint/zz_controller.go index c115024e6..ac29c9fed 100755 --- a/internal/controller/streamanalytics/managedprivateendpoint/zz_controller.go +++ b/internal/controller/streamanalytics/managedprivateendpoint/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagedPrivateEndpoint_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedPrivateEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedPrivateEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_managed_private_endpoint"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_managed_private_endpoint"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagedPrivateEndpoint_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/outputblob/zz_controller.go b/internal/controller/streamanalytics/outputblob/zz_controller.go index afe9ed39f..5478a1424 100755 --- a/internal/controller/streamanalytics/outputblob/zz_controller.go +++ b/internal/controller/streamanalytics/outputblob/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.OutputBlob_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputBlob_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputBlob_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_blob"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_blob"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.OutputBlob_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/outputeventhub/zz_controller.go b/internal/controller/streamanalytics/outputeventhub/zz_controller.go index b65379256..6962baef4 100755 --- a/internal/controller/streamanalytics/outputeventhub/zz_controller.go +++ b/internal/controller/streamanalytics/outputeventhub/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.OutputEventHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputEventHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputEventHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_eventhub"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_eventhub"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.OutputEventHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/outputfunction/zz_controller.go b/internal/controller/streamanalytics/outputfunction/zz_controller.go index dc1e99c87..936b13c94 100755 --- a/internal/controller/streamanalytics/outputfunction/zz_controller.go +++ b/internal/controller/streamanalytics/outputfunction/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.OutputFunction_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputFunction_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputFunction_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_function"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_function"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.OutputFunction_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/outputmssql/zz_controller.go b/internal/controller/streamanalytics/outputmssql/zz_controller.go index cd6985d8b..8e7ca75ca 100755 --- a/internal/controller/streamanalytics/outputmssql/zz_controller.go +++ b/internal/controller/streamanalytics/outputmssql/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.OutputMSSQL_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputMSSQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputMSSQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_mssql"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_mssql"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.OutputMSSQL_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/outputpowerbi/zz_controller.go b/internal/controller/streamanalytics/outputpowerbi/zz_controller.go index b5b27546e..ce75fb9f0 100755 --- a/internal/controller/streamanalytics/outputpowerbi/zz_controller.go +++ b/internal/controller/streamanalytics/outputpowerbi/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.OutputPowerBI_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputPowerBI_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputPowerBI_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_powerbi"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_powerbi"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.OutputPowerBI_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/outputservicebusqueue/zz_controller.go b/internal/controller/streamanalytics/outputservicebusqueue/zz_controller.go index ea4808d7e..a6f1da8bc 100755 --- a/internal/controller/streamanalytics/outputservicebusqueue/zz_controller.go +++ b/internal/controller/streamanalytics/outputservicebusqueue/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.OutputServiceBusQueue_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputServiceBusQueue_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputServiceBusQueue_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_servicebus_queue"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_servicebus_queue"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.OutputServiceBusQueue_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/outputservicebustopic/zz_controller.go b/internal/controller/streamanalytics/outputservicebustopic/zz_controller.go index bda279fe9..bd1db46f6 100755 --- a/internal/controller/streamanalytics/outputservicebustopic/zz_controller.go +++ b/internal/controller/streamanalytics/outputservicebustopic/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.OutputServiceBusTopic_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputServiceBusTopic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputServiceBusTopic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_servicebus_topic"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_servicebus_topic"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.OutputServiceBusTopic_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/outputsynapse/zz_controller.go b/internal/controller/streamanalytics/outputsynapse/zz_controller.go index da7edf3f9..70dcdb713 100755 --- a/internal/controller/streamanalytics/outputsynapse/zz_controller.go +++ b/internal/controller/streamanalytics/outputsynapse/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.OutputSynapse_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputSynapse_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputSynapse_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_synapse"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_synapse"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.OutputSynapse_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/outputtable/zz_controller.go b/internal/controller/streamanalytics/outputtable/zz_controller.go index 07b5c341e..235f8e786 100755 --- a/internal/controller/streamanalytics/outputtable/zz_controller.go +++ b/internal/controller/streamanalytics/outputtable/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.OutputTable_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputTable_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputTable_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_table"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_table"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.OutputTable_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/referenceinputblob/zz_controller.go b/internal/controller/streamanalytics/referenceinputblob/zz_controller.go index fddb9fd6c..3310c715e 100755 --- a/internal/controller/streamanalytics/referenceinputblob/zz_controller.go +++ b/internal/controller/streamanalytics/referenceinputblob/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ReferenceInputBlob_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ReferenceInputBlob_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ReferenceInputBlob_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_reference_input_blob"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_reference_input_blob"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ReferenceInputBlob_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/referenceinputmssql/zz_controller.go b/internal/controller/streamanalytics/referenceinputmssql/zz_controller.go index 3f6f947c8..73b1572ce 100755 --- a/internal/controller/streamanalytics/referenceinputmssql/zz_controller.go +++ b/internal/controller/streamanalytics/referenceinputmssql/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ReferenceInputMSSQL_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ReferenceInputMSSQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ReferenceInputMSSQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_reference_input_mssql"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_reference_input_mssql"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ReferenceInputMSSQL_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/streaminputblob/zz_controller.go b/internal/controller/streamanalytics/streaminputblob/zz_controller.go index 64ac75ea9..ac4b411bc 100755 --- a/internal/controller/streamanalytics/streaminputblob/zz_controller.go +++ b/internal/controller/streamanalytics/streaminputblob/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.StreamInputBlob_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamInputBlob_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamInputBlob_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_stream_input_blob"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_stream_input_blob"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.StreamInputBlob_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/streaminputeventhub/zz_controller.go b/internal/controller/streamanalytics/streaminputeventhub/zz_controller.go index 49fecea9c..a12ea0292 100755 --- a/internal/controller/streamanalytics/streaminputeventhub/zz_controller.go +++ b/internal/controller/streamanalytics/streaminputeventhub/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.StreamInputEventHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamInputEventHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamInputEventHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_stream_input_eventhub"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_stream_input_eventhub"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.StreamInputEventHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/streamanalytics/streaminputiothub/zz_controller.go b/internal/controller/streamanalytics/streaminputiothub/zz_controller.go index 277e23574..56e01dc78 100755 --- a/internal/controller/streamanalytics/streaminputiothub/zz_controller.go +++ b/internal/controller/streamanalytics/streaminputiothub/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.StreamInputIOTHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamInputIOTHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamInputIOTHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_stream_input_iothub"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_stream_input_iothub"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.StreamInputIOTHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/firewallrule/zz_controller.go b/internal/controller/synapse/firewallrule/zz_controller.go index bf43f288b..6d13fdfdc 100755 --- a/internal/controller/synapse/firewallrule/zz_controller.go +++ b/internal/controller/synapse/firewallrule/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FirewallRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_firewall_rule"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_firewall_rule"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FirewallRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/integrationruntimeazure/zz_controller.go b/internal/controller/synapse/integrationruntimeazure/zz_controller.go index 6770d0a45..4ffaa7df6 100755 --- a/internal/controller/synapse/integrationruntimeazure/zz_controller.go +++ b/internal/controller/synapse/integrationruntimeazure/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IntegrationRuntimeAzure_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IntegrationRuntimeAzure_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IntegrationRuntimeAzure_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_integration_runtime_azure"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_integration_runtime_azure"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IntegrationRuntimeAzure_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/integrationruntimeselfhosted/zz_controller.go b/internal/controller/synapse/integrationruntimeselfhosted/zz_controller.go index bc470c5f6..de6e1de74 100755 --- a/internal/controller/synapse/integrationruntimeselfhosted/zz_controller.go +++ b/internal/controller/synapse/integrationruntimeselfhosted/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IntegrationRuntimeSelfHosted_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IntegrationRuntimeSelfHosted_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IntegrationRuntimeSelfHosted_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_integration_runtime_self_hosted"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_integration_runtime_self_hosted"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IntegrationRuntimeSelfHosted_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/linkedservice/zz_controller.go b/internal/controller/synapse/linkedservice/zz_controller.go index 42a8db6aa..6a48e71c1 100755 --- a/internal/controller/synapse/linkedservice/zz_controller.go +++ b/internal/controller/synapse/linkedservice/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_linked_service"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_linked_service"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/managedprivateendpoint/zz_controller.go b/internal/controller/synapse/managedprivateendpoint/zz_controller.go index 8953e685f..be17e7cbe 100755 --- a/internal/controller/synapse/managedprivateendpoint/zz_controller.go +++ b/internal/controller/synapse/managedprivateendpoint/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagedPrivateEndpoint_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedPrivateEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedPrivateEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_managed_private_endpoint"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_managed_private_endpoint"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagedPrivateEndpoint_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/privatelinkhub/zz_controller.go b/internal/controller/synapse/privatelinkhub/zz_controller.go index 3948b3871..1e0dd87c0 100755 --- a/internal/controller/synapse/privatelinkhub/zz_controller.go +++ b/internal/controller/synapse/privatelinkhub/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PrivateLinkHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateLinkHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateLinkHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_private_link_hub"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_private_link_hub"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PrivateLinkHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/roleassignment/zz_controller.go b/internal/controller/synapse/roleassignment/zz_controller.go index 4b1a3ee62..9eae72d45 100755 --- a/internal/controller/synapse/roleassignment/zz_controller.go +++ b/internal/controller/synapse/roleassignment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RoleAssignment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RoleAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RoleAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_role_assignment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_role_assignment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RoleAssignment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/sparkpool/zz_controller.go b/internal/controller/synapse/sparkpool/zz_controller.go index 401896f6f..642916334 100755 --- a/internal/controller/synapse/sparkpool/zz_controller.go +++ b/internal/controller/synapse/sparkpool/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SparkPool_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SparkPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SparkPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_spark_pool"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_spark_pool"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SparkPool_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/sqlpool/zz_controller.go b/internal/controller/synapse/sqlpool/zz_controller.go index 33fbaeeff..cf73675c5 100755 --- a/internal/controller/synapse/sqlpool/zz_controller.go +++ b/internal/controller/synapse/sqlpool/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SQLPool_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_sql_pool"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_sql_pool"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SQLPool_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/sqlpoolextendedauditingpolicy/zz_controller.go b/internal/controller/synapse/sqlpoolextendedauditingpolicy/zz_controller.go index 0e25d8677..2f0622ad4 100755 --- a/internal/controller/synapse/sqlpoolextendedauditingpolicy/zz_controller.go +++ b/internal/controller/synapse/sqlpoolextendedauditingpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SQLPoolExtendedAuditingPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLPoolExtendedAuditingPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLPoolExtendedAuditingPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_sql_pool_extended_auditing_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_sql_pool_extended_auditing_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SQLPoolExtendedAuditingPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/sqlpoolsecurityalertpolicy/zz_controller.go b/internal/controller/synapse/sqlpoolsecurityalertpolicy/zz_controller.go index 754cba18b..bbd0e50fa 100755 --- a/internal/controller/synapse/sqlpoolsecurityalertpolicy/zz_controller.go +++ b/internal/controller/synapse/sqlpoolsecurityalertpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SQLPoolSecurityAlertPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLPoolSecurityAlertPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLPoolSecurityAlertPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_sql_pool_security_alert_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_sql_pool_security_alert_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SQLPoolSecurityAlertPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/sqlpoolworkloadclassifier/zz_controller.go b/internal/controller/synapse/sqlpoolworkloadclassifier/zz_controller.go index f0dc7e83c..127d76cf8 100755 --- a/internal/controller/synapse/sqlpoolworkloadclassifier/zz_controller.go +++ b/internal/controller/synapse/sqlpoolworkloadclassifier/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SQLPoolWorkloadClassifier_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLPoolWorkloadClassifier_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLPoolWorkloadClassifier_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_sql_pool_workload_classifier"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_sql_pool_workload_classifier"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SQLPoolWorkloadClassifier_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/sqlpoolworkloadgroup/zz_controller.go b/internal/controller/synapse/sqlpoolworkloadgroup/zz_controller.go index 267f2d69b..7fb69975a 100755 --- a/internal/controller/synapse/sqlpoolworkloadgroup/zz_controller.go +++ b/internal/controller/synapse/sqlpoolworkloadgroup/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SQLPoolWorkloadGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLPoolWorkloadGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLPoolWorkloadGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_sql_pool_workload_group"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_sql_pool_workload_group"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SQLPoolWorkloadGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/workspace/zz_controller.go b/internal/controller/synapse/workspace/zz_controller.go index c10046415..6460f7da1 100755 --- a/internal/controller/synapse/workspace/zz_controller.go +++ b/internal/controller/synapse/workspace/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Workspace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Workspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Workspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_workspace"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_workspace"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Workspace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/workspaceaadadmin/zz_controller.go b/internal/controller/synapse/workspaceaadadmin/zz_controller.go index fb86cd81a..82530a276 100755 --- a/internal/controller/synapse/workspaceaadadmin/zz_controller.go +++ b/internal/controller/synapse/workspaceaadadmin/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WorkspaceAADAdmin_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WorkspaceAADAdmin_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WorkspaceAADAdmin_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_workspace_aad_admin"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_workspace_aad_admin"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WorkspaceAADAdmin_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/workspaceextendedauditingpolicy/zz_controller.go b/internal/controller/synapse/workspaceextendedauditingpolicy/zz_controller.go index 773127b0e..da0f5502c 100755 --- a/internal/controller/synapse/workspaceextendedauditingpolicy/zz_controller.go +++ b/internal/controller/synapse/workspaceextendedauditingpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WorkspaceExtendedAuditingPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WorkspaceExtendedAuditingPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WorkspaceExtendedAuditingPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_workspace_extended_auditing_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_workspace_extended_auditing_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WorkspaceExtendedAuditingPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/workspacesecurityalertpolicy/zz_controller.go b/internal/controller/synapse/workspacesecurityalertpolicy/zz_controller.go index 988c08f5f..6ea31fdc2 100755 --- a/internal/controller/synapse/workspacesecurityalertpolicy/zz_controller.go +++ b/internal/controller/synapse/workspacesecurityalertpolicy/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WorkspaceSecurityAlertPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WorkspaceSecurityAlertPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WorkspaceSecurityAlertPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_workspace_security_alert_policy"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_workspace_security_alert_policy"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WorkspaceSecurityAlertPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/workspacesqlaadadmin/zz_controller.go b/internal/controller/synapse/workspacesqlaadadmin/zz_controller.go index 81b9f136d..7ea3294db 100755 --- a/internal/controller/synapse/workspacesqlaadadmin/zz_controller.go +++ b/internal/controller/synapse/workspacesqlaadadmin/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WorkspaceSQLAADAdmin_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WorkspaceSQLAADAdmin_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WorkspaceSQLAADAdmin_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_workspace_sql_aad_admin"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_workspace_sql_aad_admin"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WorkspaceSQLAADAdmin_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/synapse/workspacevulnerabilityassessment/zz_controller.go b/internal/controller/synapse/workspacevulnerabilityassessment/zz_controller.go index 06136f18e..c472d0b48 100755 --- a/internal/controller/synapse/workspacevulnerabilityassessment/zz_controller.go +++ b/internal/controller/synapse/workspacevulnerabilityassessment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WorkspaceVulnerabilityAssessment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WorkspaceVulnerabilityAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WorkspaceVulnerabilityAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_workspace_vulnerability_assessment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_workspace_vulnerability_assessment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WorkspaceVulnerabilityAssessment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/timeseriesinsights/eventsourceeventhub/zz_controller.go b/internal/controller/timeseriesinsights/eventsourceeventhub/zz_controller.go index ee1312bca..d9c387106 100755 --- a/internal/controller/timeseriesinsights/eventsourceeventhub/zz_controller.go +++ b/internal/controller/timeseriesinsights/eventsourceeventhub/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/timeseriesinsights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.EventSourceEventHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventSourceEventHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventSourceEventHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iot_time_series_insights_event_source_eventhub"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iot_time_series_insights_event_source_eventhub"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.EventSourceEventHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/timeseriesinsights/eventsourceiothub/zz_controller.go b/internal/controller/timeseriesinsights/eventsourceiothub/zz_controller.go index aa3462c1b..7be2c231e 100755 --- a/internal/controller/timeseriesinsights/eventsourceiothub/zz_controller.go +++ b/internal/controller/timeseriesinsights/eventsourceiothub/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/timeseriesinsights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.EventSourceIOTHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventSourceIOTHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventSourceIOTHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iot_time_series_insights_event_source_iothub"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iot_time_series_insights_event_source_iothub"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.EventSourceIOTHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/timeseriesinsights/gen2environment/zz_controller.go b/internal/controller/timeseriesinsights/gen2environment/zz_controller.go index 65aa28eef..57546d91d 100755 --- a/internal/controller/timeseriesinsights/gen2environment/zz_controller.go +++ b/internal/controller/timeseriesinsights/gen2environment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/timeseriesinsights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Gen2Environment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Gen2Environment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Gen2Environment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iot_time_series_insights_gen2_environment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iot_time_series_insights_gen2_environment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Gen2Environment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/timeseriesinsights/referencedataset/zz_controller.go b/internal/controller/timeseriesinsights/referencedataset/zz_controller.go index ccba5c1ae..91500e7d9 100755 --- a/internal/controller/timeseriesinsights/referencedataset/zz_controller.go +++ b/internal/controller/timeseriesinsights/referencedataset/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/timeseriesinsights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ReferenceDataSet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ReferenceDataSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ReferenceDataSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iot_time_series_insights_reference_data_set"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iot_time_series_insights_reference_data_set"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ReferenceDataSet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/timeseriesinsights/standardenvironment/zz_controller.go b/internal/controller/timeseriesinsights/standardenvironment/zz_controller.go index 8d12d2bfd..9ab4c3174 100755 --- a/internal/controller/timeseriesinsights/standardenvironment/zz_controller.go +++ b/internal/controller/timeseriesinsights/standardenvironment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/timeseriesinsights/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.StandardEnvironment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StandardEnvironment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StandardEnvironment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_iot_time_series_insights_standard_environment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iot_time_series_insights_standard_environment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.StandardEnvironment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/appactiveslot/zz_controller.go b/internal/controller/web/appactiveslot/zz_controller.go index 6af33d109..a70691a40 100755 --- a/internal/controller/web/appactiveslot/zz_controller.go +++ b/internal/controller/web/appactiveslot/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppActiveSlot_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppActiveSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppActiveSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_web_app_active_slot"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_web_app_active_slot"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppActiveSlot_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/apphybridconnection/zz_controller.go b/internal/controller/web/apphybridconnection/zz_controller.go index 4385a842b..e777cc132 100755 --- a/internal/controller/web/apphybridconnection/zz_controller.go +++ b/internal/controller/web/apphybridconnection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppHybridConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppHybridConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppHybridConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_web_app_hybrid_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_web_app_hybrid_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppHybridConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/appserviceplan/zz_controller.go b/internal/controller/web/appserviceplan/zz_controller.go index f31402668..c83b651af 100755 --- a/internal/controller/web/appserviceplan/zz_controller.go +++ b/internal/controller/web/appserviceplan/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppServicePlan_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppServicePlan_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppServicePlan_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_app_service_plan"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_app_service_plan"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppServicePlan_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/functionapp/zz_controller.go b/internal/controller/web/functionapp/zz_controller.go index f98cd33a5..603bc9eac 100755 --- a/internal/controller/web/functionapp/zz_controller.go +++ b/internal/controller/web/functionapp/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FunctionApp_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FunctionApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FunctionApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_function_app"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_function_app"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FunctionApp_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/functionappactiveslot/zz_controller.go b/internal/controller/web/functionappactiveslot/zz_controller.go index 815e35af4..01d08db4b 100755 --- a/internal/controller/web/functionappactiveslot/zz_controller.go +++ b/internal/controller/web/functionappactiveslot/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FunctionAppActiveSlot_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FunctionAppActiveSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FunctionAppActiveSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_function_app_active_slot"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_function_app_active_slot"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FunctionAppActiveSlot_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/functionappfunction/zz_controller.go b/internal/controller/web/functionappfunction/zz_controller.go index b5148180e..3f419a0cf 100755 --- a/internal/controller/web/functionappfunction/zz_controller.go +++ b/internal/controller/web/functionappfunction/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FunctionAppFunction_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FunctionAppFunction_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FunctionAppFunction_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_function_app_function"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_function_app_function"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FunctionAppFunction_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/functionapphybridconnection/zz_controller.go b/internal/controller/web/functionapphybridconnection/zz_controller.go index 50d629e24..6177a570e 100755 --- a/internal/controller/web/functionapphybridconnection/zz_controller.go +++ b/internal/controller/web/functionapphybridconnection/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FunctionAppHybridConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FunctionAppHybridConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FunctionAppHybridConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_function_app_hybrid_connection"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_function_app_hybrid_connection"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FunctionAppHybridConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/functionappslot/zz_controller.go b/internal/controller/web/functionappslot/zz_controller.go index 0a43d6f23..f944142a3 100755 --- a/internal/controller/web/functionappslot/zz_controller.go +++ b/internal/controller/web/functionappslot/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FunctionAppSlot_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FunctionAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FunctionAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_function_app_slot"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_function_app_slot"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FunctionAppSlot_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/linuxfunctionapp/zz_controller.go b/internal/controller/web/linuxfunctionapp/zz_controller.go index 09b3f2ca1..5fb48c47f 100755 --- a/internal/controller/web/linuxfunctionapp/zz_controller.go +++ b/internal/controller/web/linuxfunctionapp/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinuxFunctionApp_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxFunctionApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxFunctionApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_linux_function_app"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_linux_function_app"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinuxFunctionApp_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/linuxfunctionappslot/zz_controller.go b/internal/controller/web/linuxfunctionappslot/zz_controller.go index 5e432c344..19748f427 100755 --- a/internal/controller/web/linuxfunctionappslot/zz_controller.go +++ b/internal/controller/web/linuxfunctionappslot/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinuxFunctionAppSlot_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxFunctionAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxFunctionAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_linux_function_app_slot"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_linux_function_app_slot"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinuxFunctionAppSlot_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/linuxwebapp/zz_controller.go b/internal/controller/web/linuxwebapp/zz_controller.go index 498a45f91..d7b5a9c78 100755 --- a/internal/controller/web/linuxwebapp/zz_controller.go +++ b/internal/controller/web/linuxwebapp/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinuxWebApp_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxWebApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxWebApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_linux_web_app"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_linux_web_app"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinuxWebApp_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/linuxwebappslot/zz_controller.go b/internal/controller/web/linuxwebappslot/zz_controller.go index 1c500e51b..9057a4e53 100755 --- a/internal/controller/web/linuxwebappslot/zz_controller.go +++ b/internal/controller/web/linuxwebappslot/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinuxWebAppSlot_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxWebAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxWebAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_linux_web_app_slot"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_linux_web_app_slot"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinuxWebAppSlot_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/serviceplan/zz_controller.go b/internal/controller/web/serviceplan/zz_controller.go index f2897e61e..d1a4d64f5 100755 --- a/internal/controller/web/serviceplan/zz_controller.go +++ b/internal/controller/web/serviceplan/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ServicePlan_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ServicePlan_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ServicePlan_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_service_plan"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_service_plan"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ServicePlan_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/sourcecontroltoken/zz_controller.go b/internal/controller/web/sourcecontroltoken/zz_controller.go index 6044f59d0..9bcbfea2d 100755 --- a/internal/controller/web/sourcecontroltoken/zz_controller.go +++ b/internal/controller/web/sourcecontroltoken/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -36,14 +36,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SourceControlToken_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SourceControlToken_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SourceControlToken_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_source_control_token"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_source_control_token"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SourceControlToken_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/staticsite/zz_controller.go b/internal/controller/web/staticsite/zz_controller.go index d2e1fe3f6..3cf1f5c4b 100755 --- a/internal/controller/web/staticsite/zz_controller.go +++ b/internal/controller/web/staticsite/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.StaticSite_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StaticSite_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StaticSite_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_static_site"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_static_site"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.StaticSite_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/windowsfunctionapp/zz_controller.go b/internal/controller/web/windowsfunctionapp/zz_controller.go index 882891f5d..86360d275 100755 --- a/internal/controller/web/windowsfunctionapp/zz_controller.go +++ b/internal/controller/web/windowsfunctionapp/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WindowsFunctionApp_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsFunctionApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsFunctionApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_windows_function_app"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_windows_function_app"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WindowsFunctionApp_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/windowsfunctionappslot/zz_controller.go b/internal/controller/web/windowsfunctionappslot/zz_controller.go index 4c167931d..6632dcbfe 100755 --- a/internal/controller/web/windowsfunctionappslot/zz_controller.go +++ b/internal/controller/web/windowsfunctionappslot/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WindowsFunctionAppSlot_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsFunctionAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsFunctionAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_windows_function_app_slot"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_windows_function_app_slot"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WindowsFunctionAppSlot_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/windowswebapp/zz_controller.go b/internal/controller/web/windowswebapp/zz_controller.go index 93953c6a2..6f1882d25 100755 --- a/internal/controller/web/windowswebapp/zz_controller.go +++ b/internal/controller/web/windowswebapp/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WindowsWebApp_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsWebApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsWebApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_windows_web_app"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_windows_web_app"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WindowsWebApp_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...), diff --git a/internal/controller/web/windowswebappslot/zz_controller.go b/internal/controller/web/windowswebappslot/zz_controller.go index f2674c280..26a527565 100755 --- a/internal/controller/web/windowswebappslot/zz_controller.go +++ b/internal/controller/web/windowswebappslot/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" @@ -37,14 +37,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WindowsWebAppSlot_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsWebAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsWebAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["azurerm_windows_web_app_slot"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_windows_web_app_slot"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WindowsWebAppSlot_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...),