From 6e4a2d37daccbafde7ee3ed6d700df4bd432248f Mon Sep 17 00:00:00 2001 From: Alper Rifat Ulucinar Date: Mon, 20 May 2024 17:44:41 +0300 Subject: [PATCH] Use v1beta1 as the controller reconcile version for the converted APIs with singleton lists Signed-off-by: Alper Rifat Ulucinar --- config/registry.go | 2 +- go.mod | 4 +--- go.sum | 4 ++-- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../apimanagement/api/zz_controller.go | 24 +++++++++---------- .../apidiagnostic/zz_controller.go | 24 +++++++++---------- .../apioperation/zz_controller.go | 24 +++++++++---------- .../apimanagement/backend/zz_controller.go | 24 +++++++++---------- .../apimanagement/diagnostic/zz_controller.go | 24 +++++++++---------- .../apimanagement/gateway/zz_controller.go | 24 +++++++++---------- .../apimanagement/logger/zz_controller.go | 24 +++++++++---------- .../apimanagement/management/zz_controller.go | 24 +++++++++---------- .../apimanagement/namedvalue/zz_controller.go | 24 +++++++++---------- .../configuration/zz_controller.go | 24 +++++++++---------- .../springcloudapiportal/zz_controller.go | 24 +++++++++---------- .../springcloudapp/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../springcloudbuilder/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../springclouddevtoolportal/zz_controller.go | 24 +++++++++---------- .../springcloudgateway/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../springcloudservice/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../resourcepolicyassignment/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../automation/account/zz_controller.go | 24 +++++++++---------- .../automation/module/zz_controller.go | 24 +++++++++---------- .../automation/runbook/zz_controller.go | 24 +++++++++---------- .../automation/schedule/zz_controller.go | 24 +++++++++---------- .../cache/rediscache/zz_controller.go | 24 +++++++++---------- .../controller/cdn/endpoint/zz_controller.go | 24 +++++++++---------- .../frontdoorcustomdomain/zz_controller.go | 24 +++++++++---------- .../cdn/frontdoororigin/zz_controller.go | 24 +++++++++---------- .../cdn/frontdoororigingroup/zz_controller.go | 24 +++++++++---------- .../cdn/frontdoorroute/zz_controller.go | 24 +++++++++---------- .../cdn/frontdoorrule/zz_controller.go | 24 +++++++++---------- .../frontdoorsecuritypolicy/zz_controller.go | 24 +++++++++---------- .../account/zz_controller.go | 24 +++++++++---------- .../deployment/zz_controller.go | 24 +++++++++---------- .../capacityreservation/zz_controller.go | 24 +++++++++---------- .../diskencryptionset/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../controller/compute/image/zz_controller.go | 24 +++++++++---------- .../linuxvirtualmachine/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../compute/manageddisk/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../compute/sharedimage/zz_controller.go | 24 +++++++++---------- .../sharedimagegallery/zz_controller.go | 24 +++++++++---------- .../compute/snapshot/zz_controller.go | 24 +++++++++---------- .../virtualmachineextension/zz_controller.go | 24 +++++++++---------- .../windowsvirtualmachine/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../budgetmanagementgroup/zz_controller.go | 24 +++++++++---------- .../budgetresourcegroup/zz_controller.go | 24 +++++++++---------- .../budgetsubscription/zz_controller.go | 24 +++++++++---------- .../containerapp/zz_controller.go | 24 +++++++++---------- .../registry/zz_controller.go | 24 +++++++++---------- .../tokenpassword/zz_controller.go | 24 +++++++++---------- .../kubernetescluster/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../kubernetesfleetmanager/zz_controller.go | 24 +++++++++---------- .../cosmosdb/account/zz_controller.go | 24 +++++++++---------- .../cassandracluster/zz_controller.go | 24 +++++++++---------- .../cassandrakeyspace/zz_controller.go | 24 +++++++++---------- .../cosmosdb/cassandratable/zz_controller.go | 24 +++++++++---------- .../cosmosdb/gremlindatabase/zz_controller.go | 24 +++++++++---------- .../cosmosdb/gremlingraph/zz_controller.go | 24 +++++++++---------- .../cosmosdb/mongocollection/zz_controller.go | 24 +++++++++---------- .../cosmosdb/mongodatabase/zz_controller.go | 24 +++++++++---------- .../cosmosdb/sqlcontainer/zz_controller.go | 24 +++++++++---------- .../cosmosdb/sqldatabase/zz_controller.go | 24 +++++++++---------- .../cosmosdb/table/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../accessconnector/zz_controller.go | 24 +++++++++---------- .../databricks/workspace/zz_controller.go | 24 +++++++++---------- .../customdataset/zz_controller.go | 24 +++++++++---------- .../datafactory/dataflow/zz_controller.go | 24 +++++++++---------- .../datasetbinary/zz_controller.go | 24 +++++++++---------- .../datasetdelimitedtext/zz_controller.go | 24 +++++++++---------- .../datafactory/datasetjson/zz_controller.go | 24 +++++++++---------- .../datasetparquet/zz_controller.go | 24 +++++++++---------- .../datafactory/factory/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../linkedcustomservice/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../linkedserviceodata/zz_controller.go | 24 +++++++++---------- .../linkedserviceodbc/zz_controller.go | 24 +++++++++---------- .../linkedservicesnowflake/zz_controller.go | 24 +++++++++---------- .../linkedservicesqlserver/zz_controller.go | 24 +++++++++---------- .../linkedservicesynapse/zz_controller.go | 24 +++++++++---------- .../triggerschedule/zz_controller.go | 24 +++++++++---------- .../backuppolicydisk/zz_controller.go | 24 +++++++++---------- .../backuppolicypostgresql/zz_controller.go | 24 +++++++++---------- .../backupvault/zz_controller.go | 24 +++++++++---------- .../datashare/account/zz_controller.go | 24 +++++++++---------- .../datasetblobstorage/zz_controller.go | 24 +++++++++---------- .../datashare/datashare/zz_controller.go | 24 +++++++++---------- .../flexibleserver/zz_controller.go | 24 +++++++++---------- .../dbformysql/server/zz_controller.go | 24 +++++++++---------- .../flexibleserver/zz_controller.go | 24 +++++++++---------- .../dbforpostgresql/server/zz_controller.go | 24 +++++++++---------- .../devices/iothub/zz_controller.go | 24 +++++++++---------- .../devices/iothubdps/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../globalvmshutdownschedule/zz_controller.go | 24 +++++++++---------- .../linuxvirtualmachine/zz_controller.go | 24 +++++++++---------- .../devtestlab/schedule/zz_controller.go | 24 +++++++++---------- .../virtualnetwork/zz_controller.go | 24 +++++++++---------- .../windowsvirtualmachine/zz_controller.go | 24 +++++++++---------- .../digitaltwins/instance/zz_controller.go | 24 +++++++++---------- .../cloudelasticsearch/zz_controller.go | 24 +++++++++---------- .../eventgrid/domain/zz_controller.go | 24 +++++++++---------- .../eventsubscription/zz_controller.go | 24 +++++++++---------- .../eventgrid/systemtopic/zz_controller.go | 24 +++++++++---------- .../eventgrid/topic/zz_controller.go | 24 +++++++++---------- .../eventhub/eventhub/zz_controller.go | 24 +++++++++---------- .../eventhubnamespace/zz_controller.go | 24 +++++++++---------- .../fluidrelay/server/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../hdinsight/hadoopcluster/zz_controller.go | 24 +++++++++---------- .../hdinsight/hbasecluster/zz_controller.go | 24 +++++++++---------- .../interactivequerycluster/zz_controller.go | 24 +++++++++---------- .../hdinsight/kafkacluster/zz_controller.go | 24 +++++++++---------- .../hdinsight/sparkcluster/zz_controller.go | 24 +++++++++---------- .../healthcaredicomservice/zz_controller.go | 24 +++++++++---------- .../healthcarefhirservice/zz_controller.go | 24 +++++++++---------- .../healthcaremedtechservice/zz_controller.go | 24 +++++++++---------- .../healthcareservice/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../monitoractiongroup/zz_controller.go | 24 +++++++++---------- .../monitoractivitylogalert/zz_controller.go | 24 +++++++++---------- .../monitorautoscalesetting/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../monitordiagnosticsetting/zz_controller.go | 24 +++++++++---------- .../monitormetricalert/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../iotcentral/application/zz_controller.go | 24 +++++++++---------- .../keyvault/certificate/zz_controller.go | 24 +++++++++---------- .../controller/keyvault/key/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../keyvault/vault/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../controller/kusto/cluster/zz_controller.go | 24 +++++++++---------- .../labservicelab/zz_controller.go | 24 +++++++++---------- .../labserviceplan/zz_controller.go | 24 +++++++++---------- .../loadtestservice/loadtest/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../apptriggerrecurrence/zz_controller.go | 24 +++++++++---------- .../logic/appworkflow/zz_controller.go | 24 +++++++++---------- .../controller/logz/monitor/zz_controller.go | 24 +++++++++---------- .../logz/subaccount/zz_controller.go | 24 +++++++++---------- .../computecluster/zz_controller.go | 24 +++++++++---------- .../computeinstance/zz_controller.go | 24 +++++++++---------- .../synapsespark/zz_controller.go | 24 +++++++++---------- .../workspace/zz_controller.go | 24 +++++++++---------- .../maintenanceconfiguration/zz_controller.go | 24 +++++++++---------- .../media/assetfilter/zz_controller.go | 24 +++++++++---------- .../media/contentkeypolicy/zz_controller.go | 24 +++++++++---------- .../controller/media/job/zz_controller.go | 24 +++++++++---------- .../media/liveevent/zz_controller.go | 24 +++++++++---------- .../media/servicesaccount/zz_controller.go | 24 +++++++++---------- .../servicesaccountfilter/zz_controller.go | 24 +++++++++---------- .../media/streamingendpoint/zz_controller.go | 24 +++++++++---------- .../media/streamingpolicy/zz_controller.go | 24 +++++++++---------- .../media/transform/zz_controller.go | 24 +++++++++---------- .../netapp/account/zz_controller.go | 24 +++++++++---------- .../netapp/snapshotpolicy/zz_controller.go | 24 +++++++++---------- .../controller/netapp/volume/zz_controller.go | 24 +++++++++---------- .../applicationgateway/zz_controller.go | 24 +++++++++---------- .../connectionmonitor/zz_controller.go | 24 +++++++++---------- .../network/dnszone/zz_controller.go | 24 +++++++++---------- .../expressroutecircuit/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../expressrouteconnection/zz_controller.go | 24 +++++++++---------- .../network/expressrouteport/zz_controller.go | 24 +++++++++---------- .../network/firewall/zz_controller.go | 24 +++++++++---------- .../network/firewallpolicy/zz_controller.go | 24 +++++++++---------- .../network/frontdoor/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../frontdoorrulesengine/zz_controller.go | 24 +++++++++---------- .../localnetworkgateway/zz_controller.go | 24 +++++++++---------- .../network/manager/zz_controller.go | 24 +++++++++---------- .../network/packetcapture/zz_controller.go | 24 +++++++++---------- .../pointtositevpngateway/zz_controller.go | 24 +++++++++---------- .../network/privatednszone/zz_controller.go | 24 +++++++++---------- .../network/privateendpoint/zz_controller.go | 24 +++++++++---------- .../network/profile/zz_controller.go | 24 +++++++++---------- .../network/subnet/zz_controller.go | 24 +++++++++---------- .../trafficmanagerprofile/zz_controller.go | 24 +++++++++---------- .../virtualhubconnection/zz_controller.go | 24 +++++++++---------- .../network/virtualnetwork/zz_controller.go | 24 +++++++++---------- .../virtualnetworkgateway/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../network/vpngateway/zz_controller.go | 24 +++++++++---------- .../vpngatewayconnection/zz_controller.go | 24 +++++++++---------- .../vpnserverconfiguration/zz_controller.go | 24 +++++++++---------- .../network/vpnsite/zz_controller.go | 24 +++++++++---------- .../network/watcherflowlog/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../notificationhub/zz_controller.go | 24 +++++++++---------- .../workspace/zz_controller.go | 24 +++++++++---------- .../loganalyticssolution/zz_controller.go | 24 +++++++++---------- .../purview/account/zz_controller.go | 24 +++++++++---------- .../backuppolicyfileshare/zz_controller.go | 24 +++++++++---------- .../backuppolicyvm/zz_controller.go | 24 +++++++++---------- .../backuppolicyvmworkload/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../recoveryservices/vault/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../search/service/zz_controller.go | 24 +++++++++---------- .../iotsecuritydevicegroup/zz_controller.go | 24 +++++++++---------- .../iotsecuritysolution/zz_controller.go | 24 +++++++++---------- .../securitycenterassessment/zz_controller.go | 24 +++++++++---------- .../servicebusnamespace/zz_controller.go | 24 +++++++++---------- .../servicebus/subscription/zz_controller.go | 24 +++++++++---------- .../subscriptionrule/zz_controller.go | 24 +++++++++---------- .../servicefabric/cluster/zz_controller.go | 24 +++++++++---------- .../managedcluster/zz_controller.go | 24 +++++++++---------- .../springcloudconnection/zz_controller.go | 24 +++++++++---------- .../networkacl/zz_controller.go | 24 +++++++++---------- .../signalrservice/service/zz_controller.go | 24 +++++++++---------- .../signalrservice/webpubsub/zz_controller.go | 24 +++++++++---------- .../webpubsubhub/zz_controller.go | 24 +++++++++---------- .../webpubsubnetworkacl/zz_controller.go | 24 +++++++++---------- .../sql/mssqldatabase/zz_controller.go | 24 +++++++++---------- .../sql/mssqlelasticpool/zz_controller.go | 24 +++++++++---------- .../sql/mssqlfailovergroup/zz_controller.go | 24 +++++++++---------- .../sql/mssqlmanageddatabase/zz_controller.go | 24 +++++++++---------- .../sql/mssqlmanagedinstance/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../sql/mssqlserver/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../storage/account/zz_controller.go | 24 +++++++++---------- .../storage/accountlocaluser/zz_controller.go | 24 +++++++++---------- .../blobinventorypolicy/zz_controller.go | 24 +++++++++---------- .../storage/managementpolicy/zz_controller.go | 24 +++++++++---------- .../storagecache/hpccache/zz_controller.go | 24 +++++++++---------- .../functionjavascriptuda/zz_controller.go | 24 +++++++++---------- .../streamanalytics/job/zz_controller.go | 24 +++++++++---------- .../outputblob/zz_controller.go | 24 +++++++++---------- .../outputeventhub/zz_controller.go | 24 +++++++++---------- .../outputservicebusqueue/zz_controller.go | 24 +++++++++---------- .../outputservicebustopic/zz_controller.go | 24 +++++++++---------- .../referenceinputblob/zz_controller.go | 24 +++++++++---------- .../streaminputblob/zz_controller.go | 24 +++++++++---------- .../streaminputeventhub/zz_controller.go | 24 +++++++++---------- .../streaminputiothub/zz_controller.go | 24 +++++++++---------- .../synapse/linkedservice/zz_controller.go | 24 +++++++++---------- .../synapse/sparkpool/zz_controller.go | 24 +++++++++---------- .../synapse/sqlpool/zz_controller.go | 24 +++++++++---------- .../synapse/workspace/zz_controller.go | 24 +++++++++---------- .../zz_controller.go | 24 +++++++++---------- .../gen2environment/zz_controller.go | 24 +++++++++---------- .../web/appserviceplan/zz_controller.go | 24 +++++++++---------- .../web/functionapp/zz_controller.go | 24 +++++++++---------- .../web/functionappslot/zz_controller.go | 24 +++++++++---------- .../web/linuxfunctionapp/zz_controller.go | 24 +++++++++---------- .../web/linuxfunctionappslot/zz_controller.go | 24 +++++++++---------- .../web/linuxwebapp/zz_controller.go | 24 +++++++++---------- .../web/linuxwebappslot/zz_controller.go | 24 +++++++++---------- .../web/staticsite/zz_controller.go | 24 +++++++++---------- .../web/windowsfunctionapp/zz_controller.go | 24 +++++++++---------- .../windowsfunctionappslot/zz_controller.go | 24 +++++++++---------- .../web/windowswebapp/zz_controller.go | 24 +++++++++---------- .../web/windowswebappslot/zz_controller.go | 24 +++++++++---------- 285 files changed, 3388 insertions(+), 3390 deletions(-) diff --git a/config/registry.go b/config/registry.go index af7acac54..fcd76f511 100644 --- a/config/registry.go +++ b/config/registry.go @@ -197,11 +197,11 @@ func bumpVersionsWithEmbeddedLists(pc *ujconfig.Provider) { // we would like to set the storage version to v1beta1 to facilitate // downgrades. r.SetCRDStorageVersion("v1beta1") + r.ControllerReconcileVersion = "v1beta1" r.Conversions = []conversion.Conversion{ conversion.NewIdentityConversionExpandPaths(conversion.AllVersions, conversion.AllVersions, conversion.DefaultPathPrefixes(), r.CRDListConversionPaths()...), conversion.NewSingletonListConversion("v1beta1", "v1beta2", conversion.DefaultPathPrefixes(), r.CRDListConversionPaths(), conversion.ToEmbeddedObject), conversion.NewSingletonListConversion("v1beta2", "v1beta1", conversion.DefaultPathPrefixes(), r.CRDListConversionPaths(), conversion.ToSingletonList)} - r.TerraformConversions = append(r.TerraformConversions, ujconfig.NewTFSingletonConversion()) pc.Resources[name] = r } } diff --git a/go.mod b/go.mod index 927e181a8..ff828e9ca 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( dario.cat/mergo v1.0.0 github.com/crossplane/crossplane-runtime v1.16.0-rc.1.0.20240424114634-8641eb2ba384 github.com/crossplane/crossplane-tools v0.0.0-20230925130601-628280f8bf79 - github.com/crossplane/upjet v1.3.0 + github.com/crossplane/upjet v1.4.0-rc.0.0.20240515193317-92d1af84d242 github.com/google/go-cmp v0.6.0 github.com/hashicorp/terraform-json v0.17.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0 @@ -168,5 +168,3 @@ require ( replace github.com/hashicorp/terraform-provider-azurerm => github.com/upbound/terraform-provider-azurerm v0.0.0-20240311113236-25a51734d3da replace github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0 - -replace github.com/crossplane/upjet => github.com/ulucinar/upbound-upjet v0.0.0-20240514111512-b5622a10e14d diff --git a/go.sum b/go.sum index a3a9da3cf..94f694c86 100644 --- a/go.sum +++ b/go.sum @@ -79,6 +79,8 @@ github.com/crossplane/crossplane-runtime v1.16.0-rc.1.0.20240424114634-8641eb2ba github.com/crossplane/crossplane-runtime v1.16.0-rc.1.0.20240424114634-8641eb2ba384/go.mod h1:Pz2tdGVMF6KDGzHZOkvKro0nKc8EzK0sb/nSA7pH4Dc= 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.4.0-rc.0.0.20240515193317-92d1af84d242 h1:ylmj67qVNh+AIDK+CH8BiXu41PlGSKBzAwMZApDEOds= +github.com/crossplane/upjet v1.4.0-rc.0.0.20240515193317-92d1af84d242/go.mod h1:3pDVtCgyBc5f2Zx4K5HEPxxhjndmOc5CHCJNpIivK/g= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/dave/jennifer v1.6.0 h1:MQ/6emI2xM7wt0tJzJzyUik2Q3Tcn2eE0vtYgh4GPVI= @@ -356,8 +358,6 @@ github.com/tombuildsstuff/giovanni v0.20.0 h1:IM/I/iNWMXnPYwcSq8uxV7TKDlv7Nejq0b github.com/tombuildsstuff/giovanni v0.20.0/go.mod h1:66KVLYma2whJhEdxPSPL3GQHkulhK+C5CluKfHGfPF4= github.com/tombuildsstuff/kermit v0.20240122.1123108 h1:icQaxsv/ANv/KC4Sr0V1trrWA/XIL+3QAVBDpiSTgj8= github.com/tombuildsstuff/kermit v0.20240122.1123108/go.mod h1:T3YBVFhRV4qA7SbnRaNE6eapIMpKDA9rG/V7Ocsjlno= -github.com/ulucinar/upbound-upjet v0.0.0-20240514111512-b5622a10e14d h1:nz0ZB3a5HA/nbU5XcnU/cFVSvwdOybGujB5yOORjjk4= -github.com/ulucinar/upbound-upjet v0.0.0-20240514111512-b5622a10e14d/go.mod h1:3pDVtCgyBc5f2Zx4K5HEPxxhjndmOc5CHCJNpIivK/g= github.com/upbound/terraform-provider-azurerm v0.0.0-20240311113236-25a51734d3da h1:Rj/LhOVcK8IOSIBYk7L6LZpuOHsXkkit+JrV4nNmi9o= github.com/upbound/terraform-provider-azurerm v0.0.0-20240311113236-25a51734d3da/go.mod h1:GCUoUr4wIRHz+ZYmDI3Y1oE0M64rqJcr3oY60wwJdVc= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= diff --git a/internal/controller/alertsmanagement/monitoractionruleactiongroup/zz_controller.go b/internal/controller/alertsmanagement/monitoractionruleactiongroup/zz_controller.go index 2f3a87dad..ce0011e3b 100755 --- a/internal/controller/alertsmanagement/monitoractionruleactiongroup/zz_controller.go +++ b/internal/controller/alertsmanagement/monitoractionruleactiongroup/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/alertsmanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/alertsmanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MonitorActionRuleActionGroup managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MonitorActionRuleActionGroup_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MonitorActionRuleActionGroup_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", v1beta2.MonitorActionRuleActionGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MonitorActionRuleActionGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorActionRuleActionGroup_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorActionRuleActionGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_action_rule_action_group"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MonitorActionRuleActionGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorActionRuleActionGroup_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MonitorActionRuleActionGroup + // register webhooks for the kind v1beta1.MonitorActionRuleActionGroup // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MonitorActionRuleActionGroup{}). + For(&v1beta1.MonitorActionRuleActionGroup{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MonitorActionRuleActionGroup") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MonitorActionRuleActionGroup") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MonitorActionRuleActionGroupList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MonitorActionRuleActionGroupList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MonitorActionRuleActionGroupList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MonitorActionRuleActionGroupList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MonitorActionRuleActionGroup_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MonitorActionRuleActionGroup_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MonitorActionRuleActionGroup{}, eventHandler). + Watches(&v1beta1.MonitorActionRuleActionGroup{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/alertsmanagement/monitoractionrulesuppression/zz_controller.go b/internal/controller/alertsmanagement/monitoractionrulesuppression/zz_controller.go index bda3a8dd7..019013f57 100755 --- a/internal/controller/alertsmanagement/monitoractionrulesuppression/zz_controller.go +++ b/internal/controller/alertsmanagement/monitoractionrulesuppression/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/alertsmanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/alertsmanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MonitorActionRuleSuppression managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MonitorActionRuleSuppression_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MonitorActionRuleSuppression_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", v1beta2.MonitorActionRuleSuppression_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MonitorActionRuleSuppression_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorActionRuleSuppression_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorActionRuleSuppression_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_action_rule_suppression"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MonitorActionRuleSuppression_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorActionRuleSuppression_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MonitorActionRuleSuppression + // register webhooks for the kind v1beta1.MonitorActionRuleSuppression // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MonitorActionRuleSuppression{}). + For(&v1beta1.MonitorActionRuleSuppression{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MonitorActionRuleSuppression") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MonitorActionRuleSuppression") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MonitorActionRuleSuppressionList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MonitorActionRuleSuppressionList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MonitorActionRuleSuppressionList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MonitorActionRuleSuppressionList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MonitorActionRuleSuppression_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MonitorActionRuleSuppression_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MonitorActionRuleSuppression{}, eventHandler). + Watches(&v1beta1.MonitorActionRuleSuppression{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/alertsmanagement/monitoralertprocessingruleactiongroup/zz_controller.go b/internal/controller/alertsmanagement/monitoralertprocessingruleactiongroup/zz_controller.go index f7bc84338..cf2dcb418 100755 --- a/internal/controller/alertsmanagement/monitoralertprocessingruleactiongroup/zz_controller.go +++ b/internal/controller/alertsmanagement/monitoralertprocessingruleactiongroup/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/alertsmanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/alertsmanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MonitorAlertProcessingRuleActionGroup managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MonitorAlertProcessingRuleActionGroup_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MonitorAlertProcessingRuleActionGroup_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", v1beta2.MonitorAlertProcessingRuleActionGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MonitorAlertProcessingRuleActionGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorAlertProcessingRuleActionGroup_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorAlertProcessingRuleActionGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_alert_processing_rule_action_group"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MonitorAlertProcessingRuleActionGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorAlertProcessingRuleActionGroup_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MonitorAlertProcessingRuleActionGroup + // register webhooks for the kind v1beta1.MonitorAlertProcessingRuleActionGroup // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MonitorAlertProcessingRuleActionGroup{}). + For(&v1beta1.MonitorAlertProcessingRuleActionGroup{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MonitorAlertProcessingRuleActionGroup") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MonitorAlertProcessingRuleActionGroup") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MonitorAlertProcessingRuleActionGroupList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MonitorAlertProcessingRuleActionGroupList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MonitorAlertProcessingRuleActionGroupList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MonitorAlertProcessingRuleActionGroupList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MonitorAlertProcessingRuleActionGroup_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MonitorAlertProcessingRuleActionGroup_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MonitorAlertProcessingRuleActionGroup{}, eventHandler). + Watches(&v1beta1.MonitorAlertProcessingRuleActionGroup{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/alertsmanagement/monitoralertprocessingrulesuppression/zz_controller.go b/internal/controller/alertsmanagement/monitoralertprocessingrulesuppression/zz_controller.go index d5eeb3c6a..b80332562 100755 --- a/internal/controller/alertsmanagement/monitoralertprocessingrulesuppression/zz_controller.go +++ b/internal/controller/alertsmanagement/monitoralertprocessingrulesuppression/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/alertsmanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/alertsmanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MonitorAlertProcessingRuleSuppression managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MonitorAlertProcessingRuleSuppression_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MonitorAlertProcessingRuleSuppression_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", v1beta2.MonitorAlertProcessingRuleSuppression_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MonitorAlertProcessingRuleSuppression_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorAlertProcessingRuleSuppression_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorAlertProcessingRuleSuppression_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_alert_processing_rule_suppression"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MonitorAlertProcessingRuleSuppression_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorAlertProcessingRuleSuppression_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MonitorAlertProcessingRuleSuppression + // register webhooks for the kind v1beta1.MonitorAlertProcessingRuleSuppression // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MonitorAlertProcessingRuleSuppression{}). + For(&v1beta1.MonitorAlertProcessingRuleSuppression{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MonitorAlertProcessingRuleSuppression") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MonitorAlertProcessingRuleSuppression") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MonitorAlertProcessingRuleSuppressionList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MonitorAlertProcessingRuleSuppressionList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MonitorAlertProcessingRuleSuppressionList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MonitorAlertProcessingRuleSuppressionList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MonitorAlertProcessingRuleSuppression_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MonitorAlertProcessingRuleSuppression_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MonitorAlertProcessingRuleSuppression{}, eventHandler). + Watches(&v1beta1.MonitorAlertProcessingRuleSuppression{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/alertsmanagement/monitorsmartdetectoralertrule/zz_controller.go b/internal/controller/alertsmanagement/monitorsmartdetectoralertrule/zz_controller.go index 05f6fd8f6..1e765dda6 100755 --- a/internal/controller/alertsmanagement/monitorsmartdetectoralertrule/zz_controller.go +++ b/internal/controller/alertsmanagement/monitorsmartdetectoralertrule/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/alertsmanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/alertsmanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MonitorSmartDetectorAlertRule managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MonitorSmartDetectorAlertRule_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MonitorSmartDetectorAlertRule_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.MonitorSmartDetectorAlertRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MonitorSmartDetectorAlertRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorSmartDetectorAlertRule_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorSmartDetectorAlertRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_smart_detector_alert_rule"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MonitorSmartDetectorAlertRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorSmartDetectorAlertRule_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MonitorSmartDetectorAlertRule + // register webhooks for the kind v1beta1.MonitorSmartDetectorAlertRule // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MonitorSmartDetectorAlertRule{}). + For(&v1beta1.MonitorSmartDetectorAlertRule{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MonitorSmartDetectorAlertRule") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MonitorSmartDetectorAlertRule") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MonitorSmartDetectorAlertRuleList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MonitorSmartDetectorAlertRuleList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MonitorSmartDetectorAlertRuleList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MonitorSmartDetectorAlertRuleList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MonitorSmartDetectorAlertRule_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MonitorSmartDetectorAlertRule_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MonitorSmartDetectorAlertRule{}, eventHandler). + Watches(&v1beta1.MonitorSmartDetectorAlertRule{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/apimanagement/api/zz_controller.go b/internal/controller/apimanagement/api/zz_controller.go index bf6b04bd9..1222366ad 100755 --- a/internal/controller/apimanagement/api/zz_controller.go +++ b/internal/controller/apimanagement/api/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/apimanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles API managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.API_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.API_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", v1beta2.API_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.API_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.API_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.API_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.API_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.API_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.API + // register webhooks for the kind v1beta1.API // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.API{}). + For(&v1beta1.API{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.API") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.API") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.APIList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.APIList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.APIList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.APIList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.API_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.API_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.API{}, eventHandler). + Watches(&v1beta1.API{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/apimanagement/apidiagnostic/zz_controller.go b/internal/controller/apimanagement/apidiagnostic/zz_controller.go index 728ffe52f..116373eaf 100755 --- a/internal/controller/apimanagement/apidiagnostic/zz_controller.go +++ b/internal/controller/apimanagement/apidiagnostic/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/apimanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles APIDiagnostic managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.APIDiagnostic_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.APIDiagnostic_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", v1beta2.APIDiagnostic_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.APIDiagnostic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.APIDiagnostic_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APIDiagnostic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_diagnostic"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.APIDiagnostic_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.APIDiagnostic_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.APIDiagnostic + // register webhooks for the kind v1beta1.APIDiagnostic // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.APIDiagnostic{}). + For(&v1beta1.APIDiagnostic{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.APIDiagnostic") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.APIDiagnostic") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.APIDiagnosticList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.APIDiagnosticList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.APIDiagnosticList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.APIDiagnosticList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.APIDiagnostic_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.APIDiagnostic_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.APIDiagnostic{}, eventHandler). + Watches(&v1beta1.APIDiagnostic{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/apimanagement/apioperation/zz_controller.go b/internal/controller/apimanagement/apioperation/zz_controller.go index 95ac0116d..28a89b6f4 100755 --- a/internal/controller/apimanagement/apioperation/zz_controller.go +++ b/internal/controller/apimanagement/apioperation/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/apimanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles APIOperation managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.APIOperation_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.APIOperation_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", v1beta2.APIOperation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.APIOperation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.APIOperation_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.APIOperation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_api_operation"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.APIOperation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.APIOperation_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.APIOperation + // register webhooks for the kind v1beta1.APIOperation // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.APIOperation{}). + For(&v1beta1.APIOperation{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.APIOperation") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.APIOperation") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.APIOperationList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.APIOperationList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.APIOperationList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.APIOperationList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.APIOperation_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.APIOperation_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.APIOperation{}, eventHandler). + Watches(&v1beta1.APIOperation{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/apimanagement/backend/zz_controller.go b/internal/controller/apimanagement/backend/zz_controller.go index 6a00e417c..b1730acc2 100755 --- a/internal/controller/apimanagement/backend/zz_controller.go +++ b/internal/controller/apimanagement/backend/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/apimanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Backend managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Backend_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Backend_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", v1beta2.Backend_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Backend_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Backend_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Backend_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_backend"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Backend_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Backend_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Backend + // register webhooks for the kind v1beta1.Backend // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Backend{}). + For(&v1beta1.Backend{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Backend") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Backend") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.BackendList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.BackendList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.BackendList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.BackendList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Backend_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Backend_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Backend{}, eventHandler). + Watches(&v1beta1.Backend{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/apimanagement/diagnostic/zz_controller.go b/internal/controller/apimanagement/diagnostic/zz_controller.go index d9be0ce9d..fe1a3a3e4 100755 --- a/internal/controller/apimanagement/diagnostic/zz_controller.go +++ b/internal/controller/apimanagement/diagnostic/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/apimanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Diagnostic managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Diagnostic_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Diagnostic_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", v1beta2.Diagnostic_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Diagnostic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Diagnostic_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Diagnostic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_diagnostic"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Diagnostic_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Diagnostic_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Diagnostic + // register webhooks for the kind v1beta1.Diagnostic // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Diagnostic{}). + For(&v1beta1.Diagnostic{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Diagnostic") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Diagnostic") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.DiagnosticList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.DiagnosticList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.DiagnosticList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.DiagnosticList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Diagnostic_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Diagnostic_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Diagnostic{}, eventHandler). + Watches(&v1beta1.Diagnostic{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/apimanagement/gateway/zz_controller.go b/internal/controller/apimanagement/gateway/zz_controller.go index 8bde5ac45..4753b4e83 100755 --- a/internal/controller/apimanagement/gateway/zz_controller.go +++ b/internal/controller/apimanagement/gateway/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/apimanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Gateway managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Gateway_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Gateway_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", v1beta2.Gateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Gateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Gateway_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Gateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_gateway"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Gateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Gateway_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Gateway + // register webhooks for the kind v1beta1.Gateway // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Gateway{}). + For(&v1beta1.Gateway{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Gateway") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Gateway") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.GatewayList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.GatewayList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.GatewayList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.GatewayList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Gateway_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Gateway_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Gateway{}, eventHandler). + Watches(&v1beta1.Gateway{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/apimanagement/logger/zz_controller.go b/internal/controller/apimanagement/logger/zz_controller.go index e4ff59559..bf9513b57 100755 --- a/internal/controller/apimanagement/logger/zz_controller.go +++ b/internal/controller/apimanagement/logger/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/apimanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Logger managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Logger_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Logger_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", v1beta2.Logger_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Logger_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Logger_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Logger_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_logger"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Logger_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Logger_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Logger + // register webhooks for the kind v1beta1.Logger // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Logger{}). + For(&v1beta1.Logger{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Logger") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Logger") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LoggerList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LoggerList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LoggerList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LoggerList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Logger_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Logger_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Logger{}, eventHandler). + Watches(&v1beta1.Logger{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/apimanagement/management/zz_controller.go b/internal/controller/apimanagement/management/zz_controller.go index 53309108d..889b246b8 100755 --- a/internal/controller/apimanagement/management/zz_controller.go +++ b/internal/controller/apimanagement/management/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/apimanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Management managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Management_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Management_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", v1beta2.Management_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Management_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + 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.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Management_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Management_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Management + // register webhooks for the kind v1beta1.Management // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Management{}). + For(&v1beta1.Management{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Management") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Management") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ManagementList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ManagementList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ManagementList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ManagementList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Management_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Management_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Management{}, eventHandler). + Watches(&v1beta1.Management{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/apimanagement/namedvalue/zz_controller.go b/internal/controller/apimanagement/namedvalue/zz_controller.go index 5192dbc36..ae722527a 100755 --- a/internal/controller/apimanagement/namedvalue/zz_controller.go +++ b/internal/controller/apimanagement/namedvalue/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/apimanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/apimanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles NamedValue managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.NamedValue_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.NamedValue_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", v1beta2.NamedValue_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.NamedValue_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NamedValue_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NamedValue_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_api_management_named_value"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.NamedValue_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NamedValue_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.NamedValue + // register webhooks for the kind v1beta1.NamedValue // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.NamedValue{}). + For(&v1beta1.NamedValue{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.NamedValue") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.NamedValue") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.NamedValueList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.NamedValueList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.NamedValueList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.NamedValueList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.NamedValue_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.NamedValue_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.NamedValue{}, eventHandler). + Watches(&v1beta1.NamedValue{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/appconfiguration/configuration/zz_controller.go b/internal/controller/appconfiguration/configuration/zz_controller.go index 8ad1b24cd..f988c3021 100755 --- a/internal/controller/appconfiguration/configuration/zz_controller.go +++ b/internal/controller/appconfiguration/configuration/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/appconfiguration/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/appconfiguration/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Configuration managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Configuration_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Configuration_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", v1beta2.Configuration_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Configuration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + 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.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_app_configuration"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Configuration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Configuration_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Configuration + // register webhooks for the kind v1beta1.Configuration // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Configuration{}). + For(&v1beta1.Configuration{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Configuration") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Configuration") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ConfigurationList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ConfigurationList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ConfigurationList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ConfigurationList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Configuration_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Configuration_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Configuration{}, eventHandler). + Watches(&v1beta1.Configuration{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/appplatform/springcloudapiportal/zz_controller.go b/internal/controller/appplatform/springcloudapiportal/zz_controller.go index 3ef7876ef..618f7b9c0 100755 --- a/internal/controller/appplatform/springcloudapiportal/zz_controller.go +++ b/internal/controller/appplatform/springcloudapiportal/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/appplatform/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SpringCloudAPIPortal managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SpringCloudAPIPortal_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SpringCloudAPIPortal_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", v1beta2.SpringCloudAPIPortal_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SpringCloudAPIPortal_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudAPIPortal_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudAPIPortal_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_api_portal"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SpringCloudAPIPortal_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudAPIPortal_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SpringCloudAPIPortal + // register webhooks for the kind v1beta1.SpringCloudAPIPortal // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SpringCloudAPIPortal{}). + For(&v1beta1.SpringCloudAPIPortal{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SpringCloudAPIPortal") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SpringCloudAPIPortal") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SpringCloudAPIPortalList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SpringCloudAPIPortalList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SpringCloudAPIPortalList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SpringCloudAPIPortalList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SpringCloudAPIPortal_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SpringCloudAPIPortal_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SpringCloudAPIPortal{}, eventHandler). + Watches(&v1beta1.SpringCloudAPIPortal{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/appplatform/springcloudapp/zz_controller.go b/internal/controller/appplatform/springcloudapp/zz_controller.go index 3cda111a8..9296576d9 100755 --- a/internal/controller/appplatform/springcloudapp/zz_controller.go +++ b/internal/controller/appplatform/springcloudapp/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/appplatform/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SpringCloudApp managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SpringCloudApp_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SpringCloudApp_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", v1beta2.SpringCloudApp_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SpringCloudApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudApp_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_app"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SpringCloudApp_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudApp_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SpringCloudApp + // register webhooks for the kind v1beta1.SpringCloudApp // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SpringCloudApp{}). + For(&v1beta1.SpringCloudApp{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SpringCloudApp") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SpringCloudApp") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SpringCloudAppList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SpringCloudAppList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SpringCloudAppList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SpringCloudAppList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SpringCloudApp_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SpringCloudApp_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SpringCloudApp{}, eventHandler). + Watches(&v1beta1.SpringCloudApp{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/appplatform/springcloudbuilddeployment/zz_controller.go b/internal/controller/appplatform/springcloudbuilddeployment/zz_controller.go index 87fb5a072..9d8aed951 100755 --- a/internal/controller/appplatform/springcloudbuilddeployment/zz_controller.go +++ b/internal/controller/appplatform/springcloudbuilddeployment/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/appplatform/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SpringCloudBuildDeployment managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SpringCloudBuildDeployment_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SpringCloudBuildDeployment_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", v1beta2.SpringCloudBuildDeployment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SpringCloudBuildDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudBuildDeployment_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudBuildDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_build_deployment"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SpringCloudBuildDeployment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudBuildDeployment_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SpringCloudBuildDeployment + // register webhooks for the kind v1beta1.SpringCloudBuildDeployment // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SpringCloudBuildDeployment{}). + For(&v1beta1.SpringCloudBuildDeployment{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SpringCloudBuildDeployment") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SpringCloudBuildDeployment") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SpringCloudBuildDeploymentList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SpringCloudBuildDeploymentList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SpringCloudBuildDeploymentList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SpringCloudBuildDeploymentList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SpringCloudBuildDeployment_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SpringCloudBuildDeployment_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SpringCloudBuildDeployment{}, eventHandler). + Watches(&v1beta1.SpringCloudBuildDeployment{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/appplatform/springcloudbuilder/zz_controller.go b/internal/controller/appplatform/springcloudbuilder/zz_controller.go index c03aeff16..4319b8c9d 100755 --- a/internal/controller/appplatform/springcloudbuilder/zz_controller.go +++ b/internal/controller/appplatform/springcloudbuilder/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/appplatform/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SpringCloudBuilder managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SpringCloudBuilder_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SpringCloudBuilder_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.SpringCloudBuilder_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SpringCloudBuilder_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudBuilder_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudBuilder_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_builder"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SpringCloudBuilder_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudBuilder_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SpringCloudBuilder + // register webhooks for the kind v1beta1.SpringCloudBuilder // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SpringCloudBuilder{}). + For(&v1beta1.SpringCloudBuilder{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SpringCloudBuilder") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SpringCloudBuilder") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SpringCloudBuilderList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SpringCloudBuilderList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SpringCloudBuilderList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SpringCloudBuilderList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SpringCloudBuilder_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SpringCloudBuilder_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SpringCloudBuilder{}, eventHandler). + Watches(&v1beta1.SpringCloudBuilder{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/appplatform/springcloudbuildpackbinding/zz_controller.go b/internal/controller/appplatform/springcloudbuildpackbinding/zz_controller.go index 43a99cb55..ebe9a5598 100755 --- a/internal/controller/appplatform/springcloudbuildpackbinding/zz_controller.go +++ b/internal/controller/appplatform/springcloudbuildpackbinding/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/appplatform/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SpringCloudBuildPackBinding managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SpringCloudBuildPackBinding_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SpringCloudBuildPackBinding_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", v1beta2.SpringCloudBuildPackBinding_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SpringCloudBuildPackBinding_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudBuildPackBinding_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudBuildPackBinding_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_build_pack_binding"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SpringCloudBuildPackBinding_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudBuildPackBinding_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SpringCloudBuildPackBinding + // register webhooks for the kind v1beta1.SpringCloudBuildPackBinding // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SpringCloudBuildPackBinding{}). + For(&v1beta1.SpringCloudBuildPackBinding{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SpringCloudBuildPackBinding") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SpringCloudBuildPackBinding") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SpringCloudBuildPackBindingList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SpringCloudBuildPackBindingList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SpringCloudBuildPackBindingList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SpringCloudBuildPackBindingList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SpringCloudBuildPackBinding_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SpringCloudBuildPackBinding_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SpringCloudBuildPackBinding{}, eventHandler). + Watches(&v1beta1.SpringCloudBuildPackBinding{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/appplatform/springcloudcontainerdeployment/zz_controller.go b/internal/controller/appplatform/springcloudcontainerdeployment/zz_controller.go index cd67fefa9..b8dcc1f14 100755 --- a/internal/controller/appplatform/springcloudcontainerdeployment/zz_controller.go +++ b/internal/controller/appplatform/springcloudcontainerdeployment/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/appplatform/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SpringCloudContainerDeployment managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SpringCloudContainerDeployment_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SpringCloudContainerDeployment_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", v1beta2.SpringCloudContainerDeployment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SpringCloudContainerDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudContainerDeployment_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudContainerDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_container_deployment"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SpringCloudContainerDeployment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudContainerDeployment_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SpringCloudContainerDeployment + // register webhooks for the kind v1beta1.SpringCloudContainerDeployment // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SpringCloudContainerDeployment{}). + For(&v1beta1.SpringCloudContainerDeployment{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SpringCloudContainerDeployment") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SpringCloudContainerDeployment") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SpringCloudContainerDeploymentList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SpringCloudContainerDeploymentList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SpringCloudContainerDeploymentList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SpringCloudContainerDeploymentList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SpringCloudContainerDeployment_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SpringCloudContainerDeployment_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SpringCloudContainerDeployment{}, eventHandler). + Watches(&v1beta1.SpringCloudContainerDeployment{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/appplatform/springcloudcustomizedaccelerator/zz_controller.go b/internal/controller/appplatform/springcloudcustomizedaccelerator/zz_controller.go index be8abe833..74e28393c 100755 --- a/internal/controller/appplatform/springcloudcustomizedaccelerator/zz_controller.go +++ b/internal/controller/appplatform/springcloudcustomizedaccelerator/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/appplatform/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SpringCloudCustomizedAccelerator managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SpringCloudCustomizedAccelerator_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SpringCloudCustomizedAccelerator_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", v1beta2.SpringCloudCustomizedAccelerator_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SpringCloudCustomizedAccelerator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudCustomizedAccelerator_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudCustomizedAccelerator_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_customized_accelerator"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SpringCloudCustomizedAccelerator_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudCustomizedAccelerator_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SpringCloudCustomizedAccelerator + // register webhooks for the kind v1beta1.SpringCloudCustomizedAccelerator // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SpringCloudCustomizedAccelerator{}). + For(&v1beta1.SpringCloudCustomizedAccelerator{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SpringCloudCustomizedAccelerator") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SpringCloudCustomizedAccelerator") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SpringCloudCustomizedAcceleratorList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SpringCloudCustomizedAcceleratorList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SpringCloudCustomizedAcceleratorList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SpringCloudCustomizedAcceleratorList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SpringCloudCustomizedAccelerator_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SpringCloudCustomizedAccelerator_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SpringCloudCustomizedAccelerator{}, eventHandler). + Watches(&v1beta1.SpringCloudCustomizedAccelerator{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/appplatform/springclouddevtoolportal/zz_controller.go b/internal/controller/appplatform/springclouddevtoolportal/zz_controller.go index f77e44d81..0a6ef4343 100755 --- a/internal/controller/appplatform/springclouddevtoolportal/zz_controller.go +++ b/internal/controller/appplatform/springclouddevtoolportal/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/appplatform/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SpringCloudDevToolPortal managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SpringCloudDevToolPortal_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SpringCloudDevToolPortal_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.SpringCloudDevToolPortal_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SpringCloudDevToolPortal_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudDevToolPortal_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudDevToolPortal_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_dev_tool_portal"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SpringCloudDevToolPortal_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudDevToolPortal_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SpringCloudDevToolPortal + // register webhooks for the kind v1beta1.SpringCloudDevToolPortal // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SpringCloudDevToolPortal{}). + For(&v1beta1.SpringCloudDevToolPortal{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SpringCloudDevToolPortal") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SpringCloudDevToolPortal") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SpringCloudDevToolPortalList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SpringCloudDevToolPortalList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SpringCloudDevToolPortalList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SpringCloudDevToolPortalList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SpringCloudDevToolPortal_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SpringCloudDevToolPortal_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SpringCloudDevToolPortal{}, eventHandler). + Watches(&v1beta1.SpringCloudDevToolPortal{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/appplatform/springcloudgateway/zz_controller.go b/internal/controller/appplatform/springcloudgateway/zz_controller.go index e42b352f7..96ecd56bd 100755 --- a/internal/controller/appplatform/springcloudgateway/zz_controller.go +++ b/internal/controller/appplatform/springcloudgateway/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/appplatform/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SpringCloudGateway managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SpringCloudGateway_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SpringCloudGateway_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", v1beta2.SpringCloudGateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SpringCloudGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudGateway_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_gateway"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SpringCloudGateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudGateway_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SpringCloudGateway + // register webhooks for the kind v1beta1.SpringCloudGateway // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SpringCloudGateway{}). + For(&v1beta1.SpringCloudGateway{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SpringCloudGateway") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SpringCloudGateway") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SpringCloudGatewayList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SpringCloudGatewayList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SpringCloudGatewayList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SpringCloudGatewayList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SpringCloudGateway_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SpringCloudGateway_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SpringCloudGateway{}, eventHandler). + Watches(&v1beta1.SpringCloudGateway{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/appplatform/springcloudjavadeployment/zz_controller.go b/internal/controller/appplatform/springcloudjavadeployment/zz_controller.go index 9793d56db..aeb8d6d3a 100755 --- a/internal/controller/appplatform/springcloudjavadeployment/zz_controller.go +++ b/internal/controller/appplatform/springcloudjavadeployment/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/appplatform/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SpringCloudJavaDeployment managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SpringCloudJavaDeployment_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SpringCloudJavaDeployment_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", v1beta2.SpringCloudJavaDeployment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SpringCloudJavaDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudJavaDeployment_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudJavaDeployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_java_deployment"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SpringCloudJavaDeployment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudJavaDeployment_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SpringCloudJavaDeployment + // register webhooks for the kind v1beta1.SpringCloudJavaDeployment // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SpringCloudJavaDeployment{}). + For(&v1beta1.SpringCloudJavaDeployment{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SpringCloudJavaDeployment") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SpringCloudJavaDeployment") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SpringCloudJavaDeploymentList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SpringCloudJavaDeploymentList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SpringCloudJavaDeploymentList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SpringCloudJavaDeploymentList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SpringCloudJavaDeployment_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SpringCloudJavaDeployment_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SpringCloudJavaDeployment{}, eventHandler). + Watches(&v1beta1.SpringCloudJavaDeployment{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/appplatform/springcloudservice/zz_controller.go b/internal/controller/appplatform/springcloudservice/zz_controller.go index 6a86f37bc..730b18485 100755 --- a/internal/controller/appplatform/springcloudservice/zz_controller.go +++ b/internal/controller/appplatform/springcloudservice/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/appplatform/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/appplatform/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SpringCloudService managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SpringCloudService_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SpringCloudService_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", v1beta2.SpringCloudService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SpringCloudService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudService_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_service"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SpringCloudService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudService_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SpringCloudService + // register webhooks for the kind v1beta1.SpringCloudService // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SpringCloudService{}). + For(&v1beta1.SpringCloudService{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SpringCloudService") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SpringCloudService") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SpringCloudServiceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SpringCloudServiceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SpringCloudServiceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SpringCloudServiceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SpringCloudService_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SpringCloudService_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SpringCloudService{}, eventHandler). + Watches(&v1beta1.SpringCloudService{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/authorization/resourcegrouppolicyassignment/zz_controller.go b/internal/controller/authorization/resourcegrouppolicyassignment/zz_controller.go index aa05d017f..74f3ed7c9 100755 --- a/internal/controller/authorization/resourcegrouppolicyassignment/zz_controller.go +++ b/internal/controller/authorization/resourcegrouppolicyassignment/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/authorization/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/authorization/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ResourceGroupPolicyAssignment managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ResourceGroupPolicyAssignment_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ResourceGroupPolicyAssignment_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", v1beta2.ResourceGroupPolicyAssignment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ResourceGroupPolicyAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ResourceGroupPolicyAssignment_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceGroupPolicyAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_resource_group_policy_assignment"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ResourceGroupPolicyAssignment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ResourceGroupPolicyAssignment_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ResourceGroupPolicyAssignment + // register webhooks for the kind v1beta1.ResourceGroupPolicyAssignment // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ResourceGroupPolicyAssignment{}). + For(&v1beta1.ResourceGroupPolicyAssignment{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ResourceGroupPolicyAssignment") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ResourceGroupPolicyAssignment") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ResourceGroupPolicyAssignmentList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ResourceGroupPolicyAssignmentList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ResourceGroupPolicyAssignmentList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ResourceGroupPolicyAssignmentList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ResourceGroupPolicyAssignment_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ResourceGroupPolicyAssignment_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ResourceGroupPolicyAssignment{}, eventHandler). + Watches(&v1beta1.ResourceGroupPolicyAssignment{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/authorization/resourcepolicyassignment/zz_controller.go b/internal/controller/authorization/resourcepolicyassignment/zz_controller.go index 504aa5c87..141546188 100755 --- a/internal/controller/authorization/resourcepolicyassignment/zz_controller.go +++ b/internal/controller/authorization/resourcepolicyassignment/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/authorization/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/authorization/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ResourcePolicyAssignment managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ResourcePolicyAssignment_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ResourcePolicyAssignment_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.ResourcePolicyAssignment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ResourcePolicyAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ResourcePolicyAssignment_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourcePolicyAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_resource_policy_assignment"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ResourcePolicyAssignment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ResourcePolicyAssignment_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ResourcePolicyAssignment + // register webhooks for the kind v1beta1.ResourcePolicyAssignment // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ResourcePolicyAssignment{}). + For(&v1beta1.ResourcePolicyAssignment{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ResourcePolicyAssignment") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ResourcePolicyAssignment") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ResourcePolicyAssignmentList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ResourcePolicyAssignmentList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ResourcePolicyAssignmentList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ResourcePolicyAssignmentList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ResourcePolicyAssignment_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ResourcePolicyAssignment_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ResourcePolicyAssignment{}, eventHandler). + Watches(&v1beta1.ResourcePolicyAssignment{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/authorization/subscriptionpolicyassignment/zz_controller.go b/internal/controller/authorization/subscriptionpolicyassignment/zz_controller.go index ee420ea9c..af21bfbeb 100755 --- a/internal/controller/authorization/subscriptionpolicyassignment/zz_controller.go +++ b/internal/controller/authorization/subscriptionpolicyassignment/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/authorization/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/authorization/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SubscriptionPolicyAssignment managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SubscriptionPolicyAssignment_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SubscriptionPolicyAssignment_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", v1beta2.SubscriptionPolicyAssignment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SubscriptionPolicyAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SubscriptionPolicyAssignment_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubscriptionPolicyAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_subscription_policy_assignment"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SubscriptionPolicyAssignment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SubscriptionPolicyAssignment_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SubscriptionPolicyAssignment + // register webhooks for the kind v1beta1.SubscriptionPolicyAssignment // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SubscriptionPolicyAssignment{}). + For(&v1beta1.SubscriptionPolicyAssignment{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SubscriptionPolicyAssignment") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SubscriptionPolicyAssignment") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SubscriptionPolicyAssignmentList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SubscriptionPolicyAssignmentList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SubscriptionPolicyAssignmentList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SubscriptionPolicyAssignmentList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SubscriptionPolicyAssignment_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SubscriptionPolicyAssignment_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SubscriptionPolicyAssignment{}, eventHandler). + Watches(&v1beta1.SubscriptionPolicyAssignment{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/automation/account/zz_controller.go b/internal/controller/automation/account/zz_controller.go index 1ce25535a..8b0eb59bb 100755 --- a/internal/controller/automation/account/zz_controller.go +++ b/internal/controller/automation/account/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/automation/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Account managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Account_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Account_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", v1beta2.Account_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Account_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_account"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Account_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Account_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Account + // register webhooks for the kind v1beta1.Account // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Account{}). + For(&v1beta1.Account{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Account") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Account") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.AccountList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.AccountList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.AccountList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.AccountList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Account_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Account{}, eventHandler). + Watches(&v1beta1.Account{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/automation/module/zz_controller.go b/internal/controller/automation/module/zz_controller.go index c0901be66..e8cec34a5 100755 --- a/internal/controller/automation/module/zz_controller.go +++ b/internal/controller/automation/module/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/automation/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Module managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Module_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Module_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", v1beta2.Module_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Module_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Module_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Module_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_module"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Module_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Module_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Module + // register webhooks for the kind v1beta1.Module // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Module{}). + For(&v1beta1.Module{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Module") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Module") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ModuleList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ModuleList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ModuleList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ModuleList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Module_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Module_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Module{}, eventHandler). + Watches(&v1beta1.Module{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/automation/runbook/zz_controller.go b/internal/controller/automation/runbook/zz_controller.go index 136c95e33..c90b9d742 100755 --- a/internal/controller/automation/runbook/zz_controller.go +++ b/internal/controller/automation/runbook/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/automation/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles RunBook managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.RunBook_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.RunBook_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.RunBook_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.RunBook_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RunBook_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RunBook_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_runbook"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.RunBook_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RunBook_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.RunBook + // register webhooks for the kind v1beta1.RunBook // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.RunBook{}). + For(&v1beta1.RunBook{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.RunBook") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.RunBook") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.RunBookList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.RunBookList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.RunBookList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.RunBookList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.RunBook_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.RunBook_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.RunBook{}, eventHandler). + Watches(&v1beta1.RunBook{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/automation/schedule/zz_controller.go b/internal/controller/automation/schedule/zz_controller.go index 3030475f0..abafaddf9 100755 --- a/internal/controller/automation/schedule/zz_controller.go +++ b/internal/controller/automation/schedule/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/automation/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/automation/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Schedule managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Schedule_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Schedule_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", v1beta2.Schedule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Schedule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Schedule_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Schedule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_automation_schedule"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Schedule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Schedule_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Schedule + // register webhooks for the kind v1beta1.Schedule // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Schedule{}). + For(&v1beta1.Schedule{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Schedule") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Schedule") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ScheduleList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ScheduleList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ScheduleList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ScheduleList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Schedule_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Schedule_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Schedule{}, eventHandler). + Watches(&v1beta1.Schedule{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cache/rediscache/zz_controller.go b/internal/controller/cache/rediscache/zz_controller.go index 9ebdef445..fb9877d35 100755 --- a/internal/controller/cache/rediscache/zz_controller.go +++ b/internal/controller/cache/rediscache/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cache/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cache/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles RedisCache managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.RedisCache_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.RedisCache_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", v1beta2.RedisCache_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.RedisCache_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RedisCache_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RedisCache_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_redis_cache"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.RedisCache_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RedisCache_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.RedisCache + // register webhooks for the kind v1beta1.RedisCache // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.RedisCache{}). + For(&v1beta1.RedisCache{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.RedisCache") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.RedisCache") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.RedisCacheList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.RedisCacheList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.RedisCacheList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.RedisCacheList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.RedisCache_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.RedisCache_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.RedisCache{}, eventHandler). + Watches(&v1beta1.RedisCache{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cdn/endpoint/zz_controller.go b/internal/controller/cdn/endpoint/zz_controller.go index 52264507b..29df30973 100755 --- a/internal/controller/cdn/endpoint/zz_controller.go +++ b/internal/controller/cdn/endpoint/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cdn/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Endpoint managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Endpoint_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Endpoint_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", v1beta2.Endpoint_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Endpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Endpoint_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Endpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_endpoint"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Endpoint_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Endpoint_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Endpoint + // register webhooks for the kind v1beta1.Endpoint // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Endpoint{}). + For(&v1beta1.Endpoint{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Endpoint") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Endpoint") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.EndpointList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.EndpointList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.EndpointList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.EndpointList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Endpoint_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Endpoint_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Endpoint{}, eventHandler). + Watches(&v1beta1.Endpoint{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cdn/frontdoorcustomdomain/zz_controller.go b/internal/controller/cdn/frontdoorcustomdomain/zz_controller.go index e8b47913b..8fd374927 100755 --- a/internal/controller/cdn/frontdoorcustomdomain/zz_controller.go +++ b/internal/controller/cdn/frontdoorcustomdomain/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cdn/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles FrontdoorCustomDomain managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.FrontdoorCustomDomain_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.FrontdoorCustomDomain_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", v1beta2.FrontdoorCustomDomain_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.FrontdoorCustomDomain_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorCustomDomain_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorCustomDomain_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_custom_domain"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.FrontdoorCustomDomain_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorCustomDomain_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.FrontdoorCustomDomain + // register webhooks for the kind v1beta1.FrontdoorCustomDomain // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.FrontdoorCustomDomain{}). + For(&v1beta1.FrontdoorCustomDomain{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.FrontdoorCustomDomain") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.FrontdoorCustomDomain") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FrontdoorCustomDomainList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FrontdoorCustomDomainList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FrontdoorCustomDomainList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FrontdoorCustomDomainList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.FrontdoorCustomDomain_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FrontdoorCustomDomain_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.FrontdoorCustomDomain{}, eventHandler). + Watches(&v1beta1.FrontdoorCustomDomain{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cdn/frontdoororigin/zz_controller.go b/internal/controller/cdn/frontdoororigin/zz_controller.go index d98662171..8569461fa 100755 --- a/internal/controller/cdn/frontdoororigin/zz_controller.go +++ b/internal/controller/cdn/frontdoororigin/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cdn/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles FrontdoorOrigin managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.FrontdoorOrigin_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.FrontdoorOrigin_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", v1beta2.FrontdoorOrigin_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.FrontdoorOrigin_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorOrigin_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorOrigin_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_origin"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.FrontdoorOrigin_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorOrigin_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.FrontdoorOrigin + // register webhooks for the kind v1beta1.FrontdoorOrigin // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.FrontdoorOrigin{}). + For(&v1beta1.FrontdoorOrigin{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.FrontdoorOrigin") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.FrontdoorOrigin") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FrontdoorOriginList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FrontdoorOriginList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FrontdoorOriginList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FrontdoorOriginList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.FrontdoorOrigin_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FrontdoorOrigin_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.FrontdoorOrigin{}, eventHandler). + Watches(&v1beta1.FrontdoorOrigin{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cdn/frontdoororigingroup/zz_controller.go b/internal/controller/cdn/frontdoororigingroup/zz_controller.go index 574019a5e..f6b9fa42e 100755 --- a/internal/controller/cdn/frontdoororigingroup/zz_controller.go +++ b/internal/controller/cdn/frontdoororigingroup/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cdn/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles FrontdoorOriginGroup managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.FrontdoorOriginGroup_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.FrontdoorOriginGroup_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", v1beta2.FrontdoorOriginGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.FrontdoorOriginGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorOriginGroup_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorOriginGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_origin_group"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.FrontdoorOriginGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorOriginGroup_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.FrontdoorOriginGroup + // register webhooks for the kind v1beta1.FrontdoorOriginGroup // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.FrontdoorOriginGroup{}). + For(&v1beta1.FrontdoorOriginGroup{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.FrontdoorOriginGroup") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.FrontdoorOriginGroup") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FrontdoorOriginGroupList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FrontdoorOriginGroupList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FrontdoorOriginGroupList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FrontdoorOriginGroupList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.FrontdoorOriginGroup_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FrontdoorOriginGroup_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.FrontdoorOriginGroup{}, eventHandler). + Watches(&v1beta1.FrontdoorOriginGroup{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cdn/frontdoorroute/zz_controller.go b/internal/controller/cdn/frontdoorroute/zz_controller.go index a386b6607..c80235c58 100755 --- a/internal/controller/cdn/frontdoorroute/zz_controller.go +++ b/internal/controller/cdn/frontdoorroute/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cdn/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles FrontdoorRoute managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.FrontdoorRoute_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.FrontdoorRoute_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", v1beta2.FrontdoorRoute_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.FrontdoorRoute_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorRoute_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorRoute_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_route"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.FrontdoorRoute_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorRoute_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.FrontdoorRoute + // register webhooks for the kind v1beta1.FrontdoorRoute // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.FrontdoorRoute{}). + For(&v1beta1.FrontdoorRoute{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.FrontdoorRoute") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.FrontdoorRoute") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FrontdoorRouteList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FrontdoorRouteList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FrontdoorRouteList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FrontdoorRouteList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.FrontdoorRoute_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FrontdoorRoute_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.FrontdoorRoute{}, eventHandler). + Watches(&v1beta1.FrontdoorRoute{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cdn/frontdoorrule/zz_controller.go b/internal/controller/cdn/frontdoorrule/zz_controller.go index 326174f39..dcd9bf681 100755 --- a/internal/controller/cdn/frontdoorrule/zz_controller.go +++ b/internal/controller/cdn/frontdoorrule/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cdn/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles FrontdoorRule managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.FrontdoorRule_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.FrontdoorRule_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", v1beta2.FrontdoorRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.FrontdoorRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorRule_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_rule"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.FrontdoorRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorRule_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.FrontdoorRule + // register webhooks for the kind v1beta1.FrontdoorRule // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.FrontdoorRule{}). + For(&v1beta1.FrontdoorRule{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.FrontdoorRule") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.FrontdoorRule") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FrontdoorRuleList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FrontdoorRuleList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FrontdoorRuleList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FrontdoorRuleList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.FrontdoorRule_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FrontdoorRule_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.FrontdoorRule{}, eventHandler). + Watches(&v1beta1.FrontdoorRule{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cdn/frontdoorsecuritypolicy/zz_controller.go b/internal/controller/cdn/frontdoorsecuritypolicy/zz_controller.go index fb040de25..34641a125 100755 --- a/internal/controller/cdn/frontdoorsecuritypolicy/zz_controller.go +++ b/internal/controller/cdn/frontdoorsecuritypolicy/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cdn/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cdn/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles FrontdoorSecurityPolicy managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.FrontdoorSecurityPolicy_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.FrontdoorSecurityPolicy_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", v1beta2.FrontdoorSecurityPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.FrontdoorSecurityPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorSecurityPolicy_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorSecurityPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cdn_frontdoor_security_policy"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.FrontdoorSecurityPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorSecurityPolicy_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.FrontdoorSecurityPolicy + // register webhooks for the kind v1beta1.FrontdoorSecurityPolicy // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.FrontdoorSecurityPolicy{}). + For(&v1beta1.FrontdoorSecurityPolicy{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.FrontdoorSecurityPolicy") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.FrontdoorSecurityPolicy") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FrontdoorSecurityPolicyList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FrontdoorSecurityPolicyList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FrontdoorSecurityPolicyList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FrontdoorSecurityPolicyList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.FrontdoorSecurityPolicy_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FrontdoorSecurityPolicy_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.FrontdoorSecurityPolicy{}, eventHandler). + Watches(&v1beta1.FrontdoorSecurityPolicy{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cognitiveservices/account/zz_controller.go b/internal/controller/cognitiveservices/account/zz_controller.go index a793756f1..17bdbdd05 100755 --- a/internal/controller/cognitiveservices/account/zz_controller.go +++ b/internal/controller/cognitiveservices/account/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cognitiveservices/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cognitiveservices/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Account managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Account_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Account_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", v1beta2.Account_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Account_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cognitive_account"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Account_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Account_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Account + // register webhooks for the kind v1beta1.Account // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Account{}). + For(&v1beta1.Account{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Account") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Account") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.AccountList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.AccountList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.AccountList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.AccountList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Account_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Account{}, eventHandler). + Watches(&v1beta1.Account{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cognitiveservices/deployment/zz_controller.go b/internal/controller/cognitiveservices/deployment/zz_controller.go index af90dab9a..fe38e7412 100755 --- a/internal/controller/cognitiveservices/deployment/zz_controller.go +++ b/internal/controller/cognitiveservices/deployment/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cognitiveservices/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cognitiveservices/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Deployment managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Deployment_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Deployment_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", v1beta2.Deployment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Deployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Deployment_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Deployment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cognitive_deployment"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Deployment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Deployment_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Deployment + // register webhooks for the kind v1beta1.Deployment // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Deployment{}). + For(&v1beta1.Deployment{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Deployment") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Deployment") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.DeploymentList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.DeploymentList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.DeploymentList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.DeploymentList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Deployment_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Deployment_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Deployment{}, eventHandler). + Watches(&v1beta1.Deployment{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/compute/capacityreservation/zz_controller.go b/internal/controller/compute/capacityreservation/zz_controller.go index 71353f18b..12bb2b6ad 100755 --- a/internal/controller/compute/capacityreservation/zz_controller.go +++ b/internal/controller/compute/capacityreservation/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/compute/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles CapacityReservation managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.CapacityReservation_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.CapacityReservation_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", v1beta2.CapacityReservation_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.CapacityReservation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CapacityReservation_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CapacityReservation_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_capacity_reservation"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.CapacityReservation_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CapacityReservation_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.CapacityReservation + // register webhooks for the kind v1beta1.CapacityReservation // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.CapacityReservation{}). + For(&v1beta1.CapacityReservation{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.CapacityReservation") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.CapacityReservation") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.CapacityReservationList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.CapacityReservationList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.CapacityReservationList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.CapacityReservationList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.CapacityReservation_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.CapacityReservation_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.CapacityReservation{}, eventHandler). + Watches(&v1beta1.CapacityReservation{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/compute/diskencryptionset/zz_controller.go b/internal/controller/compute/diskencryptionset/zz_controller.go index c481f1b87..14c732701 100755 --- a/internal/controller/compute/diskencryptionset/zz_controller.go +++ b/internal/controller/compute/diskencryptionset/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/compute/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles DiskEncryptionSet managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.DiskEncryptionSet_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.DiskEncryptionSet_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", v1beta2.DiskEncryptionSet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.DiskEncryptionSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DiskEncryptionSet_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DiskEncryptionSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_disk_encryption_set"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.DiskEncryptionSet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DiskEncryptionSet_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.DiskEncryptionSet + // register webhooks for the kind v1beta1.DiskEncryptionSet // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.DiskEncryptionSet{}). + For(&v1beta1.DiskEncryptionSet{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.DiskEncryptionSet") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.DiskEncryptionSet") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.DiskEncryptionSetList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.DiskEncryptionSetList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.DiskEncryptionSetList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.DiskEncryptionSetList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.DiskEncryptionSet_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.DiskEncryptionSet_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.DiskEncryptionSet{}, eventHandler). + Watches(&v1beta1.DiskEncryptionSet{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/compute/galleryapplicationversion/zz_controller.go b/internal/controller/compute/galleryapplicationversion/zz_controller.go index 83e828501..7366daa18 100755 --- a/internal/controller/compute/galleryapplicationversion/zz_controller.go +++ b/internal/controller/compute/galleryapplicationversion/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/compute/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles GalleryApplicationVersion managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.GalleryApplicationVersion_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.GalleryApplicationVersion_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.GalleryApplicationVersion_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.GalleryApplicationVersion_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.GalleryApplicationVersion_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GalleryApplicationVersion_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_gallery_application_version"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.GalleryApplicationVersion_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.GalleryApplicationVersion_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.GalleryApplicationVersion + // register webhooks for the kind v1beta1.GalleryApplicationVersion // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.GalleryApplicationVersion{}). + For(&v1beta1.GalleryApplicationVersion{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.GalleryApplicationVersion") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.GalleryApplicationVersion") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.GalleryApplicationVersionList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.GalleryApplicationVersionList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.GalleryApplicationVersionList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.GalleryApplicationVersionList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.GalleryApplicationVersion_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.GalleryApplicationVersion_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.GalleryApplicationVersion{}, eventHandler). + Watches(&v1beta1.GalleryApplicationVersion{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/compute/image/zz_controller.go b/internal/controller/compute/image/zz_controller.go index 005f3811f..3bbad692a 100755 --- a/internal/controller/compute/image/zz_controller.go +++ b/internal/controller/compute/image/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/compute/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Image managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Image_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Image_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", v1beta2.Image_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Image_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Image_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Image_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_image"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Image_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Image_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Image + // register webhooks for the kind v1beta1.Image // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Image{}). + For(&v1beta1.Image{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Image") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Image") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ImageList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ImageList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ImageList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ImageList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Image_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Image_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Image{}, eventHandler). + Watches(&v1beta1.Image{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/compute/linuxvirtualmachine/zz_controller.go b/internal/controller/compute/linuxvirtualmachine/zz_controller.go index 5d0484311..25ac1d479 100755 --- a/internal/controller/compute/linuxvirtualmachine/zz_controller.go +++ b/internal/controller/compute/linuxvirtualmachine/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/compute/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinuxVirtualMachine managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinuxVirtualMachine_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinuxVirtualMachine_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", v1beta2.LinuxVirtualMachine_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinuxVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinuxVirtualMachine_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_linux_virtual_machine"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinuxVirtualMachine_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinuxVirtualMachine_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinuxVirtualMachine + // register webhooks for the kind v1beta1.LinuxVirtualMachine // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinuxVirtualMachine{}). + For(&v1beta1.LinuxVirtualMachine{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinuxVirtualMachine") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinuxVirtualMachine") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinuxVirtualMachineList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinuxVirtualMachineList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinuxVirtualMachineList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinuxVirtualMachineList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinuxVirtualMachine_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinuxVirtualMachine_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinuxVirtualMachine{}, eventHandler). + Watches(&v1beta1.LinuxVirtualMachine{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/compute/linuxvirtualmachinescaleset/zz_controller.go b/internal/controller/compute/linuxvirtualmachinescaleset/zz_controller.go index 748cf2ae2..814a66afe 100755 --- a/internal/controller/compute/linuxvirtualmachinescaleset/zz_controller.go +++ b/internal/controller/compute/linuxvirtualmachinescaleset/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/compute/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinuxVirtualMachineScaleSet managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinuxVirtualMachineScaleSet_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinuxVirtualMachineScaleSet_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", v1beta2.LinuxVirtualMachineScaleSet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinuxVirtualMachineScaleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinuxVirtualMachineScaleSet_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxVirtualMachineScaleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_linux_virtual_machine_scale_set"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinuxVirtualMachineScaleSet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinuxVirtualMachineScaleSet_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinuxVirtualMachineScaleSet + // register webhooks for the kind v1beta1.LinuxVirtualMachineScaleSet // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinuxVirtualMachineScaleSet{}). + For(&v1beta1.LinuxVirtualMachineScaleSet{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinuxVirtualMachineScaleSet") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinuxVirtualMachineScaleSet") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinuxVirtualMachineScaleSetList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinuxVirtualMachineScaleSetList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinuxVirtualMachineScaleSetList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinuxVirtualMachineScaleSetList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinuxVirtualMachineScaleSet_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinuxVirtualMachineScaleSet_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinuxVirtualMachineScaleSet{}, eventHandler). + Watches(&v1beta1.LinuxVirtualMachineScaleSet{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/compute/manageddisk/zz_controller.go b/internal/controller/compute/manageddisk/zz_controller.go index 4392e9033..24cf7a568 100755 --- a/internal/controller/compute/manageddisk/zz_controller.go +++ b/internal/controller/compute/manageddisk/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/compute/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ManagedDisk managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ManagedDisk_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ManagedDisk_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", v1beta2.ManagedDisk_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ManagedDisk_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagedDisk_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedDisk_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_managed_disk"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ManagedDisk_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagedDisk_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ManagedDisk + // register webhooks for the kind v1beta1.ManagedDisk // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ManagedDisk{}). + For(&v1beta1.ManagedDisk{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ManagedDisk") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ManagedDisk") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ManagedDiskList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ManagedDiskList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ManagedDiskList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ManagedDiskList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ManagedDisk_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ManagedDisk_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ManagedDisk{}, eventHandler). + Watches(&v1beta1.ManagedDisk{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/compute/orchestratedvirtualmachinescaleset/zz_controller.go b/internal/controller/compute/orchestratedvirtualmachinescaleset/zz_controller.go index b6037987a..c77c252d1 100755 --- a/internal/controller/compute/orchestratedvirtualmachinescaleset/zz_controller.go +++ b/internal/controller/compute/orchestratedvirtualmachinescaleset/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/compute/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles OrchestratedVirtualMachineScaleSet managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.OrchestratedVirtualMachineScaleSet_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.OrchestratedVirtualMachineScaleSet_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", v1beta2.OrchestratedVirtualMachineScaleSet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.OrchestratedVirtualMachineScaleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.OrchestratedVirtualMachineScaleSet_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OrchestratedVirtualMachineScaleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_orchestrated_virtual_machine_scale_set"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.OrchestratedVirtualMachineScaleSet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.OrchestratedVirtualMachineScaleSet_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.OrchestratedVirtualMachineScaleSet + // register webhooks for the kind v1beta1.OrchestratedVirtualMachineScaleSet // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.OrchestratedVirtualMachineScaleSet{}). + For(&v1beta1.OrchestratedVirtualMachineScaleSet{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.OrchestratedVirtualMachineScaleSet") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.OrchestratedVirtualMachineScaleSet") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.OrchestratedVirtualMachineScaleSetList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.OrchestratedVirtualMachineScaleSetList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.OrchestratedVirtualMachineScaleSetList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.OrchestratedVirtualMachineScaleSetList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.OrchestratedVirtualMachineScaleSet_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.OrchestratedVirtualMachineScaleSet_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.OrchestratedVirtualMachineScaleSet{}, eventHandler). + Watches(&v1beta1.OrchestratedVirtualMachineScaleSet{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/compute/sharedimage/zz_controller.go b/internal/controller/compute/sharedimage/zz_controller.go index 5677bbea8..e4aabc454 100755 --- a/internal/controller/compute/sharedimage/zz_controller.go +++ b/internal/controller/compute/sharedimage/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/compute/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SharedImage managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SharedImage_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SharedImage_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", v1beta2.SharedImage_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SharedImage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SharedImage_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SharedImage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_shared_image"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SharedImage_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SharedImage_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SharedImage + // register webhooks for the kind v1beta1.SharedImage // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SharedImage{}). + For(&v1beta1.SharedImage{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SharedImage") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SharedImage") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SharedImageList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SharedImageList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SharedImageList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SharedImageList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SharedImage_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SharedImage_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SharedImage{}, eventHandler). + Watches(&v1beta1.SharedImage{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/compute/sharedimagegallery/zz_controller.go b/internal/controller/compute/sharedimagegallery/zz_controller.go index c2cf67549..bbe354dae 100755 --- a/internal/controller/compute/sharedimagegallery/zz_controller.go +++ b/internal/controller/compute/sharedimagegallery/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/compute/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SharedImageGallery managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SharedImageGallery_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SharedImageGallery_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", v1beta2.SharedImageGallery_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SharedImageGallery_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SharedImageGallery_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SharedImageGallery_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_shared_image_gallery"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SharedImageGallery_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SharedImageGallery_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SharedImageGallery + // register webhooks for the kind v1beta1.SharedImageGallery // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SharedImageGallery{}). + For(&v1beta1.SharedImageGallery{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SharedImageGallery") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SharedImageGallery") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SharedImageGalleryList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SharedImageGalleryList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SharedImageGalleryList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SharedImageGalleryList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SharedImageGallery_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SharedImageGallery_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SharedImageGallery{}, eventHandler). + Watches(&v1beta1.SharedImageGallery{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/compute/snapshot/zz_controller.go b/internal/controller/compute/snapshot/zz_controller.go index a79779691..1b95e2f7d 100755 --- a/internal/controller/compute/snapshot/zz_controller.go +++ b/internal/controller/compute/snapshot/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/compute/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Snapshot managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Snapshot_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Snapshot_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", v1beta2.Snapshot_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Snapshot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Snapshot_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Snapshot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_snapshot"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Snapshot_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Snapshot_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Snapshot + // register webhooks for the kind v1beta1.Snapshot // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Snapshot{}). + For(&v1beta1.Snapshot{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Snapshot") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Snapshot") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SnapshotList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SnapshotList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SnapshotList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SnapshotList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Snapshot_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Snapshot_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Snapshot{}, eventHandler). + Watches(&v1beta1.Snapshot{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/compute/virtualmachineextension/zz_controller.go b/internal/controller/compute/virtualmachineextension/zz_controller.go index 7a378286d..22f692406 100755 --- a/internal/controller/compute/virtualmachineextension/zz_controller.go +++ b/internal/controller/compute/virtualmachineextension/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/compute/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles VirtualMachineExtension managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.VirtualMachineExtension_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.VirtualMachineExtension_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", v1beta2.VirtualMachineExtension_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.VirtualMachineExtension_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualMachineExtension_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualMachineExtension_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_machine_extension"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.VirtualMachineExtension_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualMachineExtension_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.VirtualMachineExtension + // register webhooks for the kind v1beta1.VirtualMachineExtension // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.VirtualMachineExtension{}). + For(&v1beta1.VirtualMachineExtension{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.VirtualMachineExtension") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.VirtualMachineExtension") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.VirtualMachineExtensionList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.VirtualMachineExtensionList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.VirtualMachineExtensionList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.VirtualMachineExtensionList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.VirtualMachineExtension_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.VirtualMachineExtension_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.VirtualMachineExtension{}, eventHandler). + Watches(&v1beta1.VirtualMachineExtension{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/compute/windowsvirtualmachine/zz_controller.go b/internal/controller/compute/windowsvirtualmachine/zz_controller.go index d6747591b..35084d342 100755 --- a/internal/controller/compute/windowsvirtualmachine/zz_controller.go +++ b/internal/controller/compute/windowsvirtualmachine/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/compute/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles WindowsVirtualMachine managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.WindowsVirtualMachine_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.WindowsVirtualMachine_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", v1beta2.WindowsVirtualMachine_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.WindowsVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WindowsVirtualMachine_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_windows_virtual_machine"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.WindowsVirtualMachine_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WindowsVirtualMachine_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.WindowsVirtualMachine + // register webhooks for the kind v1beta1.WindowsVirtualMachine // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.WindowsVirtualMachine{}). + For(&v1beta1.WindowsVirtualMachine{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.WindowsVirtualMachine") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.WindowsVirtualMachine") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WindowsVirtualMachineList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WindowsVirtualMachineList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WindowsVirtualMachineList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WindowsVirtualMachineList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.WindowsVirtualMachine_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.WindowsVirtualMachine_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.WindowsVirtualMachine{}, eventHandler). + Watches(&v1beta1.WindowsVirtualMachine{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/compute/windowsvirtualmachinescaleset/zz_controller.go b/internal/controller/compute/windowsvirtualmachinescaleset/zz_controller.go index 1ecac966a..f141398b9 100755 --- a/internal/controller/compute/windowsvirtualmachinescaleset/zz_controller.go +++ b/internal/controller/compute/windowsvirtualmachinescaleset/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/compute/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/compute/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles WindowsVirtualMachineScaleSet managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.WindowsVirtualMachineScaleSet_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.WindowsVirtualMachineScaleSet_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", v1beta2.WindowsVirtualMachineScaleSet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.WindowsVirtualMachineScaleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WindowsVirtualMachineScaleSet_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsVirtualMachineScaleSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_windows_virtual_machine_scale_set"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.WindowsVirtualMachineScaleSet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WindowsVirtualMachineScaleSet_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.WindowsVirtualMachineScaleSet + // register webhooks for the kind v1beta1.WindowsVirtualMachineScaleSet // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.WindowsVirtualMachineScaleSet{}). + For(&v1beta1.WindowsVirtualMachineScaleSet{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.WindowsVirtualMachineScaleSet") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.WindowsVirtualMachineScaleSet") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WindowsVirtualMachineScaleSetList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WindowsVirtualMachineScaleSetList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WindowsVirtualMachineScaleSetList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WindowsVirtualMachineScaleSetList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.WindowsVirtualMachineScaleSet_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.WindowsVirtualMachineScaleSet_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.WindowsVirtualMachineScaleSet{}, eventHandler). + Watches(&v1beta1.WindowsVirtualMachineScaleSet{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/consumption/budgetmanagementgroup/zz_controller.go b/internal/controller/consumption/budgetmanagementgroup/zz_controller.go index d8d626951..20241ea54 100755 --- a/internal/controller/consumption/budgetmanagementgroup/zz_controller.go +++ b/internal/controller/consumption/budgetmanagementgroup/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/consumption/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/consumption/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles BudgetManagementGroup managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.BudgetManagementGroup_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.BudgetManagementGroup_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.BudgetManagementGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.BudgetManagementGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BudgetManagementGroup_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BudgetManagementGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_consumption_budget_management_group"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.BudgetManagementGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BudgetManagementGroup_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.BudgetManagementGroup + // register webhooks for the kind v1beta1.BudgetManagementGroup // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.BudgetManagementGroup{}). + For(&v1beta1.BudgetManagementGroup{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.BudgetManagementGroup") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.BudgetManagementGroup") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.BudgetManagementGroupList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.BudgetManagementGroupList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.BudgetManagementGroupList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.BudgetManagementGroupList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.BudgetManagementGroup_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.BudgetManagementGroup_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.BudgetManagementGroup{}, eventHandler). + Watches(&v1beta1.BudgetManagementGroup{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/consumption/budgetresourcegroup/zz_controller.go b/internal/controller/consumption/budgetresourcegroup/zz_controller.go index 7f6cb8b81..819544ffe 100755 --- a/internal/controller/consumption/budgetresourcegroup/zz_controller.go +++ b/internal/controller/consumption/budgetresourcegroup/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/consumption/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/consumption/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles BudgetResourceGroup managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.BudgetResourceGroup_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.BudgetResourceGroup_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.BudgetResourceGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.BudgetResourceGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BudgetResourceGroup_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BudgetResourceGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_consumption_budget_resource_group"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.BudgetResourceGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BudgetResourceGroup_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.BudgetResourceGroup + // register webhooks for the kind v1beta1.BudgetResourceGroup // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.BudgetResourceGroup{}). + For(&v1beta1.BudgetResourceGroup{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.BudgetResourceGroup") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.BudgetResourceGroup") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.BudgetResourceGroupList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.BudgetResourceGroupList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.BudgetResourceGroupList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.BudgetResourceGroupList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.BudgetResourceGroup_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.BudgetResourceGroup_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.BudgetResourceGroup{}, eventHandler). + Watches(&v1beta1.BudgetResourceGroup{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/consumption/budgetsubscription/zz_controller.go b/internal/controller/consumption/budgetsubscription/zz_controller.go index 40fe50492..6f747fafc 100755 --- a/internal/controller/consumption/budgetsubscription/zz_controller.go +++ b/internal/controller/consumption/budgetsubscription/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/consumption/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/consumption/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles BudgetSubscription managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.BudgetSubscription_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.BudgetSubscription_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", v1beta2.BudgetSubscription_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.BudgetSubscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BudgetSubscription_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BudgetSubscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_consumption_budget_subscription"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.BudgetSubscription_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BudgetSubscription_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.BudgetSubscription + // register webhooks for the kind v1beta1.BudgetSubscription // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.BudgetSubscription{}). + For(&v1beta1.BudgetSubscription{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.BudgetSubscription") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.BudgetSubscription") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.BudgetSubscriptionList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.BudgetSubscriptionList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.BudgetSubscriptionList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.BudgetSubscriptionList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.BudgetSubscription_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.BudgetSubscription_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.BudgetSubscription{}, eventHandler). + Watches(&v1beta1.BudgetSubscription{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/containerapp/containerapp/zz_controller.go b/internal/controller/containerapp/containerapp/zz_controller.go index 31a377494..164a598fa 100755 --- a/internal/controller/containerapp/containerapp/zz_controller.go +++ b/internal/controller/containerapp/containerapp/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/containerapp/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/containerapp/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ContainerApp managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ContainerApp_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ContainerApp_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", v1beta2.ContainerApp_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ContainerApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ContainerApp_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ContainerApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_container_app"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ContainerApp_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ContainerApp_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ContainerApp + // register webhooks for the kind v1beta1.ContainerApp // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ContainerApp{}). + For(&v1beta1.ContainerApp{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ContainerApp") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ContainerApp") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ContainerAppList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ContainerAppList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ContainerAppList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ContainerAppList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ContainerApp_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ContainerApp_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ContainerApp{}, eventHandler). + Watches(&v1beta1.ContainerApp{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/containerregistry/registry/zz_controller.go b/internal/controller/containerregistry/registry/zz_controller.go index 17eb4762d..5f681163f 100755 --- a/internal/controller/containerregistry/registry/zz_controller.go +++ b/internal/controller/containerregistry/registry/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/containerregistry/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/containerregistry/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Registry managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Registry_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Registry_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", v1beta2.Registry_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Registry_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Registry_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Registry_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_container_registry"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Registry_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Registry_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Registry + // register webhooks for the kind v1beta1.Registry // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Registry{}). + For(&v1beta1.Registry{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Registry") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Registry") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.RegistryList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.RegistryList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.RegistryList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.RegistryList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Registry_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Registry_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Registry{}, eventHandler). + Watches(&v1beta1.Registry{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/containerregistry/tokenpassword/zz_controller.go b/internal/controller/containerregistry/tokenpassword/zz_controller.go index f48a15b8b..7a1926de3 100755 --- a/internal/controller/containerregistry/tokenpassword/zz_controller.go +++ b/internal/controller/containerregistry/tokenpassword/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/containerregistry/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/containerregistry/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles TokenPassword managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.TokenPassword_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.TokenPassword_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.TokenPassword_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.TokenPassword_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.TokenPassword_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TokenPassword_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_container_registry_token_password"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.TokenPassword_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.TokenPassword_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.TokenPassword + // register webhooks for the kind v1beta1.TokenPassword // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.TokenPassword{}). + For(&v1beta1.TokenPassword{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.TokenPassword") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.TokenPassword") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.TokenPasswordList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.TokenPasswordList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.TokenPasswordList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.TokenPasswordList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.TokenPassword_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.TokenPassword_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.TokenPassword{}, eventHandler). + Watches(&v1beta1.TokenPassword{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/containerservice/kubernetescluster/zz_controller.go b/internal/controller/containerservice/kubernetescluster/zz_controller.go index de7cca69b..6d1985f5d 100755 --- a/internal/controller/containerservice/kubernetescluster/zz_controller.go +++ b/internal/controller/containerservice/kubernetescluster/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/containerservice/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/containerservice/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles KubernetesCluster managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.KubernetesCluster_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.KubernetesCluster_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", v1beta2.KubernetesCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.KubernetesCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.KubernetesCluster_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.KubernetesCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kubernetes_cluster"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.KubernetesCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.KubernetesCluster_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.KubernetesCluster + // register webhooks for the kind v1beta1.KubernetesCluster // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.KubernetesCluster{}). + For(&v1beta1.KubernetesCluster{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.KubernetesCluster") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.KubernetesCluster") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.KubernetesClusterList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.KubernetesClusterList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.KubernetesClusterList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.KubernetesClusterList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.KubernetesCluster_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.KubernetesCluster_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.KubernetesCluster{}, eventHandler). + Watches(&v1beta1.KubernetesCluster{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/containerservice/kubernetesclusternodepool/zz_controller.go b/internal/controller/containerservice/kubernetesclusternodepool/zz_controller.go index a35c4ec79..7193e69dc 100755 --- a/internal/controller/containerservice/kubernetesclusternodepool/zz_controller.go +++ b/internal/controller/containerservice/kubernetesclusternodepool/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/containerservice/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/containerservice/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles KubernetesClusterNodePool managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.KubernetesClusterNodePool_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.KubernetesClusterNodePool_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", v1beta2.KubernetesClusterNodePool_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.KubernetesClusterNodePool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.KubernetesClusterNodePool_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.KubernetesClusterNodePool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kubernetes_cluster_node_pool"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.KubernetesClusterNodePool_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.KubernetesClusterNodePool_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.KubernetesClusterNodePool + // register webhooks for the kind v1beta1.KubernetesClusterNodePool // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.KubernetesClusterNodePool{}). + For(&v1beta1.KubernetesClusterNodePool{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.KubernetesClusterNodePool") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.KubernetesClusterNodePool") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.KubernetesClusterNodePoolList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.KubernetesClusterNodePoolList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.KubernetesClusterNodePoolList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.KubernetesClusterNodePoolList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.KubernetesClusterNodePool_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.KubernetesClusterNodePool_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.KubernetesClusterNodePool{}, eventHandler). + Watches(&v1beta1.KubernetesClusterNodePool{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/containerservice/kubernetesfleetmanager/zz_controller.go b/internal/controller/containerservice/kubernetesfleetmanager/zz_controller.go index b96f4ac0e..3a70924af 100755 --- a/internal/controller/containerservice/kubernetesfleetmanager/zz_controller.go +++ b/internal/controller/containerservice/kubernetesfleetmanager/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/containerservice/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/containerservice/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles KubernetesFleetManager managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.KubernetesFleetManager_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.KubernetesFleetManager_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", v1beta2.KubernetesFleetManager_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.KubernetesFleetManager_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.KubernetesFleetManager_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.KubernetesFleetManager_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kubernetes_fleet_manager"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.KubernetesFleetManager_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.KubernetesFleetManager_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.KubernetesFleetManager + // register webhooks for the kind v1beta1.KubernetesFleetManager // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.KubernetesFleetManager{}). + For(&v1beta1.KubernetesFleetManager{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.KubernetesFleetManager") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.KubernetesFleetManager") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.KubernetesFleetManagerList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.KubernetesFleetManagerList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.KubernetesFleetManagerList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.KubernetesFleetManagerList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.KubernetesFleetManager_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.KubernetesFleetManager_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.KubernetesFleetManager{}, eventHandler). + Watches(&v1beta1.KubernetesFleetManager{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cosmosdb/account/zz_controller.go b/internal/controller/cosmosdb/account/zz_controller.go index 81ea40320..211f3aaba 100755 --- a/internal/controller/cosmosdb/account/zz_controller.go +++ b/internal/controller/cosmosdb/account/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Account managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Account_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Account_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", v1beta2.Account_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Account_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_account"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Account_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Account_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Account + // register webhooks for the kind v1beta1.Account // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Account{}). + For(&v1beta1.Account{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Account") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Account") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.AccountList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.AccountList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.AccountList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.AccountList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Account_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Account{}, eventHandler). + Watches(&v1beta1.Account{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cosmosdb/cassandracluster/zz_controller.go b/internal/controller/cosmosdb/cassandracluster/zz_controller.go index 8635fa483..ae86d37f3 100755 --- a/internal/controller/cosmosdb/cassandracluster/zz_controller.go +++ b/internal/controller/cosmosdb/cassandracluster/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles CassandraCluster managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.CassandraCluster_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.CassandraCluster_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", v1beta2.CassandraCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.CassandraCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CassandraCluster_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CassandraCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_cassandra_cluster"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.CassandraCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CassandraCluster_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.CassandraCluster + // register webhooks for the kind v1beta1.CassandraCluster // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.CassandraCluster{}). + For(&v1beta1.CassandraCluster{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.CassandraCluster") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.CassandraCluster") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.CassandraClusterList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.CassandraClusterList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.CassandraClusterList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.CassandraClusterList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.CassandraCluster_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.CassandraCluster_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.CassandraCluster{}, eventHandler). + Watches(&v1beta1.CassandraCluster{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cosmosdb/cassandrakeyspace/zz_controller.go b/internal/controller/cosmosdb/cassandrakeyspace/zz_controller.go index 1d53dc7da..ad38b6db4 100755 --- a/internal/controller/cosmosdb/cassandrakeyspace/zz_controller.go +++ b/internal/controller/cosmosdb/cassandrakeyspace/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles CassandraKeySpace managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.CassandraKeySpace_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.CassandraKeySpace_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", v1beta2.CassandraKeySpace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.CassandraKeySpace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CassandraKeySpace_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CassandraKeySpace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_cassandra_keyspace"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.CassandraKeySpace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CassandraKeySpace_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.CassandraKeySpace + // register webhooks for the kind v1beta1.CassandraKeySpace // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.CassandraKeySpace{}). + For(&v1beta1.CassandraKeySpace{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.CassandraKeySpace") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.CassandraKeySpace") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.CassandraKeySpaceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.CassandraKeySpaceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.CassandraKeySpaceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.CassandraKeySpaceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.CassandraKeySpace_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.CassandraKeySpace_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.CassandraKeySpace{}, eventHandler). + Watches(&v1beta1.CassandraKeySpace{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cosmosdb/cassandratable/zz_controller.go b/internal/controller/cosmosdb/cassandratable/zz_controller.go index df4cfb886..1d76d6a3a 100755 --- a/internal/controller/cosmosdb/cassandratable/zz_controller.go +++ b/internal/controller/cosmosdb/cassandratable/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles CassandraTable managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.CassandraTable_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.CassandraTable_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", v1beta2.CassandraTable_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.CassandraTable_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CassandraTable_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CassandraTable_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_cassandra_table"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.CassandraTable_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CassandraTable_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.CassandraTable + // register webhooks for the kind v1beta1.CassandraTable // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.CassandraTable{}). + For(&v1beta1.CassandraTable{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.CassandraTable") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.CassandraTable") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.CassandraTableList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.CassandraTableList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.CassandraTableList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.CassandraTableList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.CassandraTable_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.CassandraTable_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.CassandraTable{}, eventHandler). + Watches(&v1beta1.CassandraTable{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cosmosdb/gremlindatabase/zz_controller.go b/internal/controller/cosmosdb/gremlindatabase/zz_controller.go index ffff2c2b1..3cd0b1253 100755 --- a/internal/controller/cosmosdb/gremlindatabase/zz_controller.go +++ b/internal/controller/cosmosdb/gremlindatabase/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles GremlinDatabase managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.GremlinDatabase_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.GremlinDatabase_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", v1beta2.GremlinDatabase_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.GremlinDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.GremlinDatabase_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GremlinDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_gremlin_database"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.GremlinDatabase_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.GremlinDatabase_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.GremlinDatabase + // register webhooks for the kind v1beta1.GremlinDatabase // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.GremlinDatabase{}). + For(&v1beta1.GremlinDatabase{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.GremlinDatabase") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.GremlinDatabase") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.GremlinDatabaseList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.GremlinDatabaseList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.GremlinDatabaseList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.GremlinDatabaseList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.GremlinDatabase_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.GremlinDatabase_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.GremlinDatabase{}, eventHandler). + Watches(&v1beta1.GremlinDatabase{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cosmosdb/gremlingraph/zz_controller.go b/internal/controller/cosmosdb/gremlingraph/zz_controller.go index e2728b766..f994c036d 100755 --- a/internal/controller/cosmosdb/gremlingraph/zz_controller.go +++ b/internal/controller/cosmosdb/gremlingraph/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles GremlinGraph managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.GremlinGraph_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.GremlinGraph_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", v1beta2.GremlinGraph_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.GremlinGraph_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.GremlinGraph_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GremlinGraph_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_gremlin_graph"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.GremlinGraph_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.GremlinGraph_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.GremlinGraph + // register webhooks for the kind v1beta1.GremlinGraph // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.GremlinGraph{}). + For(&v1beta1.GremlinGraph{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.GremlinGraph") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.GremlinGraph") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.GremlinGraphList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.GremlinGraphList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.GremlinGraphList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.GremlinGraphList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.GremlinGraph_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.GremlinGraph_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.GremlinGraph{}, eventHandler). + Watches(&v1beta1.GremlinGraph{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cosmosdb/mongocollection/zz_controller.go b/internal/controller/cosmosdb/mongocollection/zz_controller.go index 7e4f27f90..87ceb8d7d 100755 --- a/internal/controller/cosmosdb/mongocollection/zz_controller.go +++ b/internal/controller/cosmosdb/mongocollection/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MongoCollection managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MongoCollection_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MongoCollection_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", v1beta2.MongoCollection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MongoCollection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MongoCollection_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MongoCollection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_mongo_collection"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MongoCollection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MongoCollection_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MongoCollection + // register webhooks for the kind v1beta1.MongoCollection // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MongoCollection{}). + For(&v1beta1.MongoCollection{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MongoCollection") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MongoCollection") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MongoCollectionList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MongoCollectionList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MongoCollectionList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MongoCollectionList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MongoCollection_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MongoCollection_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MongoCollection{}, eventHandler). + Watches(&v1beta1.MongoCollection{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cosmosdb/mongodatabase/zz_controller.go b/internal/controller/cosmosdb/mongodatabase/zz_controller.go index e1fa9d69b..e7be09c42 100755 --- a/internal/controller/cosmosdb/mongodatabase/zz_controller.go +++ b/internal/controller/cosmosdb/mongodatabase/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MongoDatabase managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MongoDatabase_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MongoDatabase_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", v1beta2.MongoDatabase_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MongoDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MongoDatabase_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MongoDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_mongo_database"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MongoDatabase_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MongoDatabase_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MongoDatabase + // register webhooks for the kind v1beta1.MongoDatabase // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MongoDatabase{}). + For(&v1beta1.MongoDatabase{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MongoDatabase") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MongoDatabase") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MongoDatabaseList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MongoDatabaseList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MongoDatabaseList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MongoDatabaseList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MongoDatabase_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MongoDatabase_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MongoDatabase{}, eventHandler). + Watches(&v1beta1.MongoDatabase{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cosmosdb/sqlcontainer/zz_controller.go b/internal/controller/cosmosdb/sqlcontainer/zz_controller.go index 0d1b7a59c..6fdd3bc26 100755 --- a/internal/controller/cosmosdb/sqlcontainer/zz_controller.go +++ b/internal/controller/cosmosdb/sqlcontainer/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SQLContainer managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SQLContainer_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SQLContainer_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", v1beta2.SQLContainer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SQLContainer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SQLContainer_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLContainer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_container"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SQLContainer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SQLContainer_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SQLContainer + // register webhooks for the kind v1beta1.SQLContainer // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SQLContainer{}). + For(&v1beta1.SQLContainer{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SQLContainer") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SQLContainer") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SQLContainerList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SQLContainerList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SQLContainerList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SQLContainerList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SQLContainer_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SQLContainer_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SQLContainer{}, eventHandler). + Watches(&v1beta1.SQLContainer{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cosmosdb/sqldatabase/zz_controller.go b/internal/controller/cosmosdb/sqldatabase/zz_controller.go index 4048af88e..6832bcd2d 100755 --- a/internal/controller/cosmosdb/sqldatabase/zz_controller.go +++ b/internal/controller/cosmosdb/sqldatabase/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SQLDatabase managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SQLDatabase_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SQLDatabase_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", v1beta2.SQLDatabase_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SQLDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SQLDatabase_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_sql_database"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SQLDatabase_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SQLDatabase_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SQLDatabase + // register webhooks for the kind v1beta1.SQLDatabase // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SQLDatabase{}). + For(&v1beta1.SQLDatabase{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SQLDatabase") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SQLDatabase") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SQLDatabaseList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SQLDatabaseList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SQLDatabaseList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SQLDatabaseList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SQLDatabase_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SQLDatabase_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SQLDatabase{}, eventHandler). + Watches(&v1beta1.SQLDatabase{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/cosmosdb/table/zz_controller.go b/internal/controller/cosmosdb/table/zz_controller.go index fd337c9c1..be765ccb9 100755 --- a/internal/controller/cosmosdb/table/zz_controller.go +++ b/internal/controller/cosmosdb/table/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/cosmosdb/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Table managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Table_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Table_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", v1beta2.Table_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Table_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Table_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Table_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_cosmosdb_table"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Table_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Table_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Table + // register webhooks for the kind v1beta1.Table // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Table{}). + For(&v1beta1.Table{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Table") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Table") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.TableList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.TableList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.TableList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.TableList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Table_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Table_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Table{}, eventHandler). + Watches(&v1beta1.Table{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/costmanagement/resourcegroupcostmanagementexport/zz_controller.go b/internal/controller/costmanagement/resourcegroupcostmanagementexport/zz_controller.go index 0826cbf46..d1d09b00d 100755 --- a/internal/controller/costmanagement/resourcegroupcostmanagementexport/zz_controller.go +++ b/internal/controller/costmanagement/resourcegroupcostmanagementexport/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/costmanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/costmanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ResourceGroupCostManagementExport managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ResourceGroupCostManagementExport_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ResourceGroupCostManagementExport_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", v1beta2.ResourceGroupCostManagementExport_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ResourceGroupCostManagementExport_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ResourceGroupCostManagementExport_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceGroupCostManagementExport_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_resource_group_cost_management_export"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ResourceGroupCostManagementExport_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ResourceGroupCostManagementExport_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ResourceGroupCostManagementExport + // register webhooks for the kind v1beta1.ResourceGroupCostManagementExport // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ResourceGroupCostManagementExport{}). + For(&v1beta1.ResourceGroupCostManagementExport{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ResourceGroupCostManagementExport") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ResourceGroupCostManagementExport") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ResourceGroupCostManagementExportList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ResourceGroupCostManagementExportList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ResourceGroupCostManagementExportList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ResourceGroupCostManagementExportList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ResourceGroupCostManagementExport_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ResourceGroupCostManagementExport_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ResourceGroupCostManagementExport{}, eventHandler). + Watches(&v1beta1.ResourceGroupCostManagementExport{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/costmanagement/subscriptioncostmanagementexport/zz_controller.go b/internal/controller/costmanagement/subscriptioncostmanagementexport/zz_controller.go index ed96b8ceb..4adf18d55 100755 --- a/internal/controller/costmanagement/subscriptioncostmanagementexport/zz_controller.go +++ b/internal/controller/costmanagement/subscriptioncostmanagementexport/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/costmanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/costmanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SubscriptionCostManagementExport managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SubscriptionCostManagementExport_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SubscriptionCostManagementExport_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.SubscriptionCostManagementExport_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SubscriptionCostManagementExport_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SubscriptionCostManagementExport_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubscriptionCostManagementExport_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_subscription_cost_management_export"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SubscriptionCostManagementExport_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SubscriptionCostManagementExport_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SubscriptionCostManagementExport + // register webhooks for the kind v1beta1.SubscriptionCostManagementExport // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SubscriptionCostManagementExport{}). + For(&v1beta1.SubscriptionCostManagementExport{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SubscriptionCostManagementExport") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SubscriptionCostManagementExport") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SubscriptionCostManagementExportList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SubscriptionCostManagementExportList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SubscriptionCostManagementExportList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SubscriptionCostManagementExportList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SubscriptionCostManagementExport_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SubscriptionCostManagementExport_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SubscriptionCostManagementExport{}, eventHandler). + Watches(&v1beta1.SubscriptionCostManagementExport{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/databricks/accessconnector/zz_controller.go b/internal/controller/databricks/accessconnector/zz_controller.go index 2f4879e84..a90089445 100755 --- a/internal/controller/databricks/accessconnector/zz_controller.go +++ b/internal/controller/databricks/accessconnector/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/databricks/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/databricks/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles AccessConnector managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.AccessConnector_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.AccessConnector_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", v1beta2.AccessConnector_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.AccessConnector_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AccessConnector_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AccessConnector_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_databricks_access_connector"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.AccessConnector_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AccessConnector_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.AccessConnector + // register webhooks for the kind v1beta1.AccessConnector // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.AccessConnector{}). + For(&v1beta1.AccessConnector{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.AccessConnector") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.AccessConnector") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.AccessConnectorList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.AccessConnectorList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.AccessConnectorList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.AccessConnectorList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.AccessConnector_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.AccessConnector_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.AccessConnector{}, eventHandler). + Watches(&v1beta1.AccessConnector{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/databricks/workspace/zz_controller.go b/internal/controller/databricks/workspace/zz_controller.go index e147e4bb8..935bdc915 100755 --- a/internal/controller/databricks/workspace/zz_controller.go +++ b/internal/controller/databricks/workspace/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/databricks/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/databricks/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Workspace managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Workspace_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Workspace_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", v1beta2.Workspace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Workspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Workspace_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Workspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_databricks_workspace"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Workspace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Workspace_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Workspace + // register webhooks for the kind v1beta1.Workspace // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Workspace{}). + For(&v1beta1.Workspace{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Workspace") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Workspace") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WorkspaceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WorkspaceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WorkspaceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WorkspaceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Workspace_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Workspace_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Workspace{}, eventHandler). + Watches(&v1beta1.Workspace{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/customdataset/zz_controller.go b/internal/controller/datafactory/customdataset/zz_controller.go index c1e3efb79..2ac1eef3d 100755 --- a/internal/controller/datafactory/customdataset/zz_controller.go +++ b/internal/controller/datafactory/customdataset/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles CustomDataSet managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.CustomDataSet_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.CustomDataSet_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", v1beta2.CustomDataSet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.CustomDataSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CustomDataSet_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CustomDataSet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_custom_dataset"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.CustomDataSet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CustomDataSet_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.CustomDataSet + // register webhooks for the kind v1beta1.CustomDataSet // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.CustomDataSet{}). + For(&v1beta1.CustomDataSet{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.CustomDataSet") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.CustomDataSet") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.CustomDataSetList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.CustomDataSetList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.CustomDataSetList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.CustomDataSetList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.CustomDataSet_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.CustomDataSet_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.CustomDataSet{}, eventHandler). + Watches(&v1beta1.CustomDataSet{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/dataflow/zz_controller.go b/internal/controller/datafactory/dataflow/zz_controller.go index 5ed81bd79..79d409313 100755 --- a/internal/controller/datafactory/dataflow/zz_controller.go +++ b/internal/controller/datafactory/dataflow/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles DataFlow managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.DataFlow_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.DataFlow_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", v1beta2.DataFlow_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.DataFlow_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataFlow_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataFlow_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_data_flow"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.DataFlow_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataFlow_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.DataFlow + // register webhooks for the kind v1beta1.DataFlow // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.DataFlow{}). + For(&v1beta1.DataFlow{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.DataFlow") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.DataFlow") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.DataFlowList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.DataFlowList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.DataFlowList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.DataFlowList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.DataFlow_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.DataFlow_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.DataFlow{}, eventHandler). + Watches(&v1beta1.DataFlow{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/datasetbinary/zz_controller.go b/internal/controller/datafactory/datasetbinary/zz_controller.go index 66461a671..42953829b 100755 --- a/internal/controller/datafactory/datasetbinary/zz_controller.go +++ b/internal/controller/datafactory/datasetbinary/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles DataSetBinary managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.DataSetBinary_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.DataSetBinary_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", v1beta2.DataSetBinary_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.DataSetBinary_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetBinary_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetBinary_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_binary"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.DataSetBinary_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetBinary_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.DataSetBinary + // register webhooks for the kind v1beta1.DataSetBinary // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.DataSetBinary{}). + For(&v1beta1.DataSetBinary{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.DataSetBinary") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.DataSetBinary") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.DataSetBinaryList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.DataSetBinaryList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.DataSetBinaryList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.DataSetBinaryList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.DataSetBinary_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.DataSetBinary_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.DataSetBinary{}, eventHandler). + Watches(&v1beta1.DataSetBinary{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/datasetdelimitedtext/zz_controller.go b/internal/controller/datafactory/datasetdelimitedtext/zz_controller.go index 7cc4ce21d..355e1935f 100755 --- a/internal/controller/datafactory/datasetdelimitedtext/zz_controller.go +++ b/internal/controller/datafactory/datasetdelimitedtext/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles DataSetDelimitedText managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.DataSetDelimitedText_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.DataSetDelimitedText_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", v1beta2.DataSetDelimitedText_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.DataSetDelimitedText_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetDelimitedText_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetDelimitedText_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_delimited_text"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.DataSetDelimitedText_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetDelimitedText_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.DataSetDelimitedText + // register webhooks for the kind v1beta1.DataSetDelimitedText // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.DataSetDelimitedText{}). + For(&v1beta1.DataSetDelimitedText{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.DataSetDelimitedText") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.DataSetDelimitedText") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.DataSetDelimitedTextList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.DataSetDelimitedTextList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.DataSetDelimitedTextList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.DataSetDelimitedTextList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.DataSetDelimitedText_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.DataSetDelimitedText_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.DataSetDelimitedText{}, eventHandler). + Watches(&v1beta1.DataSetDelimitedText{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/datasetjson/zz_controller.go b/internal/controller/datafactory/datasetjson/zz_controller.go index 8b8e55839..556fa65ef 100755 --- a/internal/controller/datafactory/datasetjson/zz_controller.go +++ b/internal/controller/datafactory/datasetjson/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles DataSetJSON managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.DataSetJSON_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.DataSetJSON_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", v1beta2.DataSetJSON_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.DataSetJSON_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetJSON_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetJSON_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_json"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.DataSetJSON_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetJSON_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.DataSetJSON + // register webhooks for the kind v1beta1.DataSetJSON // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.DataSetJSON{}). + For(&v1beta1.DataSetJSON{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.DataSetJSON") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.DataSetJSON") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.DataSetJSONList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.DataSetJSONList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.DataSetJSONList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.DataSetJSONList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.DataSetJSON_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.DataSetJSON_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.DataSetJSON{}, eventHandler). + Watches(&v1beta1.DataSetJSON{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/datasetparquet/zz_controller.go b/internal/controller/datafactory/datasetparquet/zz_controller.go index a624b8c6c..d0044c740 100755 --- a/internal/controller/datafactory/datasetparquet/zz_controller.go +++ b/internal/controller/datafactory/datasetparquet/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles DataSetParquet managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.DataSetParquet_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.DataSetParquet_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", v1beta2.DataSetParquet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.DataSetParquet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetParquet_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetParquet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_dataset_parquet"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.DataSetParquet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetParquet_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.DataSetParquet + // register webhooks for the kind v1beta1.DataSetParquet // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.DataSetParquet{}). + For(&v1beta1.DataSetParquet{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.DataSetParquet") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.DataSetParquet") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.DataSetParquetList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.DataSetParquetList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.DataSetParquetList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.DataSetParquetList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.DataSetParquet_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.DataSetParquet_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.DataSetParquet{}, eventHandler). + Watches(&v1beta1.DataSetParquet{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/factory/zz_controller.go b/internal/controller/datafactory/factory/zz_controller.go index 95f536aa8..c9654b051 100755 --- a/internal/controller/datafactory/factory/zz_controller.go +++ b/internal/controller/datafactory/factory/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Factory managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Factory_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Factory_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", v1beta2.Factory_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Factory_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Factory_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Factory_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Factory_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Factory_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Factory + // register webhooks for the kind v1beta1.Factory // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Factory{}). + For(&v1beta1.Factory{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Factory") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Factory") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FactoryList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FactoryList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FactoryList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FactoryList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Factory_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Factory_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Factory{}, eventHandler). + Watches(&v1beta1.Factory{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/integrationruntimeazuressis/zz_controller.go b/internal/controller/datafactory/integrationruntimeazuressis/zz_controller.go index 04d702202..527436f6a 100755 --- a/internal/controller/datafactory/integrationruntimeazuressis/zz_controller.go +++ b/internal/controller/datafactory/integrationruntimeazuressis/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles IntegrationRuntimeAzureSSIS managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.IntegrationRuntimeAzureSSIS_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.IntegrationRuntimeAzureSSIS_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", v1beta2.IntegrationRuntimeAzureSSIS_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.IntegrationRuntimeAzureSSIS_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IntegrationRuntimeAzureSSIS_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IntegrationRuntimeAzureSSIS_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_integration_runtime_azure_ssis"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.IntegrationRuntimeAzureSSIS_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IntegrationRuntimeAzureSSIS_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.IntegrationRuntimeAzureSSIS + // register webhooks for the kind v1beta1.IntegrationRuntimeAzureSSIS // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.IntegrationRuntimeAzureSSIS{}). + For(&v1beta1.IntegrationRuntimeAzureSSIS{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.IntegrationRuntimeAzureSSIS") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.IntegrationRuntimeAzureSSIS") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.IntegrationRuntimeAzureSSISList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.IntegrationRuntimeAzureSSISList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.IntegrationRuntimeAzureSSISList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.IntegrationRuntimeAzureSSISList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.IntegrationRuntimeAzureSSIS_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.IntegrationRuntimeAzureSSIS_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.IntegrationRuntimeAzureSSIS{}, eventHandler). + Watches(&v1beta1.IntegrationRuntimeAzureSSIS{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/integrationruntimemanaged/zz_controller.go b/internal/controller/datafactory/integrationruntimemanaged/zz_controller.go index c19383f39..07640921e 100755 --- a/internal/controller/datafactory/integrationruntimemanaged/zz_controller.go +++ b/internal/controller/datafactory/integrationruntimemanaged/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles IntegrationRuntimeManaged managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.IntegrationRuntimeManaged_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.IntegrationRuntimeManaged_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", v1beta2.IntegrationRuntimeManaged_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.IntegrationRuntimeManaged_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IntegrationRuntimeManaged_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IntegrationRuntimeManaged_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_integration_runtime_managed"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.IntegrationRuntimeManaged_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IntegrationRuntimeManaged_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.IntegrationRuntimeManaged + // register webhooks for the kind v1beta1.IntegrationRuntimeManaged // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.IntegrationRuntimeManaged{}). + For(&v1beta1.IntegrationRuntimeManaged{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.IntegrationRuntimeManaged") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.IntegrationRuntimeManaged") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.IntegrationRuntimeManagedList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.IntegrationRuntimeManagedList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.IntegrationRuntimeManagedList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.IntegrationRuntimeManagedList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.IntegrationRuntimeManaged_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.IntegrationRuntimeManaged_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.IntegrationRuntimeManaged{}, eventHandler). + Watches(&v1beta1.IntegrationRuntimeManaged{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/linkedcustomservice/zz_controller.go b/internal/controller/datafactory/linkedcustomservice/zz_controller.go index 938fd3b56..e8ce511bf 100755 --- a/internal/controller/datafactory/linkedcustomservice/zz_controller.go +++ b/internal/controller/datafactory/linkedcustomservice/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinkedCustomService managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinkedCustomService_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinkedCustomService_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", v1beta2.LinkedCustomService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinkedCustomService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedCustomService_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedCustomService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_custom_service"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinkedCustomService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedCustomService_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinkedCustomService + // register webhooks for the kind v1beta1.LinkedCustomService // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinkedCustomService{}). + For(&v1beta1.LinkedCustomService{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinkedCustomService") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinkedCustomService") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinkedCustomServiceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinkedCustomServiceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinkedCustomServiceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinkedCustomServiceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinkedCustomService_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinkedCustomService_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinkedCustomService{}, eventHandler). + Watches(&v1beta1.LinkedCustomService{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/linkedserviceazureblobstorage/zz_controller.go b/internal/controller/datafactory/linkedserviceazureblobstorage/zz_controller.go index 6ef4e88ed..688707c18 100755 --- a/internal/controller/datafactory/linkedserviceazureblobstorage/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceazureblobstorage/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinkedServiceAzureBlobStorage managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinkedServiceAzureBlobStorage_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinkedServiceAzureBlobStorage_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", v1beta2.LinkedServiceAzureBlobStorage_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceAzureBlobStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceAzureBlobStorage_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureBlobStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_blob_storage"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinkedServiceAzureBlobStorage_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceAzureBlobStorage_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinkedServiceAzureBlobStorage + // register webhooks for the kind v1beta1.LinkedServiceAzureBlobStorage // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinkedServiceAzureBlobStorage{}). + For(&v1beta1.LinkedServiceAzureBlobStorage{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinkedServiceAzureBlobStorage") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinkedServiceAzureBlobStorage") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinkedServiceAzureBlobStorageList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinkedServiceAzureBlobStorageList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinkedServiceAzureBlobStorageList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinkedServiceAzureBlobStorageList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceAzureBlobStorage_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureBlobStorage_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinkedServiceAzureBlobStorage{}, eventHandler). + Watches(&v1beta1.LinkedServiceAzureBlobStorage{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/linkedserviceazuredatabricks/zz_controller.go b/internal/controller/datafactory/linkedserviceazuredatabricks/zz_controller.go index 4479f3d8d..d998b70ba 100755 --- a/internal/controller/datafactory/linkedserviceazuredatabricks/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceazuredatabricks/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinkedServiceAzureDatabricks managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinkedServiceAzureDatabricks_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinkedServiceAzureDatabricks_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", v1beta2.LinkedServiceAzureDatabricks_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceAzureDatabricks_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceAzureDatabricks_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureDatabricks_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_databricks"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinkedServiceAzureDatabricks_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceAzureDatabricks_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinkedServiceAzureDatabricks + // register webhooks for the kind v1beta1.LinkedServiceAzureDatabricks // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinkedServiceAzureDatabricks{}). + For(&v1beta1.LinkedServiceAzureDatabricks{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinkedServiceAzureDatabricks") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinkedServiceAzureDatabricks") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinkedServiceAzureDatabricksList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinkedServiceAzureDatabricksList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinkedServiceAzureDatabricksList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinkedServiceAzureDatabricksList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceAzureDatabricks_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureDatabricks_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinkedServiceAzureDatabricks{}, eventHandler). + Watches(&v1beta1.LinkedServiceAzureDatabricks{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/linkedserviceazurefilestorage/zz_controller.go b/internal/controller/datafactory/linkedserviceazurefilestorage/zz_controller.go index 6db1ea785..96f4a418d 100755 --- a/internal/controller/datafactory/linkedserviceazurefilestorage/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceazurefilestorage/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinkedServiceAzureFileStorage managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinkedServiceAzureFileStorage_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinkedServiceAzureFileStorage_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", v1beta2.LinkedServiceAzureFileStorage_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceAzureFileStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceAzureFileStorage_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureFileStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_file_storage"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinkedServiceAzureFileStorage_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceAzureFileStorage_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinkedServiceAzureFileStorage + // register webhooks for the kind v1beta1.LinkedServiceAzureFileStorage // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinkedServiceAzureFileStorage{}). + For(&v1beta1.LinkedServiceAzureFileStorage{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinkedServiceAzureFileStorage") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinkedServiceAzureFileStorage") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinkedServiceAzureFileStorageList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinkedServiceAzureFileStorageList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinkedServiceAzureFileStorageList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinkedServiceAzureFileStorageList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceAzureFileStorage_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureFileStorage_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinkedServiceAzureFileStorage{}, eventHandler). + Watches(&v1beta1.LinkedServiceAzureFileStorage{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/linkedserviceazurefunction/zz_controller.go b/internal/controller/datafactory/linkedserviceazurefunction/zz_controller.go index 6ba41e30c..2530ce3a0 100755 --- a/internal/controller/datafactory/linkedserviceazurefunction/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceazurefunction/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinkedServiceAzureFunction managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinkedServiceAzureFunction_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinkedServiceAzureFunction_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", v1beta2.LinkedServiceAzureFunction_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceAzureFunction_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceAzureFunction_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureFunction_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_function"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinkedServiceAzureFunction_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceAzureFunction_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinkedServiceAzureFunction + // register webhooks for the kind v1beta1.LinkedServiceAzureFunction // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinkedServiceAzureFunction{}). + For(&v1beta1.LinkedServiceAzureFunction{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinkedServiceAzureFunction") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinkedServiceAzureFunction") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinkedServiceAzureFunctionList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinkedServiceAzureFunctionList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinkedServiceAzureFunctionList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinkedServiceAzureFunctionList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceAzureFunction_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureFunction_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinkedServiceAzureFunction{}, eventHandler). + Watches(&v1beta1.LinkedServiceAzureFunction{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/linkedserviceazuresqldatabase/zz_controller.go b/internal/controller/datafactory/linkedserviceazuresqldatabase/zz_controller.go index 547019836..93b9fe6c9 100755 --- a/internal/controller/datafactory/linkedserviceazuresqldatabase/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceazuresqldatabase/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinkedServiceAzureSQLDatabase managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinkedServiceAzureSQLDatabase_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinkedServiceAzureSQLDatabase_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", v1beta2.LinkedServiceAzureSQLDatabase_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceAzureSQLDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceAzureSQLDatabase_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureSQLDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_azure_sql_database"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinkedServiceAzureSQLDatabase_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceAzureSQLDatabase_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinkedServiceAzureSQLDatabase + // register webhooks for the kind v1beta1.LinkedServiceAzureSQLDatabase // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinkedServiceAzureSQLDatabase{}). + For(&v1beta1.LinkedServiceAzureSQLDatabase{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinkedServiceAzureSQLDatabase") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinkedServiceAzureSQLDatabase") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinkedServiceAzureSQLDatabaseList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinkedServiceAzureSQLDatabaseList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinkedServiceAzureSQLDatabaseList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinkedServiceAzureSQLDatabaseList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceAzureSQLDatabase_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceAzureSQLDatabase_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinkedServiceAzureSQLDatabase{}, eventHandler). + Watches(&v1beta1.LinkedServiceAzureSQLDatabase{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/linkedserviceodata/zz_controller.go b/internal/controller/datafactory/linkedserviceodata/zz_controller.go index 0b0381bb7..101a68a9f 100755 --- a/internal/controller/datafactory/linkedserviceodata/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceodata/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinkedServiceOData managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinkedServiceOData_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinkedServiceOData_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", v1beta2.LinkedServiceOData_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceOData_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceOData_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceOData_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_odata"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinkedServiceOData_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceOData_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinkedServiceOData + // register webhooks for the kind v1beta1.LinkedServiceOData // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinkedServiceOData{}). + For(&v1beta1.LinkedServiceOData{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinkedServiceOData") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinkedServiceOData") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinkedServiceODataList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinkedServiceODataList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinkedServiceODataList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinkedServiceODataList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceOData_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceOData_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinkedServiceOData{}, eventHandler). + Watches(&v1beta1.LinkedServiceOData{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/linkedserviceodbc/zz_controller.go b/internal/controller/datafactory/linkedserviceodbc/zz_controller.go index 0236701a7..e6994cb67 100755 --- a/internal/controller/datafactory/linkedserviceodbc/zz_controller.go +++ b/internal/controller/datafactory/linkedserviceodbc/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinkedServiceOdbc managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinkedServiceOdbc_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinkedServiceOdbc_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", v1beta2.LinkedServiceOdbc_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceOdbc_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceOdbc_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceOdbc_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_odbc"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinkedServiceOdbc_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceOdbc_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinkedServiceOdbc + // register webhooks for the kind v1beta1.LinkedServiceOdbc // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinkedServiceOdbc{}). + For(&v1beta1.LinkedServiceOdbc{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinkedServiceOdbc") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinkedServiceOdbc") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinkedServiceOdbcList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinkedServiceOdbcList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinkedServiceOdbcList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinkedServiceOdbcList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceOdbc_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceOdbc_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinkedServiceOdbc{}, eventHandler). + Watches(&v1beta1.LinkedServiceOdbc{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/linkedservicesnowflake/zz_controller.go b/internal/controller/datafactory/linkedservicesnowflake/zz_controller.go index 1156c4efe..79b285d7a 100755 --- a/internal/controller/datafactory/linkedservicesnowflake/zz_controller.go +++ b/internal/controller/datafactory/linkedservicesnowflake/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinkedServiceSnowflake managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinkedServiceSnowflake_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinkedServiceSnowflake_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", v1beta2.LinkedServiceSnowflake_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceSnowflake_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceSnowflake_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceSnowflake_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_snowflake"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinkedServiceSnowflake_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceSnowflake_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinkedServiceSnowflake + // register webhooks for the kind v1beta1.LinkedServiceSnowflake // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinkedServiceSnowflake{}). + For(&v1beta1.LinkedServiceSnowflake{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinkedServiceSnowflake") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinkedServiceSnowflake") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinkedServiceSnowflakeList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinkedServiceSnowflakeList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinkedServiceSnowflakeList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinkedServiceSnowflakeList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceSnowflake_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceSnowflake_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinkedServiceSnowflake{}, eventHandler). + Watches(&v1beta1.LinkedServiceSnowflake{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/linkedservicesqlserver/zz_controller.go b/internal/controller/datafactory/linkedservicesqlserver/zz_controller.go index 822efe0f9..02d97335f 100755 --- a/internal/controller/datafactory/linkedservicesqlserver/zz_controller.go +++ b/internal/controller/datafactory/linkedservicesqlserver/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinkedServiceSQLServer managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinkedServiceSQLServer_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinkedServiceSQLServer_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", v1beta2.LinkedServiceSQLServer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceSQLServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceSQLServer_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceSQLServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_sql_server"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinkedServiceSQLServer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceSQLServer_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinkedServiceSQLServer + // register webhooks for the kind v1beta1.LinkedServiceSQLServer // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinkedServiceSQLServer{}). + For(&v1beta1.LinkedServiceSQLServer{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinkedServiceSQLServer") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinkedServiceSQLServer") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinkedServiceSQLServerList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinkedServiceSQLServerList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinkedServiceSQLServerList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinkedServiceSQLServerList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceSQLServer_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceSQLServer_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinkedServiceSQLServer{}, eventHandler). + Watches(&v1beta1.LinkedServiceSQLServer{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/linkedservicesynapse/zz_controller.go b/internal/controller/datafactory/linkedservicesynapse/zz_controller.go index 36982f1b9..f2ff2d85c 100755 --- a/internal/controller/datafactory/linkedservicesynapse/zz_controller.go +++ b/internal/controller/datafactory/linkedservicesynapse/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinkedServiceSynapse managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinkedServiceSynapse_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinkedServiceSynapse_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", v1beta2.LinkedServiceSynapse_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceSynapse_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedServiceSynapse_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceSynapse_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_linked_service_synapse"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinkedServiceSynapse_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedServiceSynapse_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinkedServiceSynapse + // register webhooks for the kind v1beta1.LinkedServiceSynapse // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinkedServiceSynapse{}). + For(&v1beta1.LinkedServiceSynapse{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinkedServiceSynapse") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinkedServiceSynapse") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinkedServiceSynapseList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinkedServiceSynapseList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinkedServiceSynapseList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinkedServiceSynapseList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinkedServiceSynapse_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinkedServiceSynapse_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinkedServiceSynapse{}, eventHandler). + Watches(&v1beta1.LinkedServiceSynapse{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datafactory/triggerschedule/zz_controller.go b/internal/controller/datafactory/triggerschedule/zz_controller.go index 4f0d00000..bbb9bd7cf 100755 --- a/internal/controller/datafactory/triggerschedule/zz_controller.go +++ b/internal/controller/datafactory/triggerschedule/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datafactory/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datafactory/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles TriggerSchedule managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.TriggerSchedule_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.TriggerSchedule_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", v1beta2.TriggerSchedule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.TriggerSchedule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.TriggerSchedule_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TriggerSchedule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_factory_trigger_schedule"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.TriggerSchedule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.TriggerSchedule_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.TriggerSchedule + // register webhooks for the kind v1beta1.TriggerSchedule // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.TriggerSchedule{}). + For(&v1beta1.TriggerSchedule{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.TriggerSchedule") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.TriggerSchedule") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.TriggerScheduleList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.TriggerScheduleList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.TriggerScheduleList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.TriggerScheduleList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.TriggerSchedule_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.TriggerSchedule_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.TriggerSchedule{}, eventHandler). + Watches(&v1beta1.TriggerSchedule{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/dataprotection/backuppolicydisk/zz_controller.go b/internal/controller/dataprotection/backuppolicydisk/zz_controller.go index e6294108c..2bf9acb9d 100755 --- a/internal/controller/dataprotection/backuppolicydisk/zz_controller.go +++ b/internal/controller/dataprotection/backuppolicydisk/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/dataprotection/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/dataprotection/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles BackupPolicyDisk managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.BackupPolicyDisk_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.BackupPolicyDisk_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", v1beta2.BackupPolicyDisk_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.BackupPolicyDisk_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupPolicyDisk_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyDisk_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_policy_disk"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.BackupPolicyDisk_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupPolicyDisk_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.BackupPolicyDisk + // register webhooks for the kind v1beta1.BackupPolicyDisk // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.BackupPolicyDisk{}). + For(&v1beta1.BackupPolicyDisk{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.BackupPolicyDisk") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.BackupPolicyDisk") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.BackupPolicyDiskList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.BackupPolicyDiskList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.BackupPolicyDiskList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.BackupPolicyDiskList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.BackupPolicyDisk_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyDisk_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.BackupPolicyDisk{}, eventHandler). + Watches(&v1beta1.BackupPolicyDisk{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/dataprotection/backuppolicypostgresql/zz_controller.go b/internal/controller/dataprotection/backuppolicypostgresql/zz_controller.go index 2907683f6..6becd3588 100755 --- a/internal/controller/dataprotection/backuppolicypostgresql/zz_controller.go +++ b/internal/controller/dataprotection/backuppolicypostgresql/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/dataprotection/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/dataprotection/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles BackupPolicyPostgreSQL managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.BackupPolicyPostgreSQL_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.BackupPolicyPostgreSQL_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", v1beta2.BackupPolicyPostgreSQL_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.BackupPolicyPostgreSQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupPolicyPostgreSQL_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyPostgreSQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_policy_postgresql"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.BackupPolicyPostgreSQL_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupPolicyPostgreSQL_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.BackupPolicyPostgreSQL + // register webhooks for the kind v1beta1.BackupPolicyPostgreSQL // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.BackupPolicyPostgreSQL{}). + For(&v1beta1.BackupPolicyPostgreSQL{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.BackupPolicyPostgreSQL") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.BackupPolicyPostgreSQL") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.BackupPolicyPostgreSQLList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.BackupPolicyPostgreSQLList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.BackupPolicyPostgreSQLList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.BackupPolicyPostgreSQLList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.BackupPolicyPostgreSQL_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyPostgreSQL_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.BackupPolicyPostgreSQL{}, eventHandler). + Watches(&v1beta1.BackupPolicyPostgreSQL{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/dataprotection/backupvault/zz_controller.go b/internal/controller/dataprotection/backupvault/zz_controller.go index ddeb00434..39f4f0d1e 100755 --- a/internal/controller/dataprotection/backupvault/zz_controller.go +++ b/internal/controller/dataprotection/backupvault/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/dataprotection/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/dataprotection/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles BackupVault managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.BackupVault_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.BackupVault_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", v1beta2.BackupVault_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.BackupVault_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupVault_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupVault_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_protection_backup_vault"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.BackupVault_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupVault_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.BackupVault + // register webhooks for the kind v1beta1.BackupVault // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.BackupVault{}). + For(&v1beta1.BackupVault{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.BackupVault") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.BackupVault") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.BackupVaultList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.BackupVaultList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.BackupVaultList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.BackupVaultList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.BackupVault_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.BackupVault_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.BackupVault{}, eventHandler). + Watches(&v1beta1.BackupVault{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datashare/account/zz_controller.go b/internal/controller/datashare/account/zz_controller.go index aaf2f9f06..affbd9ea1 100755 --- a/internal/controller/datashare/account/zz_controller.go +++ b/internal/controller/datashare/account/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datashare/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datashare/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Account managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Account_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Account_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", v1beta2.Account_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Account_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_share_account"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Account_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Account_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Account + // register webhooks for the kind v1beta1.Account // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Account{}). + For(&v1beta1.Account{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Account") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Account") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.AccountList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.AccountList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.AccountList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.AccountList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Account_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Account{}, eventHandler). + Watches(&v1beta1.Account{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datashare/datasetblobstorage/zz_controller.go b/internal/controller/datashare/datasetblobstorage/zz_controller.go index ebd7068ba..3012c15d1 100755 --- a/internal/controller/datashare/datasetblobstorage/zz_controller.go +++ b/internal/controller/datashare/datasetblobstorage/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datashare/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datashare/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles DataSetBlobStorage managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.DataSetBlobStorage_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.DataSetBlobStorage_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", v1beta2.DataSetBlobStorage_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.DataSetBlobStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataSetBlobStorage_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataSetBlobStorage_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_share_dataset_blob_storage"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.DataSetBlobStorage_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataSetBlobStorage_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.DataSetBlobStorage + // register webhooks for the kind v1beta1.DataSetBlobStorage // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.DataSetBlobStorage{}). + For(&v1beta1.DataSetBlobStorage{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.DataSetBlobStorage") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.DataSetBlobStorage") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.DataSetBlobStorageList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.DataSetBlobStorageList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.DataSetBlobStorageList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.DataSetBlobStorageList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.DataSetBlobStorage_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.DataSetBlobStorage_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.DataSetBlobStorage{}, eventHandler). + Watches(&v1beta1.DataSetBlobStorage{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/datashare/datashare/zz_controller.go b/internal/controller/datashare/datashare/zz_controller.go index 1246b8b5c..110f61833 100755 --- a/internal/controller/datashare/datashare/zz_controller.go +++ b/internal/controller/datashare/datashare/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/datashare/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/datashare/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles DataShare managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.DataShare_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.DataShare_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", v1beta2.DataShare_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.DataShare_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DataShare_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DataShare_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_data_share"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.DataShare_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DataShare_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.DataShare + // register webhooks for the kind v1beta1.DataShare // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.DataShare{}). + For(&v1beta1.DataShare{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.DataShare") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.DataShare") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.DataShareList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.DataShareList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.DataShareList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.DataShareList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.DataShare_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.DataShare_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.DataShare{}, eventHandler). + Watches(&v1beta1.DataShare{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/dbformysql/flexibleserver/zz_controller.go b/internal/controller/dbformysql/flexibleserver/zz_controller.go index 206308ff2..9959d47a6 100755 --- a/internal/controller/dbformysql/flexibleserver/zz_controller.go +++ b/internal/controller/dbformysql/flexibleserver/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/dbformysql/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/dbformysql/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles FlexibleServer managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.FlexibleServer_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.FlexibleServer_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", v1beta2.FlexibleServer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.FlexibleServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FlexibleServer_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_flexible_server"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.FlexibleServer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FlexibleServer_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.FlexibleServer + // register webhooks for the kind v1beta1.FlexibleServer // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.FlexibleServer{}). + For(&v1beta1.FlexibleServer{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.FlexibleServer") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.FlexibleServer") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FlexibleServerList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FlexibleServerList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FlexibleServerList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FlexibleServerList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.FlexibleServer_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FlexibleServer_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.FlexibleServer{}, eventHandler). + Watches(&v1beta1.FlexibleServer{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/dbformysql/server/zz_controller.go b/internal/controller/dbformysql/server/zz_controller.go index 8f6354a4b..993a8d58f 100755 --- a/internal/controller/dbformysql/server/zz_controller.go +++ b/internal/controller/dbformysql/server/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/dbformysql/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/dbformysql/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Server managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Server_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Server_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", v1beta2.Server_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Server_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Server_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Server_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mysql_server"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Server_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Server_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Server + // register webhooks for the kind v1beta1.Server // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Server{}). + For(&v1beta1.Server{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Server") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Server") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ServerList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ServerList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ServerList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ServerList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Server_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Server_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Server{}, eventHandler). + Watches(&v1beta1.Server{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/dbforpostgresql/flexibleserver/zz_controller.go b/internal/controller/dbforpostgresql/flexibleserver/zz_controller.go index 8beb613bd..952faedfa 100755 --- a/internal/controller/dbforpostgresql/flexibleserver/zz_controller.go +++ b/internal/controller/dbforpostgresql/flexibleserver/zz_controller.go @@ -21,13 +21,13 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/dbforpostgresql/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/dbforpostgresql/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles FlexibleServer managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.FlexibleServer_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.FlexibleServer_GroupVersionKind.String()) var initializers managed.InitializerChain for _, i := range o.Provider.Resources["azurerm_postgresql_flexible_server"].InitializerFns { initializers = append(initializers, i(mgr.GetClient())) @@ -37,15 +37,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1beta2.FlexibleServer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.FlexibleServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FlexibleServer_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FlexibleServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_flexible_server"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.FlexibleServer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FlexibleServer_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -65,31 +65,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.FlexibleServer + // register webhooks for the kind v1beta1.FlexibleServer // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.FlexibleServer{}). + For(&v1beta1.FlexibleServer{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.FlexibleServer") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.FlexibleServer") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FlexibleServerList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FlexibleServerList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FlexibleServerList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FlexibleServerList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.FlexibleServer_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FlexibleServer_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.FlexibleServer{}, eventHandler). + Watches(&v1beta1.FlexibleServer{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/dbforpostgresql/server/zz_controller.go b/internal/controller/dbforpostgresql/server/zz_controller.go index b77c5895b..004b167a5 100755 --- a/internal/controller/dbforpostgresql/server/zz_controller.go +++ b/internal/controller/dbforpostgresql/server/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/dbforpostgresql/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/dbforpostgresql/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Server managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Server_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Server_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", v1beta2.Server_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Server_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Server_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Server_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_postgresql_server"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Server_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Server_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Server + // register webhooks for the kind v1beta1.Server // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Server{}). + For(&v1beta1.Server{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Server") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Server") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ServerList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ServerList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ServerList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ServerList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Server_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Server_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Server{}, eventHandler). + Watches(&v1beta1.Server{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/devices/iothub/zz_controller.go b/internal/controller/devices/iothub/zz_controller.go index 675c9e928..32ddd0268 100755 --- a/internal/controller/devices/iothub/zz_controller.go +++ b/internal/controller/devices/iothub/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/devices/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/devices/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles IOTHub managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.IOTHub_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.IOTHub_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", v1beta2.IOTHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.IOTHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHub_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.IOTHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHub_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.IOTHub + // register webhooks for the kind v1beta1.IOTHub // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.IOTHub{}). + For(&v1beta1.IOTHub{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.IOTHub") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.IOTHub") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.IOTHubList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.IOTHubList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.IOTHubList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.IOTHubList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.IOTHub_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.IOTHub_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.IOTHub{}, eventHandler). + Watches(&v1beta1.IOTHub{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/devices/iothubdps/zz_controller.go b/internal/controller/devices/iothubdps/zz_controller.go index 2baf999f0..05179047c 100755 --- a/internal/controller/devices/iothubdps/zz_controller.go +++ b/internal/controller/devices/iothubdps/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/devices/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/devices/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles IOTHubDPS managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.IOTHubDPS_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.IOTHubDPS_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", v1beta2.IOTHubDPS_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.IOTHubDPS_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubDPS_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubDPS_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_dps"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.IOTHubDPS_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubDPS_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.IOTHubDPS + // register webhooks for the kind v1beta1.IOTHubDPS // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.IOTHubDPS{}). + For(&v1beta1.IOTHubDPS{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.IOTHubDPS") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.IOTHubDPS") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.IOTHubDPSList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.IOTHubDPSList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.IOTHubDPSList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.IOTHubDPSList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.IOTHubDPS_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.IOTHubDPS_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.IOTHubDPS{}, eventHandler). + Watches(&v1beta1.IOTHubDPS{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/deviceupdate/iothubdeviceupdateaccount/zz_controller.go b/internal/controller/deviceupdate/iothubdeviceupdateaccount/zz_controller.go index a15928f91..305644a43 100755 --- a/internal/controller/deviceupdate/iothubdeviceupdateaccount/zz_controller.go +++ b/internal/controller/deviceupdate/iothubdeviceupdateaccount/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/deviceupdate/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/deviceupdate/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles IOTHubDeviceUpdateAccount managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.IOTHubDeviceUpdateAccount_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.IOTHubDeviceUpdateAccount_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", v1beta2.IOTHubDeviceUpdateAccount_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.IOTHubDeviceUpdateAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubDeviceUpdateAccount_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubDeviceUpdateAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_device_update_account"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.IOTHubDeviceUpdateAccount_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubDeviceUpdateAccount_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.IOTHubDeviceUpdateAccount + // register webhooks for the kind v1beta1.IOTHubDeviceUpdateAccount // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.IOTHubDeviceUpdateAccount{}). + For(&v1beta1.IOTHubDeviceUpdateAccount{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.IOTHubDeviceUpdateAccount") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.IOTHubDeviceUpdateAccount") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.IOTHubDeviceUpdateAccountList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.IOTHubDeviceUpdateAccountList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.IOTHubDeviceUpdateAccountList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.IOTHubDeviceUpdateAccountList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.IOTHubDeviceUpdateAccount_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.IOTHubDeviceUpdateAccount_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.IOTHubDeviceUpdateAccount{}, eventHandler). + Watches(&v1beta1.IOTHubDeviceUpdateAccount{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/deviceupdate/iothubdeviceupdateinstance/zz_controller.go b/internal/controller/deviceupdate/iothubdeviceupdateinstance/zz_controller.go index 5ff1afdf2..e981071c2 100755 --- a/internal/controller/deviceupdate/iothubdeviceupdateinstance/zz_controller.go +++ b/internal/controller/deviceupdate/iothubdeviceupdateinstance/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/deviceupdate/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/deviceupdate/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles IOTHubDeviceUpdateInstance managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.IOTHubDeviceUpdateInstance_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.IOTHubDeviceUpdateInstance_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", v1beta2.IOTHubDeviceUpdateInstance_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.IOTHubDeviceUpdateInstance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTHubDeviceUpdateInstance_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTHubDeviceUpdateInstance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iothub_device_update_instance"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.IOTHubDeviceUpdateInstance_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTHubDeviceUpdateInstance_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.IOTHubDeviceUpdateInstance + // register webhooks for the kind v1beta1.IOTHubDeviceUpdateInstance // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.IOTHubDeviceUpdateInstance{}). + For(&v1beta1.IOTHubDeviceUpdateInstance{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.IOTHubDeviceUpdateInstance") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.IOTHubDeviceUpdateInstance") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.IOTHubDeviceUpdateInstanceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.IOTHubDeviceUpdateInstanceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.IOTHubDeviceUpdateInstanceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.IOTHubDeviceUpdateInstanceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.IOTHubDeviceUpdateInstance_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.IOTHubDeviceUpdateInstance_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.IOTHubDeviceUpdateInstance{}, eventHandler). + Watches(&v1beta1.IOTHubDeviceUpdateInstance{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/devtestlab/globalvmshutdownschedule/zz_controller.go b/internal/controller/devtestlab/globalvmshutdownschedule/zz_controller.go index b0e975e1f..00c989507 100755 --- a/internal/controller/devtestlab/globalvmshutdownschedule/zz_controller.go +++ b/internal/controller/devtestlab/globalvmshutdownschedule/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/devtestlab/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/devtestlab/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles GlobalVMShutdownSchedule managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.GlobalVMShutdownSchedule_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.GlobalVMShutdownSchedule_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.GlobalVMShutdownSchedule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.GlobalVMShutdownSchedule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.GlobalVMShutdownSchedule_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.GlobalVMShutdownSchedule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_global_vm_shutdown_schedule"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.GlobalVMShutdownSchedule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.GlobalVMShutdownSchedule_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.GlobalVMShutdownSchedule + // register webhooks for the kind v1beta1.GlobalVMShutdownSchedule // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.GlobalVMShutdownSchedule{}). + For(&v1beta1.GlobalVMShutdownSchedule{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.GlobalVMShutdownSchedule") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.GlobalVMShutdownSchedule") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.GlobalVMShutdownScheduleList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.GlobalVMShutdownScheduleList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.GlobalVMShutdownScheduleList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.GlobalVMShutdownScheduleList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.GlobalVMShutdownSchedule_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.GlobalVMShutdownSchedule_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.GlobalVMShutdownSchedule{}, eventHandler). + Watches(&v1beta1.GlobalVMShutdownSchedule{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/devtestlab/linuxvirtualmachine/zz_controller.go b/internal/controller/devtestlab/linuxvirtualmachine/zz_controller.go index fe9cfe3e6..74f793a55 100755 --- a/internal/controller/devtestlab/linuxvirtualmachine/zz_controller.go +++ b/internal/controller/devtestlab/linuxvirtualmachine/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/devtestlab/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/devtestlab/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinuxVirtualMachine managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinuxVirtualMachine_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinuxVirtualMachine_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.LinuxVirtualMachine_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinuxVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinuxVirtualMachine_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_linux_virtual_machine"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinuxVirtualMachine_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinuxVirtualMachine_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinuxVirtualMachine + // register webhooks for the kind v1beta1.LinuxVirtualMachine // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinuxVirtualMachine{}). + For(&v1beta1.LinuxVirtualMachine{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinuxVirtualMachine") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinuxVirtualMachine") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinuxVirtualMachineList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinuxVirtualMachineList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinuxVirtualMachineList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinuxVirtualMachineList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinuxVirtualMachine_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinuxVirtualMachine_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinuxVirtualMachine{}, eventHandler). + Watches(&v1beta1.LinuxVirtualMachine{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/devtestlab/schedule/zz_controller.go b/internal/controller/devtestlab/schedule/zz_controller.go index 464bb7a0e..c065aba9a 100755 --- a/internal/controller/devtestlab/schedule/zz_controller.go +++ b/internal/controller/devtestlab/schedule/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/devtestlab/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/devtestlab/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Schedule managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Schedule_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Schedule_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", v1beta2.Schedule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Schedule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Schedule_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Schedule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_schedule"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Schedule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Schedule_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Schedule + // register webhooks for the kind v1beta1.Schedule // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Schedule{}). + For(&v1beta1.Schedule{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Schedule") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Schedule") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ScheduleList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ScheduleList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ScheduleList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ScheduleList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Schedule_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Schedule_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Schedule{}, eventHandler). + Watches(&v1beta1.Schedule{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/devtestlab/virtualnetwork/zz_controller.go b/internal/controller/devtestlab/virtualnetwork/zz_controller.go index 4b361ae96..d3f86ade6 100755 --- a/internal/controller/devtestlab/virtualnetwork/zz_controller.go +++ b/internal/controller/devtestlab/virtualnetwork/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/devtestlab/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/devtestlab/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles VirtualNetwork managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.VirtualNetwork_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.VirtualNetwork_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.VirtualNetwork_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.VirtualNetwork_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + 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.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_virtual_network"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.VirtualNetwork_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualNetwork_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.VirtualNetwork + // register webhooks for the kind v1beta1.VirtualNetwork // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.VirtualNetwork{}). + For(&v1beta1.VirtualNetwork{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.VirtualNetwork") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.VirtualNetwork") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.VirtualNetworkList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.VirtualNetworkList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.VirtualNetworkList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.VirtualNetworkList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.VirtualNetwork_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.VirtualNetwork_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.VirtualNetwork{}, eventHandler). + Watches(&v1beta1.VirtualNetwork{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/devtestlab/windowsvirtualmachine/zz_controller.go b/internal/controller/devtestlab/windowsvirtualmachine/zz_controller.go index c5890aacb..61241c392 100755 --- a/internal/controller/devtestlab/windowsvirtualmachine/zz_controller.go +++ b/internal/controller/devtestlab/windowsvirtualmachine/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/devtestlab/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/devtestlab/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles WindowsVirtualMachine managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.WindowsVirtualMachine_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.WindowsVirtualMachine_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.WindowsVirtualMachine_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.WindowsVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WindowsVirtualMachine_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsVirtualMachine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dev_test_windows_virtual_machine"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.WindowsVirtualMachine_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WindowsVirtualMachine_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.WindowsVirtualMachine + // register webhooks for the kind v1beta1.WindowsVirtualMachine // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.WindowsVirtualMachine{}). + For(&v1beta1.WindowsVirtualMachine{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.WindowsVirtualMachine") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.WindowsVirtualMachine") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WindowsVirtualMachineList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WindowsVirtualMachineList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WindowsVirtualMachineList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WindowsVirtualMachineList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.WindowsVirtualMachine_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.WindowsVirtualMachine_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.WindowsVirtualMachine{}, eventHandler). + Watches(&v1beta1.WindowsVirtualMachine{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/digitaltwins/instance/zz_controller.go b/internal/controller/digitaltwins/instance/zz_controller.go index fbeafd87e..12a65fffb 100755 --- a/internal/controller/digitaltwins/instance/zz_controller.go +++ b/internal/controller/digitaltwins/instance/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/digitaltwins/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/digitaltwins/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Instance managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Instance_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Instance_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", v1beta2.Instance_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Instance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Instance_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Instance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_digital_twins_instance"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Instance_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Instance_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Instance + // register webhooks for the kind v1beta1.Instance // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Instance{}). + For(&v1beta1.Instance{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Instance") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Instance") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.InstanceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.InstanceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.InstanceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.InstanceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Instance_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Instance_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Instance{}, eventHandler). + Watches(&v1beta1.Instance{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/elastic/cloudelasticsearch/zz_controller.go b/internal/controller/elastic/cloudelasticsearch/zz_controller.go index 91d6aabfa..cc9d0572f 100755 --- a/internal/controller/elastic/cloudelasticsearch/zz_controller.go +++ b/internal/controller/elastic/cloudelasticsearch/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/elastic/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/elastic/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles CloudElasticsearch managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.CloudElasticsearch_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.CloudElasticsearch_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", v1beta2.CloudElasticsearch_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.CloudElasticsearch_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.CloudElasticsearch_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.CloudElasticsearch_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_elastic_cloud_elasticsearch"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.CloudElasticsearch_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.CloudElasticsearch_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.CloudElasticsearch + // register webhooks for the kind v1beta1.CloudElasticsearch // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.CloudElasticsearch{}). + For(&v1beta1.CloudElasticsearch{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.CloudElasticsearch") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.CloudElasticsearch") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.CloudElasticsearchList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.CloudElasticsearchList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.CloudElasticsearchList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.CloudElasticsearchList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.CloudElasticsearch_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.CloudElasticsearch_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.CloudElasticsearch{}, eventHandler). + Watches(&v1beta1.CloudElasticsearch{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/eventgrid/domain/zz_controller.go b/internal/controller/eventgrid/domain/zz_controller.go index ed65a36b1..9fad6e309 100755 --- a/internal/controller/eventgrid/domain/zz_controller.go +++ b/internal/controller/eventgrid/domain/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/eventgrid/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/eventgrid/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Domain managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Domain_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Domain_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", v1beta2.Domain_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Domain_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Domain_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Domain_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventgrid_domain"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Domain_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Domain_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Domain + // register webhooks for the kind v1beta1.Domain // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Domain{}). + For(&v1beta1.Domain{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Domain") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Domain") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.DomainList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.DomainList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.DomainList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.DomainList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Domain_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Domain_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Domain{}, eventHandler). + Watches(&v1beta1.Domain{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/eventgrid/eventsubscription/zz_controller.go b/internal/controller/eventgrid/eventsubscription/zz_controller.go index 66ead0416..14dd3d24a 100755 --- a/internal/controller/eventgrid/eventsubscription/zz_controller.go +++ b/internal/controller/eventgrid/eventsubscription/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/eventgrid/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/eventgrid/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles EventSubscription managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.EventSubscription_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.EventSubscription_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.EventSubscription_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.EventSubscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.EventSubscription_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventSubscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventgrid_event_subscription"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.EventSubscription_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.EventSubscription_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.EventSubscription + // register webhooks for the kind v1beta1.EventSubscription // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.EventSubscription{}). + For(&v1beta1.EventSubscription{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.EventSubscription") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.EventSubscription") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.EventSubscriptionList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.EventSubscriptionList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.EventSubscriptionList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.EventSubscriptionList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.EventSubscription_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.EventSubscription_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.EventSubscription{}, eventHandler). + Watches(&v1beta1.EventSubscription{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/eventgrid/systemtopic/zz_controller.go b/internal/controller/eventgrid/systemtopic/zz_controller.go index 2eaf0f219..ef64defb2 100755 --- a/internal/controller/eventgrid/systemtopic/zz_controller.go +++ b/internal/controller/eventgrid/systemtopic/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/eventgrid/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/eventgrid/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SystemTopic managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SystemTopic_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SystemTopic_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", v1beta2.SystemTopic_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SystemTopic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SystemTopic_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SystemTopic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventgrid_system_topic"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SystemTopic_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SystemTopic_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SystemTopic + // register webhooks for the kind v1beta1.SystemTopic // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SystemTopic{}). + For(&v1beta1.SystemTopic{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SystemTopic") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SystemTopic") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SystemTopicList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SystemTopicList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SystemTopicList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SystemTopicList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SystemTopic_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SystemTopic_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SystemTopic{}, eventHandler). + Watches(&v1beta1.SystemTopic{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/eventgrid/topic/zz_controller.go b/internal/controller/eventgrid/topic/zz_controller.go index 267d7fdd4..83bdd7702 100755 --- a/internal/controller/eventgrid/topic/zz_controller.go +++ b/internal/controller/eventgrid/topic/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/eventgrid/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/eventgrid/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Topic managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Topic_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Topic_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", v1beta2.Topic_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Topic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Topic_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Topic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventgrid_topic"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Topic_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Topic_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Topic + // register webhooks for the kind v1beta1.Topic // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Topic{}). + For(&v1beta1.Topic{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Topic") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Topic") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.TopicList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.TopicList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.TopicList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.TopicList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Topic_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Topic_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Topic{}, eventHandler). + Watches(&v1beta1.Topic{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/eventhub/eventhub/zz_controller.go b/internal/controller/eventhub/eventhub/zz_controller.go index 28544505c..8ccf45058 100755 --- a/internal/controller/eventhub/eventhub/zz_controller.go +++ b/internal/controller/eventhub/eventhub/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/eventhub/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/eventhub/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles EventHub managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.EventHub_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.EventHub_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", v1beta2.EventHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.EventHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.EventHub_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventhub"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.EventHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.EventHub_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.EventHub + // register webhooks for the kind v1beta1.EventHub // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.EventHub{}). + For(&v1beta1.EventHub{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.EventHub") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.EventHub") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.EventHubList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.EventHubList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.EventHubList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.EventHubList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.EventHub_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.EventHub_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.EventHub{}, eventHandler). + Watches(&v1beta1.EventHub{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/eventhub/eventhubnamespace/zz_controller.go b/internal/controller/eventhub/eventhubnamespace/zz_controller.go index f037add02..776cf28c8 100755 --- a/internal/controller/eventhub/eventhubnamespace/zz_controller.go +++ b/internal/controller/eventhub/eventhubnamespace/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/eventhub/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/eventhub/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles EventHubNamespace managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.EventHubNamespace_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.EventHubNamespace_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", v1beta2.EventHubNamespace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.EventHubNamespace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.EventHubNamespace_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.EventHubNamespace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_eventhub_namespace"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.EventHubNamespace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.EventHubNamespace_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.EventHubNamespace + // register webhooks for the kind v1beta1.EventHubNamespace // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.EventHubNamespace{}). + For(&v1beta1.EventHubNamespace{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.EventHubNamespace") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.EventHubNamespace") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.EventHubNamespaceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.EventHubNamespaceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.EventHubNamespaceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.EventHubNamespaceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.EventHubNamespace_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.EventHubNamespace_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.EventHubNamespace{}, eventHandler). + Watches(&v1beta1.EventHubNamespace{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/fluidrelay/server/zz_controller.go b/internal/controller/fluidrelay/server/zz_controller.go index 403404c72..d0a85de4b 100755 --- a/internal/controller/fluidrelay/server/zz_controller.go +++ b/internal/controller/fluidrelay/server/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/fluidrelay/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/fluidrelay/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Server managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Server_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Server_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.Server_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Server_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Server_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Server_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_fluid_relay_server"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Server_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Server_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Server + // register webhooks for the kind v1beta1.Server // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Server{}). + For(&v1beta1.Server{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Server") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Server") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ServerList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ServerList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ServerList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ServerList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Server_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Server_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Server{}, eventHandler). + Watches(&v1beta1.Server{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/guestconfiguration/policyvirtualmachineconfigurationassignment/zz_controller.go b/internal/controller/guestconfiguration/policyvirtualmachineconfigurationassignment/zz_controller.go index 034e8f665..62785173f 100755 --- a/internal/controller/guestconfiguration/policyvirtualmachineconfigurationassignment/zz_controller.go +++ b/internal/controller/guestconfiguration/policyvirtualmachineconfigurationassignment/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/guestconfiguration/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/guestconfiguration/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles PolicyVirtualMachineConfigurationAssignment managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.PolicyVirtualMachineConfigurationAssignment_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.PolicyVirtualMachineConfigurationAssignment_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", v1beta2.PolicyVirtualMachineConfigurationAssignment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.PolicyVirtualMachineConfigurationAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PolicyVirtualMachineConfigurationAssignment_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PolicyVirtualMachineConfigurationAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_policy_virtual_machine_configuration_assignment"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.PolicyVirtualMachineConfigurationAssignment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PolicyVirtualMachineConfigurationAssignment_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.PolicyVirtualMachineConfigurationAssignment + // register webhooks for the kind v1beta1.PolicyVirtualMachineConfigurationAssignment // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.PolicyVirtualMachineConfigurationAssignment{}). + For(&v1beta1.PolicyVirtualMachineConfigurationAssignment{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.PolicyVirtualMachineConfigurationAssignment") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.PolicyVirtualMachineConfigurationAssignment") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.PolicyVirtualMachineConfigurationAssignmentList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.PolicyVirtualMachineConfigurationAssignmentList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.PolicyVirtualMachineConfigurationAssignmentList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.PolicyVirtualMachineConfigurationAssignmentList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.PolicyVirtualMachineConfigurationAssignment_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.PolicyVirtualMachineConfigurationAssignment_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.PolicyVirtualMachineConfigurationAssignment{}, eventHandler). + Watches(&v1beta1.PolicyVirtualMachineConfigurationAssignment{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/hdinsight/hadoopcluster/zz_controller.go b/internal/controller/hdinsight/hadoopcluster/zz_controller.go index 6a85fa251..8aa294451 100755 --- a/internal/controller/hdinsight/hadoopcluster/zz_controller.go +++ b/internal/controller/hdinsight/hadoopcluster/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/hdinsight/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/hdinsight/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles HadoopCluster managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.HadoopCluster_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.HadoopCluster_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", v1beta2.HadoopCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.HadoopCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HadoopCluster_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HadoopCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_hdinsight_hadoop_cluster"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.HadoopCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HadoopCluster_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.HadoopCluster + // register webhooks for the kind v1beta1.HadoopCluster // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.HadoopCluster{}). + For(&v1beta1.HadoopCluster{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.HadoopCluster") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.HadoopCluster") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.HadoopClusterList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.HadoopClusterList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.HadoopClusterList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.HadoopClusterList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.HadoopCluster_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.HadoopCluster_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.HadoopCluster{}, eventHandler). + Watches(&v1beta1.HadoopCluster{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/hdinsight/hbasecluster/zz_controller.go b/internal/controller/hdinsight/hbasecluster/zz_controller.go index 2b7cc5c51..135a593b9 100755 --- a/internal/controller/hdinsight/hbasecluster/zz_controller.go +++ b/internal/controller/hdinsight/hbasecluster/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/hdinsight/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/hdinsight/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles HBaseCluster managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.HBaseCluster_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.HBaseCluster_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", v1beta2.HBaseCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.HBaseCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HBaseCluster_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HBaseCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_hdinsight_hbase_cluster"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.HBaseCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HBaseCluster_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.HBaseCluster + // register webhooks for the kind v1beta1.HBaseCluster // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.HBaseCluster{}). + For(&v1beta1.HBaseCluster{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.HBaseCluster") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.HBaseCluster") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.HBaseClusterList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.HBaseClusterList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.HBaseClusterList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.HBaseClusterList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.HBaseCluster_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.HBaseCluster_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.HBaseCluster{}, eventHandler). + Watches(&v1beta1.HBaseCluster{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/hdinsight/interactivequerycluster/zz_controller.go b/internal/controller/hdinsight/interactivequerycluster/zz_controller.go index ad64756f0..fa475ec0b 100755 --- a/internal/controller/hdinsight/interactivequerycluster/zz_controller.go +++ b/internal/controller/hdinsight/interactivequerycluster/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/hdinsight/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/hdinsight/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles InteractiveQueryCluster managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.InteractiveQueryCluster_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.InteractiveQueryCluster_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", v1beta2.InteractiveQueryCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.InteractiveQueryCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.InteractiveQueryCluster_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.InteractiveQueryCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_hdinsight_interactive_query_cluster"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.InteractiveQueryCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.InteractiveQueryCluster_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.InteractiveQueryCluster + // register webhooks for the kind v1beta1.InteractiveQueryCluster // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.InteractiveQueryCluster{}). + For(&v1beta1.InteractiveQueryCluster{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.InteractiveQueryCluster") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.InteractiveQueryCluster") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.InteractiveQueryClusterList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.InteractiveQueryClusterList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.InteractiveQueryClusterList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.InteractiveQueryClusterList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.InteractiveQueryCluster_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.InteractiveQueryCluster_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.InteractiveQueryCluster{}, eventHandler). + Watches(&v1beta1.InteractiveQueryCluster{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/hdinsight/kafkacluster/zz_controller.go b/internal/controller/hdinsight/kafkacluster/zz_controller.go index 3c8431a45..3897d2561 100755 --- a/internal/controller/hdinsight/kafkacluster/zz_controller.go +++ b/internal/controller/hdinsight/kafkacluster/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/hdinsight/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/hdinsight/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles KafkaCluster managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.KafkaCluster_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.KafkaCluster_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", v1beta2.KafkaCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.KafkaCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.KafkaCluster_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.KafkaCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_hdinsight_kafka_cluster"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.KafkaCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.KafkaCluster_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.KafkaCluster + // register webhooks for the kind v1beta1.KafkaCluster // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.KafkaCluster{}). + For(&v1beta1.KafkaCluster{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.KafkaCluster") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.KafkaCluster") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.KafkaClusterList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.KafkaClusterList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.KafkaClusterList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.KafkaClusterList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.KafkaCluster_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.KafkaCluster_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.KafkaCluster{}, eventHandler). + Watches(&v1beta1.KafkaCluster{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/hdinsight/sparkcluster/zz_controller.go b/internal/controller/hdinsight/sparkcluster/zz_controller.go index 12e425fd1..ed4100371 100755 --- a/internal/controller/hdinsight/sparkcluster/zz_controller.go +++ b/internal/controller/hdinsight/sparkcluster/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/hdinsight/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/hdinsight/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SparkCluster managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SparkCluster_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SparkCluster_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", v1beta2.SparkCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SparkCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SparkCluster_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SparkCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_hdinsight_spark_cluster"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SparkCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SparkCluster_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SparkCluster + // register webhooks for the kind v1beta1.SparkCluster // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SparkCluster{}). + For(&v1beta1.SparkCluster{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SparkCluster") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SparkCluster") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SparkClusterList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SparkClusterList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SparkClusterList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SparkClusterList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SparkCluster_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SparkCluster_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SparkCluster{}, eventHandler). + Watches(&v1beta1.SparkCluster{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/healthcareapis/healthcaredicomservice/zz_controller.go b/internal/controller/healthcareapis/healthcaredicomservice/zz_controller.go index ecb2f34a8..1db916810 100755 --- a/internal/controller/healthcareapis/healthcaredicomservice/zz_controller.go +++ b/internal/controller/healthcareapis/healthcaredicomservice/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/healthcareapis/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/healthcareapis/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles HealthcareDICOMService managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.HealthcareDICOMService_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.HealthcareDICOMService_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", v1beta2.HealthcareDICOMService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.HealthcareDICOMService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HealthcareDICOMService_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthcareDICOMService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_healthcare_dicom_service"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.HealthcareDICOMService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HealthcareDICOMService_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.HealthcareDICOMService + // register webhooks for the kind v1beta1.HealthcareDICOMService // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.HealthcareDICOMService{}). + For(&v1beta1.HealthcareDICOMService{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.HealthcareDICOMService") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.HealthcareDICOMService") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.HealthcareDICOMServiceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.HealthcareDICOMServiceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.HealthcareDICOMServiceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.HealthcareDICOMServiceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.HealthcareDICOMService_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.HealthcareDICOMService_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.HealthcareDICOMService{}, eventHandler). + Watches(&v1beta1.HealthcareDICOMService{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/healthcareapis/healthcarefhirservice/zz_controller.go b/internal/controller/healthcareapis/healthcarefhirservice/zz_controller.go index e4cfb34f6..d78daa76b 100755 --- a/internal/controller/healthcareapis/healthcarefhirservice/zz_controller.go +++ b/internal/controller/healthcareapis/healthcarefhirservice/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/healthcareapis/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/healthcareapis/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles HealthcareFHIRService managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.HealthcareFHIRService_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.HealthcareFHIRService_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", v1beta2.HealthcareFHIRService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.HealthcareFHIRService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HealthcareFHIRService_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthcareFHIRService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_healthcare_fhir_service"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.HealthcareFHIRService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HealthcareFHIRService_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.HealthcareFHIRService + // register webhooks for the kind v1beta1.HealthcareFHIRService // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.HealthcareFHIRService{}). + For(&v1beta1.HealthcareFHIRService{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.HealthcareFHIRService") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.HealthcareFHIRService") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.HealthcareFHIRServiceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.HealthcareFHIRServiceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.HealthcareFHIRServiceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.HealthcareFHIRServiceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.HealthcareFHIRService_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.HealthcareFHIRService_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.HealthcareFHIRService{}, eventHandler). + Watches(&v1beta1.HealthcareFHIRService{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/healthcareapis/healthcaremedtechservice/zz_controller.go b/internal/controller/healthcareapis/healthcaremedtechservice/zz_controller.go index e374a0716..f9b543dcb 100755 --- a/internal/controller/healthcareapis/healthcaremedtechservice/zz_controller.go +++ b/internal/controller/healthcareapis/healthcaremedtechservice/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/healthcareapis/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/healthcareapis/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles HealthcareMedtechService managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.HealthcareMedtechService_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.HealthcareMedtechService_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", v1beta2.HealthcareMedtechService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.HealthcareMedtechService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HealthcareMedtechService_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthcareMedtechService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_healthcare_medtech_service"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.HealthcareMedtechService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HealthcareMedtechService_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.HealthcareMedtechService + // register webhooks for the kind v1beta1.HealthcareMedtechService // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.HealthcareMedtechService{}). + For(&v1beta1.HealthcareMedtechService{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.HealthcareMedtechService") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.HealthcareMedtechService") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.HealthcareMedtechServiceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.HealthcareMedtechServiceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.HealthcareMedtechServiceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.HealthcareMedtechServiceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.HealthcareMedtechService_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.HealthcareMedtechService_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.HealthcareMedtechService{}, eventHandler). + Watches(&v1beta1.HealthcareMedtechService{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/healthcareapis/healthcareservice/zz_controller.go b/internal/controller/healthcareapis/healthcareservice/zz_controller.go index 687c495a9..2885d1483 100755 --- a/internal/controller/healthcareapis/healthcareservice/zz_controller.go +++ b/internal/controller/healthcareapis/healthcareservice/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/healthcareapis/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/healthcareapis/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles HealthcareService managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.HealthcareService_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.HealthcareService_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", v1beta2.HealthcareService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.HealthcareService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HealthcareService_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HealthcareService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_healthcare_service"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.HealthcareService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HealthcareService_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.HealthcareService + // register webhooks for the kind v1beta1.HealthcareService // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.HealthcareService{}). + For(&v1beta1.HealthcareService{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.HealthcareService") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.HealthcareService") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.HealthcareServiceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.HealthcareServiceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.HealthcareServiceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.HealthcareServiceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.HealthcareService_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.HealthcareService_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.HealthcareService{}, eventHandler). + Watches(&v1beta1.HealthcareService{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/insights/applicationinsightsstandardwebtest/zz_controller.go b/internal/controller/insights/applicationinsightsstandardwebtest/zz_controller.go index 6b8fb99b6..0c4fd485c 100755 --- a/internal/controller/insights/applicationinsightsstandardwebtest/zz_controller.go +++ b/internal/controller/insights/applicationinsightsstandardwebtest/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/insights/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ApplicationInsightsStandardWebTest managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ApplicationInsightsStandardWebTest_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ApplicationInsightsStandardWebTest_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", v1beta2.ApplicationInsightsStandardWebTest_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ApplicationInsightsStandardWebTest_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ApplicationInsightsStandardWebTest_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsStandardWebTest_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights_standard_web_test"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ApplicationInsightsStandardWebTest_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ApplicationInsightsStandardWebTest_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ApplicationInsightsStandardWebTest + // register webhooks for the kind v1beta1.ApplicationInsightsStandardWebTest // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ApplicationInsightsStandardWebTest{}). + For(&v1beta1.ApplicationInsightsStandardWebTest{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ApplicationInsightsStandardWebTest") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ApplicationInsightsStandardWebTest") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ApplicationInsightsStandardWebTestList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ApplicationInsightsStandardWebTestList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ApplicationInsightsStandardWebTestList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ApplicationInsightsStandardWebTestList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ApplicationInsightsStandardWebTest_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsStandardWebTest_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ApplicationInsightsStandardWebTest{}, eventHandler). + Watches(&v1beta1.ApplicationInsightsStandardWebTest{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/insights/applicationinsightsworkbook/zz_controller.go b/internal/controller/insights/applicationinsightsworkbook/zz_controller.go index 30d50153d..40e42d180 100755 --- a/internal/controller/insights/applicationinsightsworkbook/zz_controller.go +++ b/internal/controller/insights/applicationinsightsworkbook/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/insights/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ApplicationInsightsWorkbook managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ApplicationInsightsWorkbook_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ApplicationInsightsWorkbook_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.ApplicationInsightsWorkbook_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ApplicationInsightsWorkbook_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ApplicationInsightsWorkbook_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsWorkbook_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_application_insights_workbook"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ApplicationInsightsWorkbook_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ApplicationInsightsWorkbook_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ApplicationInsightsWorkbook + // register webhooks for the kind v1beta1.ApplicationInsightsWorkbook // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ApplicationInsightsWorkbook{}). + For(&v1beta1.ApplicationInsightsWorkbook{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ApplicationInsightsWorkbook") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ApplicationInsightsWorkbook") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ApplicationInsightsWorkbookList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ApplicationInsightsWorkbookList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ApplicationInsightsWorkbookList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ApplicationInsightsWorkbookList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ApplicationInsightsWorkbook_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ApplicationInsightsWorkbook_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ApplicationInsightsWorkbook{}, eventHandler). + Watches(&v1beta1.ApplicationInsightsWorkbook{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/insights/monitoractiongroup/zz_controller.go b/internal/controller/insights/monitoractiongroup/zz_controller.go index d37a69d76..1a742a96d 100755 --- a/internal/controller/insights/monitoractiongroup/zz_controller.go +++ b/internal/controller/insights/monitoractiongroup/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/insights/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MonitorActionGroup managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MonitorActionGroup_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MonitorActionGroup_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", v1beta2.MonitorActionGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MonitorActionGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorActionGroup_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorActionGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_action_group"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MonitorActionGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorActionGroup_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MonitorActionGroup + // register webhooks for the kind v1beta1.MonitorActionGroup // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MonitorActionGroup{}). + For(&v1beta1.MonitorActionGroup{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MonitorActionGroup") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MonitorActionGroup") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MonitorActionGroupList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MonitorActionGroupList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MonitorActionGroupList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MonitorActionGroupList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MonitorActionGroup_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MonitorActionGroup_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MonitorActionGroup{}, eventHandler). + Watches(&v1beta1.MonitorActionGroup{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/insights/monitoractivitylogalert/zz_controller.go b/internal/controller/insights/monitoractivitylogalert/zz_controller.go index e10a8354d..773db59e2 100755 --- a/internal/controller/insights/monitoractivitylogalert/zz_controller.go +++ b/internal/controller/insights/monitoractivitylogalert/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/insights/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MonitorActivityLogAlert managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MonitorActivityLogAlert_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MonitorActivityLogAlert_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.MonitorActivityLogAlert_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MonitorActivityLogAlert_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorActivityLogAlert_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorActivityLogAlert_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_activity_log_alert"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MonitorActivityLogAlert_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorActivityLogAlert_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MonitorActivityLogAlert + // register webhooks for the kind v1beta1.MonitorActivityLogAlert // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MonitorActivityLogAlert{}). + For(&v1beta1.MonitorActivityLogAlert{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MonitorActivityLogAlert") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MonitorActivityLogAlert") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MonitorActivityLogAlertList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MonitorActivityLogAlertList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MonitorActivityLogAlertList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MonitorActivityLogAlertList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MonitorActivityLogAlert_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MonitorActivityLogAlert_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MonitorActivityLogAlert{}, eventHandler). + Watches(&v1beta1.MonitorActivityLogAlert{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/insights/monitorautoscalesetting/zz_controller.go b/internal/controller/insights/monitorautoscalesetting/zz_controller.go index ebe57b510..f0dc1d5b7 100755 --- a/internal/controller/insights/monitorautoscalesetting/zz_controller.go +++ b/internal/controller/insights/monitorautoscalesetting/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/insights/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MonitorAutoscaleSetting managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MonitorAutoscaleSetting_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MonitorAutoscaleSetting_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.MonitorAutoscaleSetting_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MonitorAutoscaleSetting_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorAutoscaleSetting_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorAutoscaleSetting_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_autoscale_setting"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MonitorAutoscaleSetting_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorAutoscaleSetting_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MonitorAutoscaleSetting + // register webhooks for the kind v1beta1.MonitorAutoscaleSetting // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MonitorAutoscaleSetting{}). + For(&v1beta1.MonitorAutoscaleSetting{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MonitorAutoscaleSetting") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MonitorAutoscaleSetting") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MonitorAutoscaleSettingList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MonitorAutoscaleSettingList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MonitorAutoscaleSettingList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MonitorAutoscaleSettingList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MonitorAutoscaleSetting_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MonitorAutoscaleSetting_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MonitorAutoscaleSetting{}, eventHandler). + Watches(&v1beta1.MonitorAutoscaleSetting{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/insights/monitordatacollectionrule/zz_controller.go b/internal/controller/insights/monitordatacollectionrule/zz_controller.go index 2046421e6..5623dd842 100755 --- a/internal/controller/insights/monitordatacollectionrule/zz_controller.go +++ b/internal/controller/insights/monitordatacollectionrule/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/insights/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MonitorDataCollectionRule managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MonitorDataCollectionRule_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MonitorDataCollectionRule_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", v1beta2.MonitorDataCollectionRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MonitorDataCollectionRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorDataCollectionRule_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorDataCollectionRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_data_collection_rule"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MonitorDataCollectionRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorDataCollectionRule_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MonitorDataCollectionRule + // register webhooks for the kind v1beta1.MonitorDataCollectionRule // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MonitorDataCollectionRule{}). + For(&v1beta1.MonitorDataCollectionRule{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MonitorDataCollectionRule") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MonitorDataCollectionRule") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MonitorDataCollectionRuleList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MonitorDataCollectionRuleList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MonitorDataCollectionRuleList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MonitorDataCollectionRuleList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MonitorDataCollectionRule_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MonitorDataCollectionRule_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MonitorDataCollectionRule{}, eventHandler). + Watches(&v1beta1.MonitorDataCollectionRule{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/insights/monitordiagnosticsetting/zz_controller.go b/internal/controller/insights/monitordiagnosticsetting/zz_controller.go index 6e4a89a58..822a16acc 100755 --- a/internal/controller/insights/monitordiagnosticsetting/zz_controller.go +++ b/internal/controller/insights/monitordiagnosticsetting/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/insights/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MonitorDiagnosticSetting managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MonitorDiagnosticSetting_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MonitorDiagnosticSetting_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.MonitorDiagnosticSetting_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MonitorDiagnosticSetting_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorDiagnosticSetting_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorDiagnosticSetting_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_diagnostic_setting"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MonitorDiagnosticSetting_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorDiagnosticSetting_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MonitorDiagnosticSetting + // register webhooks for the kind v1beta1.MonitorDiagnosticSetting // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MonitorDiagnosticSetting{}). + For(&v1beta1.MonitorDiagnosticSetting{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MonitorDiagnosticSetting") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MonitorDiagnosticSetting") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MonitorDiagnosticSettingList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MonitorDiagnosticSettingList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MonitorDiagnosticSettingList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MonitorDiagnosticSettingList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MonitorDiagnosticSetting_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MonitorDiagnosticSetting_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MonitorDiagnosticSetting{}, eventHandler). + Watches(&v1beta1.MonitorDiagnosticSetting{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/insights/monitormetricalert/zz_controller.go b/internal/controller/insights/monitormetricalert/zz_controller.go index 30f8ba99e..f1dafcc9d 100755 --- a/internal/controller/insights/monitormetricalert/zz_controller.go +++ b/internal/controller/insights/monitormetricalert/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/insights/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MonitorMetricAlert managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MonitorMetricAlert_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MonitorMetricAlert_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", v1beta2.MonitorMetricAlert_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MonitorMetricAlert_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorMetricAlert_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorMetricAlert_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_metric_alert"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MonitorMetricAlert_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorMetricAlert_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MonitorMetricAlert + // register webhooks for the kind v1beta1.MonitorMetricAlert // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MonitorMetricAlert{}). + For(&v1beta1.MonitorMetricAlert{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MonitorMetricAlert") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MonitorMetricAlert") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MonitorMetricAlertList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MonitorMetricAlertList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MonitorMetricAlertList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MonitorMetricAlertList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MonitorMetricAlert_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MonitorMetricAlert_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MonitorMetricAlert{}, eventHandler). + Watches(&v1beta1.MonitorMetricAlert{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/insights/monitorscheduledqueryrulesalert/zz_controller.go b/internal/controller/insights/monitorscheduledqueryrulesalert/zz_controller.go index 37635d16e..8ede0984c 100755 --- a/internal/controller/insights/monitorscheduledqueryrulesalert/zz_controller.go +++ b/internal/controller/insights/monitorscheduledqueryrulesalert/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/insights/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MonitorScheduledQueryRulesAlert managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MonitorScheduledQueryRulesAlert_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MonitorScheduledQueryRulesAlert_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.MonitorScheduledQueryRulesAlert_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MonitorScheduledQueryRulesAlert_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorScheduledQueryRulesAlert_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorScheduledQueryRulesAlert_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_scheduled_query_rules_alert"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MonitorScheduledQueryRulesAlert_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorScheduledQueryRulesAlert_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MonitorScheduledQueryRulesAlert + // register webhooks for the kind v1beta1.MonitorScheduledQueryRulesAlert // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MonitorScheduledQueryRulesAlert{}). + For(&v1beta1.MonitorScheduledQueryRulesAlert{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MonitorScheduledQueryRulesAlert") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MonitorScheduledQueryRulesAlert") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MonitorScheduledQueryRulesAlertList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MonitorScheduledQueryRulesAlertList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MonitorScheduledQueryRulesAlertList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MonitorScheduledQueryRulesAlertList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MonitorScheduledQueryRulesAlert_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MonitorScheduledQueryRulesAlert_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MonitorScheduledQueryRulesAlert{}, eventHandler). + Watches(&v1beta1.MonitorScheduledQueryRulesAlert{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/insights/monitorscheduledqueryrulesalertv2/zz_controller.go b/internal/controller/insights/monitorscheduledqueryrulesalertv2/zz_controller.go index 9cfb5bf63..7e4c252e2 100755 --- a/internal/controller/insights/monitorscheduledqueryrulesalertv2/zz_controller.go +++ b/internal/controller/insights/monitorscheduledqueryrulesalertv2/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/insights/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MonitorScheduledQueryRulesAlertV2 managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MonitorScheduledQueryRulesAlertV2_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MonitorScheduledQueryRulesAlertV2_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", v1beta2.MonitorScheduledQueryRulesAlertV2_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MonitorScheduledQueryRulesAlertV2_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorScheduledQueryRulesAlertV2_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorScheduledQueryRulesAlertV2_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_scheduled_query_rules_alert_v2"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MonitorScheduledQueryRulesAlertV2_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorScheduledQueryRulesAlertV2_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MonitorScheduledQueryRulesAlertV2 + // register webhooks for the kind v1beta1.MonitorScheduledQueryRulesAlertV2 // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MonitorScheduledQueryRulesAlertV2{}). + For(&v1beta1.MonitorScheduledQueryRulesAlertV2{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MonitorScheduledQueryRulesAlertV2") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MonitorScheduledQueryRulesAlertV2") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MonitorScheduledQueryRulesAlertV2List{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MonitorScheduledQueryRulesAlertV2List{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MonitorScheduledQueryRulesAlertV2List") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MonitorScheduledQueryRulesAlertV2List") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MonitorScheduledQueryRulesAlertV2_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MonitorScheduledQueryRulesAlertV2_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MonitorScheduledQueryRulesAlertV2{}, eventHandler). + Watches(&v1beta1.MonitorScheduledQueryRulesAlertV2{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/insights/monitorscheduledqueryruleslog/zz_controller.go b/internal/controller/insights/monitorscheduledqueryruleslog/zz_controller.go index b50046719..b98cfeb7e 100755 --- a/internal/controller/insights/monitorscheduledqueryruleslog/zz_controller.go +++ b/internal/controller/insights/monitorscheduledqueryruleslog/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/insights/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/insights/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MonitorScheduledQueryRulesLog managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MonitorScheduledQueryRulesLog_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MonitorScheduledQueryRulesLog_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.MonitorScheduledQueryRulesLog_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MonitorScheduledQueryRulesLog_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MonitorScheduledQueryRulesLog_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MonitorScheduledQueryRulesLog_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_monitor_scheduled_query_rules_log"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MonitorScheduledQueryRulesLog_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MonitorScheduledQueryRulesLog_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MonitorScheduledQueryRulesLog + // register webhooks for the kind v1beta1.MonitorScheduledQueryRulesLog // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MonitorScheduledQueryRulesLog{}). + For(&v1beta1.MonitorScheduledQueryRulesLog{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MonitorScheduledQueryRulesLog") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MonitorScheduledQueryRulesLog") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MonitorScheduledQueryRulesLogList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MonitorScheduledQueryRulesLogList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MonitorScheduledQueryRulesLogList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MonitorScheduledQueryRulesLogList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MonitorScheduledQueryRulesLog_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MonitorScheduledQueryRulesLog_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MonitorScheduledQueryRulesLog{}, eventHandler). + Watches(&v1beta1.MonitorScheduledQueryRulesLog{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/iotcentral/application/zz_controller.go b/internal/controller/iotcentral/application/zz_controller.go index 314180b32..b6d1679bb 100755 --- a/internal/controller/iotcentral/application/zz_controller.go +++ b/internal/controller/iotcentral/application/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/iotcentral/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/iotcentral/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Application managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Application_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Application_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.Application_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Application_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Application_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Application_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iotcentral_application"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Application_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Application_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Application + // register webhooks for the kind v1beta1.Application // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Application{}). + For(&v1beta1.Application{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Application") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Application") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ApplicationList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ApplicationList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ApplicationList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ApplicationList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Application_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Application_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Application{}, eventHandler). + Watches(&v1beta1.Application{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/keyvault/certificate/zz_controller.go b/internal/controller/keyvault/certificate/zz_controller.go index 0eef0d0d9..ec04522fd 100755 --- a/internal/controller/keyvault/certificate/zz_controller.go +++ b/internal/controller/keyvault/certificate/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/keyvault/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/keyvault/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Certificate managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Certificate_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Certificate_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.Certificate_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Certificate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Certificate_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Certificate_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_certificate"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Certificate_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Certificate_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Certificate + // register webhooks for the kind v1beta1.Certificate // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Certificate{}). + For(&v1beta1.Certificate{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Certificate") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Certificate") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.CertificateList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.CertificateList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.CertificateList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.CertificateList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Certificate_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Certificate_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Certificate{}, eventHandler). + Watches(&v1beta1.Certificate{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/keyvault/key/zz_controller.go b/internal/controller/keyvault/key/zz_controller.go index 5290d33d4..f70f0d18e 100755 --- a/internal/controller/keyvault/key/zz_controller.go +++ b/internal/controller/keyvault/key/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/keyvault/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/keyvault/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Key managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Key_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Key_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.Key_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Key_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Key_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Key_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_key"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Key_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Key_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Key + // register webhooks for the kind v1beta1.Key // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Key{}). + For(&v1beta1.Key{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Key") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Key") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.KeyList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.KeyList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.KeyList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.KeyList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Key_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Key_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Key{}, eventHandler). + Watches(&v1beta1.Key{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/keyvault/managedhardwaresecuritymodule/zz_controller.go b/internal/controller/keyvault/managedhardwaresecuritymodule/zz_controller.go index d7244243f..9762d72e6 100755 --- a/internal/controller/keyvault/managedhardwaresecuritymodule/zz_controller.go +++ b/internal/controller/keyvault/managedhardwaresecuritymodule/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/keyvault/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/keyvault/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ManagedHardwareSecurityModule managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ManagedHardwareSecurityModule_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ManagedHardwareSecurityModule_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", v1beta2.ManagedHardwareSecurityModule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ManagedHardwareSecurityModule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagedHardwareSecurityModule_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedHardwareSecurityModule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault_managed_hardware_security_module"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ManagedHardwareSecurityModule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagedHardwareSecurityModule_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ManagedHardwareSecurityModule + // register webhooks for the kind v1beta1.ManagedHardwareSecurityModule // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ManagedHardwareSecurityModule{}). + For(&v1beta1.ManagedHardwareSecurityModule{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ManagedHardwareSecurityModule") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ManagedHardwareSecurityModule") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ManagedHardwareSecurityModuleList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ManagedHardwareSecurityModuleList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ManagedHardwareSecurityModuleList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ManagedHardwareSecurityModuleList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ManagedHardwareSecurityModule_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ManagedHardwareSecurityModule_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ManagedHardwareSecurityModule{}, eventHandler). + Watches(&v1beta1.ManagedHardwareSecurityModule{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/keyvault/vault/zz_controller.go b/internal/controller/keyvault/vault/zz_controller.go index 40d0e771c..c806def74 100755 --- a/internal/controller/keyvault/vault/zz_controller.go +++ b/internal/controller/keyvault/vault/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/keyvault/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/keyvault/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Vault managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Vault_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Vault_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", v1beta2.Vault_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Vault_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Vault_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Vault_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_key_vault"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Vault_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Vault_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Vault + // register webhooks for the kind v1beta1.Vault // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Vault{}). + For(&v1beta1.Vault{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Vault") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Vault") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.VaultList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.VaultList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.VaultList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.VaultList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Vault_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Vault_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Vault{}, eventHandler). + Watches(&v1beta1.Vault{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/kusto/attacheddatabaseconfiguration/zz_controller.go b/internal/controller/kusto/attacheddatabaseconfiguration/zz_controller.go index 98d7f8345..1b95a7572 100755 --- a/internal/controller/kusto/attacheddatabaseconfiguration/zz_controller.go +++ b/internal/controller/kusto/attacheddatabaseconfiguration/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/kusto/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/kusto/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles AttachedDatabaseConfiguration managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.AttachedDatabaseConfiguration_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.AttachedDatabaseConfiguration_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.AttachedDatabaseConfiguration_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.AttachedDatabaseConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AttachedDatabaseConfiguration_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AttachedDatabaseConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_attached_database_configuration"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.AttachedDatabaseConfiguration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AttachedDatabaseConfiguration_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.AttachedDatabaseConfiguration + // register webhooks for the kind v1beta1.AttachedDatabaseConfiguration // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.AttachedDatabaseConfiguration{}). + For(&v1beta1.AttachedDatabaseConfiguration{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.AttachedDatabaseConfiguration") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.AttachedDatabaseConfiguration") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.AttachedDatabaseConfigurationList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.AttachedDatabaseConfigurationList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.AttachedDatabaseConfigurationList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.AttachedDatabaseConfigurationList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.AttachedDatabaseConfiguration_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.AttachedDatabaseConfiguration_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.AttachedDatabaseConfiguration{}, eventHandler). + Watches(&v1beta1.AttachedDatabaseConfiguration{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/kusto/cluster/zz_controller.go b/internal/controller/kusto/cluster/zz_controller.go index 5cefe9d72..2e01a22c0 100755 --- a/internal/controller/kusto/cluster/zz_controller.go +++ b/internal/controller/kusto/cluster/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/kusto/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/kusto/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Cluster managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Cluster_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Cluster_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", v1beta2.Cluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Cluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Cluster_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Cluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_kusto_cluster"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Cluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Cluster_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Cluster + // register webhooks for the kind v1beta1.Cluster // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Cluster{}). + For(&v1beta1.Cluster{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Cluster") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Cluster") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ClusterList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ClusterList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ClusterList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ClusterList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Cluster_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Cluster_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Cluster{}, eventHandler). + Watches(&v1beta1.Cluster{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/labservices/labservicelab/zz_controller.go b/internal/controller/labservices/labservicelab/zz_controller.go index 00e222157..7591b5a28 100755 --- a/internal/controller/labservices/labservicelab/zz_controller.go +++ b/internal/controller/labservices/labservicelab/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/labservices/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/labservices/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LabServiceLab managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LabServiceLab_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LabServiceLab_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", v1beta2.LabServiceLab_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LabServiceLab_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LabServiceLab_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LabServiceLab_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_lab_service_lab"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LabServiceLab_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LabServiceLab_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LabServiceLab + // register webhooks for the kind v1beta1.LabServiceLab // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LabServiceLab{}). + For(&v1beta1.LabServiceLab{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LabServiceLab") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LabServiceLab") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LabServiceLabList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LabServiceLabList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LabServiceLabList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LabServiceLabList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LabServiceLab_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LabServiceLab_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LabServiceLab{}, eventHandler). + Watches(&v1beta1.LabServiceLab{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/labservices/labserviceplan/zz_controller.go b/internal/controller/labservices/labserviceplan/zz_controller.go index 53afbef57..9024651a1 100755 --- a/internal/controller/labservices/labserviceplan/zz_controller.go +++ b/internal/controller/labservices/labserviceplan/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/labservices/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/labservices/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LabServicePlan managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LabServicePlan_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LabServicePlan_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", v1beta2.LabServicePlan_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LabServicePlan_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LabServicePlan_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LabServicePlan_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_lab_service_plan"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LabServicePlan_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LabServicePlan_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LabServicePlan + // register webhooks for the kind v1beta1.LabServicePlan // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LabServicePlan{}). + For(&v1beta1.LabServicePlan{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LabServicePlan") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LabServicePlan") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LabServicePlanList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LabServicePlanList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LabServicePlanList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LabServicePlanList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LabServicePlan_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LabServicePlan_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LabServicePlan{}, eventHandler). + Watches(&v1beta1.LabServicePlan{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/loadtestservice/loadtest/zz_controller.go b/internal/controller/loadtestservice/loadtest/zz_controller.go index 3d938d8a7..4c75f3064 100755 --- a/internal/controller/loadtestservice/loadtest/zz_controller.go +++ b/internal/controller/loadtestservice/loadtest/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/loadtestservice/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/loadtestservice/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LoadTest managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LoadTest_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LoadTest_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", v1beta2.LoadTest_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LoadTest_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LoadTest_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LoadTest_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_load_test"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LoadTest_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LoadTest_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LoadTest + // register webhooks for the kind v1beta1.LoadTest // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LoadTest{}). + For(&v1beta1.LoadTest{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LoadTest") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LoadTest") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LoadTestList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LoadTestList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LoadTestList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LoadTestList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LoadTest_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LoadTest_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LoadTest{}, eventHandler). + Watches(&v1beta1.LoadTest{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/logic/appintegrationaccountbatchconfiguration/zz_controller.go b/internal/controller/logic/appintegrationaccountbatchconfiguration/zz_controller.go index 5eb6e44ec..12630e2bb 100755 --- a/internal/controller/logic/appintegrationaccountbatchconfiguration/zz_controller.go +++ b/internal/controller/logic/appintegrationaccountbatchconfiguration/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/logic/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/logic/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles AppIntegrationAccountBatchConfiguration managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.AppIntegrationAccountBatchConfiguration_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.AppIntegrationAccountBatchConfiguration_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.AppIntegrationAccountBatchConfiguration_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.AppIntegrationAccountBatchConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppIntegrationAccountBatchConfiguration_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppIntegrationAccountBatchConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_integration_account_batch_configuration"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.AppIntegrationAccountBatchConfiguration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppIntegrationAccountBatchConfiguration_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.AppIntegrationAccountBatchConfiguration + // register webhooks for the kind v1beta1.AppIntegrationAccountBatchConfiguration // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.AppIntegrationAccountBatchConfiguration{}). + For(&v1beta1.AppIntegrationAccountBatchConfiguration{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.AppIntegrationAccountBatchConfiguration") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.AppIntegrationAccountBatchConfiguration") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.AppIntegrationAccountBatchConfigurationList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.AppIntegrationAccountBatchConfigurationList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.AppIntegrationAccountBatchConfigurationList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.AppIntegrationAccountBatchConfigurationList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.AppIntegrationAccountBatchConfiguration_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.AppIntegrationAccountBatchConfiguration_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.AppIntegrationAccountBatchConfiguration{}, eventHandler). + Watches(&v1beta1.AppIntegrationAccountBatchConfiguration{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/logic/apptriggerrecurrence/zz_controller.go b/internal/controller/logic/apptriggerrecurrence/zz_controller.go index f8e4abc3f..fc7311889 100755 --- a/internal/controller/logic/apptriggerrecurrence/zz_controller.go +++ b/internal/controller/logic/apptriggerrecurrence/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/logic/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/logic/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles AppTriggerRecurrence managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.AppTriggerRecurrence_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.AppTriggerRecurrence_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", v1beta2.AppTriggerRecurrence_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.AppTriggerRecurrence_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppTriggerRecurrence_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppTriggerRecurrence_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_trigger_recurrence"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.AppTriggerRecurrence_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppTriggerRecurrence_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.AppTriggerRecurrence + // register webhooks for the kind v1beta1.AppTriggerRecurrence // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.AppTriggerRecurrence{}). + For(&v1beta1.AppTriggerRecurrence{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.AppTriggerRecurrence") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.AppTriggerRecurrence") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.AppTriggerRecurrenceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.AppTriggerRecurrenceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.AppTriggerRecurrenceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.AppTriggerRecurrenceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.AppTriggerRecurrence_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.AppTriggerRecurrence_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.AppTriggerRecurrence{}, eventHandler). + Watches(&v1beta1.AppTriggerRecurrence{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/logic/appworkflow/zz_controller.go b/internal/controller/logic/appworkflow/zz_controller.go index cf5271981..52bf59f68 100755 --- a/internal/controller/logic/appworkflow/zz_controller.go +++ b/internal/controller/logic/appworkflow/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/logic/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/logic/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles AppWorkflow managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.AppWorkflow_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.AppWorkflow_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", v1beta2.AppWorkflow_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.AppWorkflow_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppWorkflow_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppWorkflow_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logic_app_workflow"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.AppWorkflow_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppWorkflow_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.AppWorkflow + // register webhooks for the kind v1beta1.AppWorkflow // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.AppWorkflow{}). + For(&v1beta1.AppWorkflow{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.AppWorkflow") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.AppWorkflow") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.AppWorkflowList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.AppWorkflowList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.AppWorkflowList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.AppWorkflowList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.AppWorkflow_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.AppWorkflow_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.AppWorkflow{}, eventHandler). + Watches(&v1beta1.AppWorkflow{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/logz/monitor/zz_controller.go b/internal/controller/logz/monitor/zz_controller.go index 2d3ca7280..f551d2550 100755 --- a/internal/controller/logz/monitor/zz_controller.go +++ b/internal/controller/logz/monitor/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/logz/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/logz/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Monitor managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Monitor_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Monitor_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", v1beta2.Monitor_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Monitor_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Monitor_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Monitor_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logz_monitor"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Monitor_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Monitor_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Monitor + // register webhooks for the kind v1beta1.Monitor // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Monitor{}). + For(&v1beta1.Monitor{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Monitor") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Monitor") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MonitorList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MonitorList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MonitorList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MonitorList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Monitor_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Monitor_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Monitor{}, eventHandler). + Watches(&v1beta1.Monitor{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/logz/subaccount/zz_controller.go b/internal/controller/logz/subaccount/zz_controller.go index 2a9b6f50d..07189b403 100755 --- a/internal/controller/logz/subaccount/zz_controller.go +++ b/internal/controller/logz/subaccount/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/logz/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/logz/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SubAccount managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SubAccount_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SubAccount_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", v1beta2.SubAccount_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SubAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SubAccount_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_logz_sub_account"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SubAccount_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SubAccount_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SubAccount + // register webhooks for the kind v1beta1.SubAccount // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SubAccount{}). + For(&v1beta1.SubAccount{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SubAccount") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SubAccount") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SubAccountList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SubAccountList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SubAccountList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SubAccountList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SubAccount_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SubAccount_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SubAccount{}, eventHandler). + Watches(&v1beta1.SubAccount{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/machinelearningservices/computecluster/zz_controller.go b/internal/controller/machinelearningservices/computecluster/zz_controller.go index a32fa4063..bd5bbe4ef 100755 --- a/internal/controller/machinelearningservices/computecluster/zz_controller.go +++ b/internal/controller/machinelearningservices/computecluster/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/machinelearningservices/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/machinelearningservices/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ComputeCluster managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ComputeCluster_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ComputeCluster_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.ComputeCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ComputeCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ComputeCluster_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ComputeCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_machine_learning_compute_cluster"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ComputeCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ComputeCluster_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ComputeCluster + // register webhooks for the kind v1beta1.ComputeCluster // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ComputeCluster{}). + For(&v1beta1.ComputeCluster{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ComputeCluster") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ComputeCluster") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ComputeClusterList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ComputeClusterList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ComputeClusterList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ComputeClusterList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ComputeCluster_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ComputeCluster_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ComputeCluster{}, eventHandler). + Watches(&v1beta1.ComputeCluster{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/machinelearningservices/computeinstance/zz_controller.go b/internal/controller/machinelearningservices/computeinstance/zz_controller.go index 776aed5cd..a2d612a3e 100755 --- a/internal/controller/machinelearningservices/computeinstance/zz_controller.go +++ b/internal/controller/machinelearningservices/computeinstance/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/machinelearningservices/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/machinelearningservices/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ComputeInstance managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ComputeInstance_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ComputeInstance_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", v1beta2.ComputeInstance_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ComputeInstance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ComputeInstance_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ComputeInstance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_machine_learning_compute_instance"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ComputeInstance_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ComputeInstance_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ComputeInstance + // register webhooks for the kind v1beta1.ComputeInstance // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ComputeInstance{}). + For(&v1beta1.ComputeInstance{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ComputeInstance") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ComputeInstance") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ComputeInstanceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ComputeInstanceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ComputeInstanceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ComputeInstanceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ComputeInstance_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ComputeInstance_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ComputeInstance{}, eventHandler). + Watches(&v1beta1.ComputeInstance{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/machinelearningservices/synapsespark/zz_controller.go b/internal/controller/machinelearningservices/synapsespark/zz_controller.go index 44dbe71d0..5b58a51d2 100755 --- a/internal/controller/machinelearningservices/synapsespark/zz_controller.go +++ b/internal/controller/machinelearningservices/synapsespark/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/machinelearningservices/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/machinelearningservices/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SynapseSpark managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SynapseSpark_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SynapseSpark_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", v1beta2.SynapseSpark_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SynapseSpark_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SynapseSpark_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SynapseSpark_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_machine_learning_synapse_spark"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SynapseSpark_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SynapseSpark_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SynapseSpark + // register webhooks for the kind v1beta1.SynapseSpark // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SynapseSpark{}). + For(&v1beta1.SynapseSpark{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SynapseSpark") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SynapseSpark") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SynapseSparkList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SynapseSparkList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SynapseSparkList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SynapseSparkList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SynapseSpark_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SynapseSpark_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SynapseSpark{}, eventHandler). + Watches(&v1beta1.SynapseSpark{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/machinelearningservices/workspace/zz_controller.go b/internal/controller/machinelearningservices/workspace/zz_controller.go index b14ca7c8d..267f09c94 100755 --- a/internal/controller/machinelearningservices/workspace/zz_controller.go +++ b/internal/controller/machinelearningservices/workspace/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/machinelearningservices/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/machinelearningservices/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Workspace managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Workspace_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Workspace_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", v1beta2.Workspace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Workspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Workspace_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Workspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_machine_learning_workspace"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Workspace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Workspace_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Workspace + // register webhooks for the kind v1beta1.Workspace // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Workspace{}). + For(&v1beta1.Workspace{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Workspace") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Workspace") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WorkspaceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WorkspaceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WorkspaceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WorkspaceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Workspace_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Workspace_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Workspace{}, eventHandler). + Watches(&v1beta1.Workspace{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/maintenance/maintenanceconfiguration/zz_controller.go b/internal/controller/maintenance/maintenanceconfiguration/zz_controller.go index e945e662e..1a7cef843 100755 --- a/internal/controller/maintenance/maintenanceconfiguration/zz_controller.go +++ b/internal/controller/maintenance/maintenanceconfiguration/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/maintenance/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/maintenance/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MaintenanceConfiguration managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MaintenanceConfiguration_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MaintenanceConfiguration_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", v1beta2.MaintenanceConfiguration_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MaintenanceConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MaintenanceConfiguration_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MaintenanceConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_maintenance_configuration"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MaintenanceConfiguration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MaintenanceConfiguration_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MaintenanceConfiguration + // register webhooks for the kind v1beta1.MaintenanceConfiguration // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MaintenanceConfiguration{}). + For(&v1beta1.MaintenanceConfiguration{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MaintenanceConfiguration") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MaintenanceConfiguration") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MaintenanceConfigurationList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MaintenanceConfigurationList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MaintenanceConfigurationList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MaintenanceConfigurationList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MaintenanceConfiguration_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MaintenanceConfiguration_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MaintenanceConfiguration{}, eventHandler). + Watches(&v1beta1.MaintenanceConfiguration{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/media/assetfilter/zz_controller.go b/internal/controller/media/assetfilter/zz_controller.go index 5fb62a7c2..191215c4c 100755 --- a/internal/controller/media/assetfilter/zz_controller.go +++ b/internal/controller/media/assetfilter/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/media/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles AssetFilter managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.AssetFilter_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.AssetFilter_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", v1beta2.AssetFilter_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.AssetFilter_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AssetFilter_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AssetFilter_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_asset_filter"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.AssetFilter_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AssetFilter_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.AssetFilter + // register webhooks for the kind v1beta1.AssetFilter // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.AssetFilter{}). + For(&v1beta1.AssetFilter{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.AssetFilter") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.AssetFilter") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.AssetFilterList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.AssetFilterList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.AssetFilterList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.AssetFilterList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.AssetFilter_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.AssetFilter_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.AssetFilter{}, eventHandler). + Watches(&v1beta1.AssetFilter{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/media/contentkeypolicy/zz_controller.go b/internal/controller/media/contentkeypolicy/zz_controller.go index a619563e2..86c178616 100755 --- a/internal/controller/media/contentkeypolicy/zz_controller.go +++ b/internal/controller/media/contentkeypolicy/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/media/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ContentKeyPolicy managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ContentKeyPolicy_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ContentKeyPolicy_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", v1beta2.ContentKeyPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ContentKeyPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ContentKeyPolicy_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ContentKeyPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_content_key_policy"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ContentKeyPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ContentKeyPolicy_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ContentKeyPolicy + // register webhooks for the kind v1beta1.ContentKeyPolicy // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ContentKeyPolicy{}). + For(&v1beta1.ContentKeyPolicy{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ContentKeyPolicy") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ContentKeyPolicy") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ContentKeyPolicyList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ContentKeyPolicyList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ContentKeyPolicyList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ContentKeyPolicyList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ContentKeyPolicy_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ContentKeyPolicy_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ContentKeyPolicy{}, eventHandler). + Watches(&v1beta1.ContentKeyPolicy{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/media/job/zz_controller.go b/internal/controller/media/job/zz_controller.go index 78a9e34e6..100590060 100755 --- a/internal/controller/media/job/zz_controller.go +++ b/internal/controller/media/job/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/media/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Job managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Job_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Job_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", v1beta2.Job_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Job_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Job_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Job_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_job"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Job_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Job_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Job + // register webhooks for the kind v1beta1.Job // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Job{}). + For(&v1beta1.Job{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Job") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Job") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.JobList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.JobList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.JobList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.JobList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Job_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Job_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Job{}, eventHandler). + Watches(&v1beta1.Job{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/media/liveevent/zz_controller.go b/internal/controller/media/liveevent/zz_controller.go index e88fd7c2b..60f563afb 100755 --- a/internal/controller/media/liveevent/zz_controller.go +++ b/internal/controller/media/liveevent/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/media/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LiveEvent managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LiveEvent_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LiveEvent_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", v1beta2.LiveEvent_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LiveEvent_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LiveEvent_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LiveEvent_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_live_event"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LiveEvent_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LiveEvent_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LiveEvent + // register webhooks for the kind v1beta1.LiveEvent // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LiveEvent{}). + For(&v1beta1.LiveEvent{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LiveEvent") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LiveEvent") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LiveEventList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LiveEventList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LiveEventList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LiveEventList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LiveEvent_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LiveEvent_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LiveEvent{}, eventHandler). + Watches(&v1beta1.LiveEvent{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/media/servicesaccount/zz_controller.go b/internal/controller/media/servicesaccount/zz_controller.go index 871c2ad3e..721aa11e4 100755 --- a/internal/controller/media/servicesaccount/zz_controller.go +++ b/internal/controller/media/servicesaccount/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/media/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ServicesAccount managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ServicesAccount_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ServicesAccount_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", v1beta2.ServicesAccount_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ServicesAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ServicesAccount_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ServicesAccount_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_services_account"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ServicesAccount_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ServicesAccount_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ServicesAccount + // register webhooks for the kind v1beta1.ServicesAccount // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ServicesAccount{}). + For(&v1beta1.ServicesAccount{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ServicesAccount") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ServicesAccount") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ServicesAccountList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ServicesAccountList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ServicesAccountList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ServicesAccountList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ServicesAccount_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ServicesAccount_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ServicesAccount{}, eventHandler). + Watches(&v1beta1.ServicesAccount{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/media/servicesaccountfilter/zz_controller.go b/internal/controller/media/servicesaccountfilter/zz_controller.go index 67b7425c2..2ff85e02f 100755 --- a/internal/controller/media/servicesaccountfilter/zz_controller.go +++ b/internal/controller/media/servicesaccountfilter/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/media/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ServicesAccountFilter managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ServicesAccountFilter_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ServicesAccountFilter_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", v1beta2.ServicesAccountFilter_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ServicesAccountFilter_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ServicesAccountFilter_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ServicesAccountFilter_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_services_account_filter"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ServicesAccountFilter_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ServicesAccountFilter_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ServicesAccountFilter + // register webhooks for the kind v1beta1.ServicesAccountFilter // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ServicesAccountFilter{}). + For(&v1beta1.ServicesAccountFilter{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ServicesAccountFilter") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ServicesAccountFilter") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ServicesAccountFilterList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ServicesAccountFilterList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ServicesAccountFilterList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ServicesAccountFilterList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ServicesAccountFilter_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ServicesAccountFilter_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ServicesAccountFilter{}, eventHandler). + Watches(&v1beta1.ServicesAccountFilter{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/media/streamingendpoint/zz_controller.go b/internal/controller/media/streamingendpoint/zz_controller.go index 4bcc5ec93..88c9b0da1 100755 --- a/internal/controller/media/streamingendpoint/zz_controller.go +++ b/internal/controller/media/streamingendpoint/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/media/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles StreamingEndpoint managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.StreamingEndpoint_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.StreamingEndpoint_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", v1beta2.StreamingEndpoint_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.StreamingEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.StreamingEndpoint_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamingEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_streaming_endpoint"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.StreamingEndpoint_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.StreamingEndpoint_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.StreamingEndpoint + // register webhooks for the kind v1beta1.StreamingEndpoint // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.StreamingEndpoint{}). + For(&v1beta1.StreamingEndpoint{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.StreamingEndpoint") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.StreamingEndpoint") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.StreamingEndpointList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.StreamingEndpointList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.StreamingEndpointList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.StreamingEndpointList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.StreamingEndpoint_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.StreamingEndpoint_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.StreamingEndpoint{}, eventHandler). + Watches(&v1beta1.StreamingEndpoint{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/media/streamingpolicy/zz_controller.go b/internal/controller/media/streamingpolicy/zz_controller.go index 38790196f..12e22a68f 100755 --- a/internal/controller/media/streamingpolicy/zz_controller.go +++ b/internal/controller/media/streamingpolicy/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/media/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles StreamingPolicy managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.StreamingPolicy_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.StreamingPolicy_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", v1beta2.StreamingPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.StreamingPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.StreamingPolicy_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamingPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_streaming_policy"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.StreamingPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.StreamingPolicy_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.StreamingPolicy + // register webhooks for the kind v1beta1.StreamingPolicy // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.StreamingPolicy{}). + For(&v1beta1.StreamingPolicy{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.StreamingPolicy") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.StreamingPolicy") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.StreamingPolicyList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.StreamingPolicyList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.StreamingPolicyList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.StreamingPolicyList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.StreamingPolicy_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.StreamingPolicy_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.StreamingPolicy{}, eventHandler). + Watches(&v1beta1.StreamingPolicy{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/media/transform/zz_controller.go b/internal/controller/media/transform/zz_controller.go index 108114343..7d0f472b2 100755 --- a/internal/controller/media/transform/zz_controller.go +++ b/internal/controller/media/transform/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/media/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/media/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Transform managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Transform_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Transform_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", v1beta2.Transform_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Transform_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Transform_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Transform_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_media_transform"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Transform_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Transform_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Transform + // register webhooks for the kind v1beta1.Transform // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Transform{}). + For(&v1beta1.Transform{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Transform") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Transform") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.TransformList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.TransformList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.TransformList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.TransformList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Transform_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Transform_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Transform{}, eventHandler). + Watches(&v1beta1.Transform{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/netapp/account/zz_controller.go b/internal/controller/netapp/account/zz_controller.go index bb5b8eba6..af7bc212f 100755 --- a/internal/controller/netapp/account/zz_controller.go +++ b/internal/controller/netapp/account/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/netapp/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/netapp/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Account managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Account_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Account_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", v1beta2.Account_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Account_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_netapp_account"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Account_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Account_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Account + // register webhooks for the kind v1beta1.Account // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Account{}). + For(&v1beta1.Account{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Account") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Account") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.AccountList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.AccountList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.AccountList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.AccountList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Account_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Account{}, eventHandler). + Watches(&v1beta1.Account{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/netapp/snapshotpolicy/zz_controller.go b/internal/controller/netapp/snapshotpolicy/zz_controller.go index 3163cbb94..a7e0a18e1 100755 --- a/internal/controller/netapp/snapshotpolicy/zz_controller.go +++ b/internal/controller/netapp/snapshotpolicy/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/netapp/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/netapp/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SnapshotPolicy managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SnapshotPolicy_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SnapshotPolicy_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", v1beta2.SnapshotPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SnapshotPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SnapshotPolicy_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SnapshotPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_netapp_snapshot_policy"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SnapshotPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SnapshotPolicy_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SnapshotPolicy + // register webhooks for the kind v1beta1.SnapshotPolicy // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SnapshotPolicy{}). + For(&v1beta1.SnapshotPolicy{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SnapshotPolicy") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SnapshotPolicy") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SnapshotPolicyList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SnapshotPolicyList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SnapshotPolicyList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SnapshotPolicyList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SnapshotPolicy_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SnapshotPolicy_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SnapshotPolicy{}, eventHandler). + Watches(&v1beta1.SnapshotPolicy{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/netapp/volume/zz_controller.go b/internal/controller/netapp/volume/zz_controller.go index 24d4a409e..7c4a6fdc5 100755 --- a/internal/controller/netapp/volume/zz_controller.go +++ b/internal/controller/netapp/volume/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/netapp/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/netapp/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Volume managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Volume_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Volume_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", v1beta2.Volume_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Volume_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Volume_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Volume_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_netapp_volume"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Volume_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Volume_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Volume + // register webhooks for the kind v1beta1.Volume // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Volume{}). + For(&v1beta1.Volume{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Volume") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Volume") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.VolumeList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.VolumeList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.VolumeList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.VolumeList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Volume_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Volume_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Volume{}, eventHandler). + Watches(&v1beta1.Volume{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/applicationgateway/zz_controller.go b/internal/controller/network/applicationgateway/zz_controller.go index f98a28d51..d15779c0b 100755 --- a/internal/controller/network/applicationgateway/zz_controller.go +++ b/internal/controller/network/applicationgateway/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ApplicationGateway managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ApplicationGateway_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ApplicationGateway_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", v1beta2.ApplicationGateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ApplicationGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ApplicationGateway_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ApplicationGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_application_gateway"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ApplicationGateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ApplicationGateway_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ApplicationGateway + // register webhooks for the kind v1beta1.ApplicationGateway // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ApplicationGateway{}). + For(&v1beta1.ApplicationGateway{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ApplicationGateway") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ApplicationGateway") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ApplicationGatewayList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ApplicationGatewayList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ApplicationGatewayList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ApplicationGatewayList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ApplicationGateway_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ApplicationGateway_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ApplicationGateway{}, eventHandler). + Watches(&v1beta1.ApplicationGateway{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/connectionmonitor/zz_controller.go b/internal/controller/network/connectionmonitor/zz_controller.go index 06e58b2b0..c01ed0609 100755 --- a/internal/controller/network/connectionmonitor/zz_controller.go +++ b/internal/controller/network/connectionmonitor/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ConnectionMonitor managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ConnectionMonitor_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ConnectionMonitor_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", v1beta2.ConnectionMonitor_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ConnectionMonitor_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + 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.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_connection_monitor"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ConnectionMonitor_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ConnectionMonitor_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ConnectionMonitor + // register webhooks for the kind v1beta1.ConnectionMonitor // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ConnectionMonitor{}). + For(&v1beta1.ConnectionMonitor{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ConnectionMonitor") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ConnectionMonitor") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ConnectionMonitorList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ConnectionMonitorList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ConnectionMonitorList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ConnectionMonitorList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ConnectionMonitor_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ConnectionMonitor_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ConnectionMonitor{}, eventHandler). + Watches(&v1beta1.ConnectionMonitor{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/dnszone/zz_controller.go b/internal/controller/network/dnszone/zz_controller.go index 725bb2457..1aed3aaed 100755 --- a/internal/controller/network/dnszone/zz_controller.go +++ b/internal/controller/network/dnszone/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles DNSZone managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.DNSZone_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.DNSZone_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", v1beta2.DNSZone_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.DNSZone_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.DNSZone_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.DNSZone_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_dns_zone"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.DNSZone_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.DNSZone_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.DNSZone + // register webhooks for the kind v1beta1.DNSZone // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.DNSZone{}). + For(&v1beta1.DNSZone{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.DNSZone") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.DNSZone") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.DNSZoneList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.DNSZoneList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.DNSZoneList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.DNSZoneList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.DNSZone_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.DNSZone_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.DNSZone{}, eventHandler). + Watches(&v1beta1.DNSZone{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/expressroutecircuit/zz_controller.go b/internal/controller/network/expressroutecircuit/zz_controller.go index 7934fd9f9..4c69d76f0 100755 --- a/internal/controller/network/expressroutecircuit/zz_controller.go +++ b/internal/controller/network/expressroutecircuit/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ExpressRouteCircuit managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ExpressRouteCircuit_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ExpressRouteCircuit_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", v1beta2.ExpressRouteCircuit_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ExpressRouteCircuit_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ExpressRouteCircuit_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteCircuit_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_circuit"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ExpressRouteCircuit_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ExpressRouteCircuit_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ExpressRouteCircuit + // register webhooks for the kind v1beta1.ExpressRouteCircuit // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ExpressRouteCircuit{}). + For(&v1beta1.ExpressRouteCircuit{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ExpressRouteCircuit") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ExpressRouteCircuit") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ExpressRouteCircuitList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ExpressRouteCircuitList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ExpressRouteCircuitList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ExpressRouteCircuitList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ExpressRouteCircuit_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteCircuit_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ExpressRouteCircuit{}, eventHandler). + Watches(&v1beta1.ExpressRouteCircuit{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/expressroutecircuitpeering/zz_controller.go b/internal/controller/network/expressroutecircuitpeering/zz_controller.go index 8bd168d55..03dca946c 100755 --- a/internal/controller/network/expressroutecircuitpeering/zz_controller.go +++ b/internal/controller/network/expressroutecircuitpeering/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ExpressRouteCircuitPeering managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ExpressRouteCircuitPeering_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ExpressRouteCircuitPeering_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", v1beta2.ExpressRouteCircuitPeering_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ExpressRouteCircuitPeering_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ExpressRouteCircuitPeering_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteCircuitPeering_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_circuit_peering"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ExpressRouteCircuitPeering_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ExpressRouteCircuitPeering_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ExpressRouteCircuitPeering + // register webhooks for the kind v1beta1.ExpressRouteCircuitPeering // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ExpressRouteCircuitPeering{}). + For(&v1beta1.ExpressRouteCircuitPeering{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ExpressRouteCircuitPeering") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ExpressRouteCircuitPeering") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ExpressRouteCircuitPeeringList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ExpressRouteCircuitPeeringList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ExpressRouteCircuitPeeringList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ExpressRouteCircuitPeeringList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ExpressRouteCircuitPeering_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteCircuitPeering_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ExpressRouteCircuitPeering{}, eventHandler). + Watches(&v1beta1.ExpressRouteCircuitPeering{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/expressrouteconnection/zz_controller.go b/internal/controller/network/expressrouteconnection/zz_controller.go index 963409895..b3b226b5e 100755 --- a/internal/controller/network/expressrouteconnection/zz_controller.go +++ b/internal/controller/network/expressrouteconnection/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ExpressRouteConnection managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ExpressRouteConnection_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ExpressRouteConnection_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", v1beta2.ExpressRouteConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ExpressRouteConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ExpressRouteConnection_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_connection"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ExpressRouteConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ExpressRouteConnection_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ExpressRouteConnection + // register webhooks for the kind v1beta1.ExpressRouteConnection // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ExpressRouteConnection{}). + For(&v1beta1.ExpressRouteConnection{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ExpressRouteConnection") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ExpressRouteConnection") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ExpressRouteConnectionList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ExpressRouteConnectionList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ExpressRouteConnectionList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ExpressRouteConnectionList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ExpressRouteConnection_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ExpressRouteConnection_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ExpressRouteConnection{}, eventHandler). + Watches(&v1beta1.ExpressRouteConnection{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/expressrouteport/zz_controller.go b/internal/controller/network/expressrouteport/zz_controller.go index 5ee6d93c9..cf7cf735c 100755 --- a/internal/controller/network/expressrouteport/zz_controller.go +++ b/internal/controller/network/expressrouteport/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ExpressRoutePort managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ExpressRoutePort_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ExpressRoutePort_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", v1beta2.ExpressRoutePort_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ExpressRoutePort_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ExpressRoutePort_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ExpressRoutePort_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_express_route_port"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ExpressRoutePort_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ExpressRoutePort_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ExpressRoutePort + // register webhooks for the kind v1beta1.ExpressRoutePort // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ExpressRoutePort{}). + For(&v1beta1.ExpressRoutePort{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ExpressRoutePort") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ExpressRoutePort") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ExpressRoutePortList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ExpressRoutePortList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ExpressRoutePortList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ExpressRoutePortList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ExpressRoutePort_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ExpressRoutePort_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ExpressRoutePort{}, eventHandler). + Watches(&v1beta1.ExpressRoutePort{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/firewall/zz_controller.go b/internal/controller/network/firewall/zz_controller.go index 9dbbb314a..f6da0d8db 100755 --- a/internal/controller/network/firewall/zz_controller.go +++ b/internal/controller/network/firewall/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Firewall managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Firewall_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Firewall_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", v1beta2.Firewall_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Firewall_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Firewall_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Firewall_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_firewall"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Firewall_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Firewall_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Firewall + // register webhooks for the kind v1beta1.Firewall // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Firewall{}). + For(&v1beta1.Firewall{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Firewall") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Firewall") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FirewallList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FirewallList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FirewallList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FirewallList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Firewall_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Firewall_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Firewall{}, eventHandler). + Watches(&v1beta1.Firewall{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/firewallpolicy/zz_controller.go b/internal/controller/network/firewallpolicy/zz_controller.go index f98e9b29d..e58a368ed 100755 --- a/internal/controller/network/firewallpolicy/zz_controller.go +++ b/internal/controller/network/firewallpolicy/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles FirewallPolicy managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.FirewallPolicy_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.FirewallPolicy_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", v1beta2.FirewallPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.FirewallPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FirewallPolicy_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FirewallPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_firewall_policy"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.FirewallPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FirewallPolicy_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.FirewallPolicy + // register webhooks for the kind v1beta1.FirewallPolicy // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.FirewallPolicy{}). + For(&v1beta1.FirewallPolicy{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.FirewallPolicy") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.FirewallPolicy") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FirewallPolicyList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FirewallPolicyList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FirewallPolicyList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FirewallPolicyList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.FirewallPolicy_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FirewallPolicy_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.FirewallPolicy{}, eventHandler). + Watches(&v1beta1.FirewallPolicy{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/frontdoor/zz_controller.go b/internal/controller/network/frontdoor/zz_controller.go index f43ca4d52..d2bd5147b 100755 --- a/internal/controller/network/frontdoor/zz_controller.go +++ b/internal/controller/network/frontdoor/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles FrontDoor managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.FrontDoor_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.FrontDoor_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", v1beta2.FrontDoor_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.FrontDoor_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + 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.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_frontdoor"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.FrontDoor_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontDoor_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.FrontDoor + // register webhooks for the kind v1beta1.FrontDoor // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.FrontDoor{}). + For(&v1beta1.FrontDoor{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.FrontDoor") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.FrontDoor") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FrontDoorList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FrontDoorList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FrontDoorList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FrontDoorList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.FrontDoor_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FrontDoor_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.FrontDoor{}, eventHandler). + Watches(&v1beta1.FrontDoor{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/frontdoorcustomhttpsconfiguration/zz_controller.go b/internal/controller/network/frontdoorcustomhttpsconfiguration/zz_controller.go index d970da13b..5fcc7eb8f 100755 --- a/internal/controller/network/frontdoorcustomhttpsconfiguration/zz_controller.go +++ b/internal/controller/network/frontdoorcustomhttpsconfiguration/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles FrontdoorCustomHTTPSConfiguration managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.FrontdoorCustomHTTPSConfiguration_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.FrontdoorCustomHTTPSConfiguration_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.FrontdoorCustomHTTPSConfiguration_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.FrontdoorCustomHTTPSConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorCustomHTTPSConfiguration_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorCustomHTTPSConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_frontdoor_custom_https_configuration"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.FrontdoorCustomHTTPSConfiguration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorCustomHTTPSConfiguration_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.FrontdoorCustomHTTPSConfiguration + // register webhooks for the kind v1beta1.FrontdoorCustomHTTPSConfiguration // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.FrontdoorCustomHTTPSConfiguration{}). + For(&v1beta1.FrontdoorCustomHTTPSConfiguration{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.FrontdoorCustomHTTPSConfiguration") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.FrontdoorCustomHTTPSConfiguration") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FrontdoorCustomHTTPSConfigurationList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FrontdoorCustomHTTPSConfigurationList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FrontdoorCustomHTTPSConfigurationList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FrontdoorCustomHTTPSConfigurationList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.FrontdoorCustomHTTPSConfiguration_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FrontdoorCustomHTTPSConfiguration_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.FrontdoorCustomHTTPSConfiguration{}, eventHandler). + Watches(&v1beta1.FrontdoorCustomHTTPSConfiguration{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/frontdoorrulesengine/zz_controller.go b/internal/controller/network/frontdoorrulesengine/zz_controller.go index 7def1ef39..e7612295f 100755 --- a/internal/controller/network/frontdoorrulesengine/zz_controller.go +++ b/internal/controller/network/frontdoorrulesengine/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles FrontdoorRulesEngine managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.FrontdoorRulesEngine_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.FrontdoorRulesEngine_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", v1beta2.FrontdoorRulesEngine_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.FrontdoorRulesEngine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FrontdoorRulesEngine_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FrontdoorRulesEngine_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_frontdoor_rules_engine"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.FrontdoorRulesEngine_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FrontdoorRulesEngine_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.FrontdoorRulesEngine + // register webhooks for the kind v1beta1.FrontdoorRulesEngine // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.FrontdoorRulesEngine{}). + For(&v1beta1.FrontdoorRulesEngine{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.FrontdoorRulesEngine") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.FrontdoorRulesEngine") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FrontdoorRulesEngineList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FrontdoorRulesEngineList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FrontdoorRulesEngineList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FrontdoorRulesEngineList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.FrontdoorRulesEngine_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FrontdoorRulesEngine_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.FrontdoorRulesEngine{}, eventHandler). + Watches(&v1beta1.FrontdoorRulesEngine{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/localnetworkgateway/zz_controller.go b/internal/controller/network/localnetworkgateway/zz_controller.go index 05c3f8083..8f63c13bc 100755 --- a/internal/controller/network/localnetworkgateway/zz_controller.go +++ b/internal/controller/network/localnetworkgateway/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LocalNetworkGateway managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LocalNetworkGateway_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LocalNetworkGateway_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", v1beta2.LocalNetworkGateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LocalNetworkGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LocalNetworkGateway_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LocalNetworkGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_local_network_gateway"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LocalNetworkGateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LocalNetworkGateway_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LocalNetworkGateway + // register webhooks for the kind v1beta1.LocalNetworkGateway // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LocalNetworkGateway{}). + For(&v1beta1.LocalNetworkGateway{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LocalNetworkGateway") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LocalNetworkGateway") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LocalNetworkGatewayList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LocalNetworkGatewayList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LocalNetworkGatewayList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LocalNetworkGatewayList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LocalNetworkGateway_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LocalNetworkGateway_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LocalNetworkGateway{}, eventHandler). + Watches(&v1beta1.LocalNetworkGateway{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/manager/zz_controller.go b/internal/controller/network/manager/zz_controller.go index 5119429d8..34f0b284b 100755 --- a/internal/controller/network/manager/zz_controller.go +++ b/internal/controller/network/manager/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Manager managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Manager_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Manager_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", v1beta2.Manager_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Manager_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Manager_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Manager_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_manager"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Manager_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Manager_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Manager + // register webhooks for the kind v1beta1.Manager // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Manager{}). + For(&v1beta1.Manager{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Manager") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Manager") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ManagerList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ManagerList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ManagerList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ManagerList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Manager_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Manager_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Manager{}, eventHandler). + Watches(&v1beta1.Manager{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/packetcapture/zz_controller.go b/internal/controller/network/packetcapture/zz_controller.go index 513c6b76c..bf6ab9d78 100755 --- a/internal/controller/network/packetcapture/zz_controller.go +++ b/internal/controller/network/packetcapture/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles PacketCapture managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.PacketCapture_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.PacketCapture_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", v1beta2.PacketCapture_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.PacketCapture_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PacketCapture_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PacketCapture_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_packet_capture"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.PacketCapture_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PacketCapture_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.PacketCapture + // register webhooks for the kind v1beta1.PacketCapture // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.PacketCapture{}). + For(&v1beta1.PacketCapture{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.PacketCapture") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.PacketCapture") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.PacketCaptureList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.PacketCaptureList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.PacketCaptureList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.PacketCaptureList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.PacketCapture_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.PacketCapture_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.PacketCapture{}, eventHandler). + Watches(&v1beta1.PacketCapture{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/pointtositevpngateway/zz_controller.go b/internal/controller/network/pointtositevpngateway/zz_controller.go index 0daf54802..79fdb0415 100755 --- a/internal/controller/network/pointtositevpngateway/zz_controller.go +++ b/internal/controller/network/pointtositevpngateway/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles PointToSiteVPNGateway managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.PointToSiteVPNGateway_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.PointToSiteVPNGateway_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", v1beta2.PointToSiteVPNGateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.PointToSiteVPNGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PointToSiteVPNGateway_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PointToSiteVPNGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_point_to_site_vpn_gateway"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.PointToSiteVPNGateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PointToSiteVPNGateway_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.PointToSiteVPNGateway + // register webhooks for the kind v1beta1.PointToSiteVPNGateway // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.PointToSiteVPNGateway{}). + For(&v1beta1.PointToSiteVPNGateway{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.PointToSiteVPNGateway") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.PointToSiteVPNGateway") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.PointToSiteVPNGatewayList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.PointToSiteVPNGatewayList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.PointToSiteVPNGatewayList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.PointToSiteVPNGatewayList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.PointToSiteVPNGateway_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.PointToSiteVPNGateway_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.PointToSiteVPNGateway{}, eventHandler). + Watches(&v1beta1.PointToSiteVPNGateway{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/privatednszone/zz_controller.go b/internal/controller/network/privatednszone/zz_controller.go index 8f99267dc..47082bb02 100755 --- a/internal/controller/network/privatednszone/zz_controller.go +++ b/internal/controller/network/privatednszone/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles PrivateDNSZone managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.PrivateDNSZone_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.PrivateDNSZone_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", v1beta2.PrivateDNSZone_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.PrivateDNSZone_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + 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.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_private_dns_zone"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.PrivateDNSZone_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PrivateDNSZone_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.PrivateDNSZone + // register webhooks for the kind v1beta1.PrivateDNSZone // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.PrivateDNSZone{}). + For(&v1beta1.PrivateDNSZone{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.PrivateDNSZone") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.PrivateDNSZone") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.PrivateDNSZoneList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.PrivateDNSZoneList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.PrivateDNSZoneList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.PrivateDNSZoneList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.PrivateDNSZone_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.PrivateDNSZone_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.PrivateDNSZone{}, eventHandler). + Watches(&v1beta1.PrivateDNSZone{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/privateendpoint/zz_controller.go b/internal/controller/network/privateendpoint/zz_controller.go index 150441274..26d0925ec 100755 --- a/internal/controller/network/privateendpoint/zz_controller.go +++ b/internal/controller/network/privateendpoint/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles PrivateEndpoint managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.PrivateEndpoint_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.PrivateEndpoint_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", v1beta2.PrivateEndpoint_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.PrivateEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.PrivateEndpoint_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.PrivateEndpoint_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_private_endpoint"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.PrivateEndpoint_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.PrivateEndpoint_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.PrivateEndpoint + // register webhooks for the kind v1beta1.PrivateEndpoint // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.PrivateEndpoint{}). + For(&v1beta1.PrivateEndpoint{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.PrivateEndpoint") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.PrivateEndpoint") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.PrivateEndpointList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.PrivateEndpointList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.PrivateEndpointList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.PrivateEndpointList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.PrivateEndpoint_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.PrivateEndpoint_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.PrivateEndpoint{}, eventHandler). + Watches(&v1beta1.PrivateEndpoint{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/profile/zz_controller.go b/internal/controller/network/profile/zz_controller.go index cd748adf4..fd1ae1753 100755 --- a/internal/controller/network/profile/zz_controller.go +++ b/internal/controller/network/profile/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Profile managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Profile_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Profile_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", v1beta2.Profile_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Profile_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + 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.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_profile"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Profile_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Profile_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Profile + // register webhooks for the kind v1beta1.Profile // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Profile{}). + For(&v1beta1.Profile{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Profile") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Profile") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ProfileList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ProfileList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ProfileList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ProfileList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Profile_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Profile_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Profile{}, eventHandler). + Watches(&v1beta1.Profile{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/subnet/zz_controller.go b/internal/controller/network/subnet/zz_controller.go index 8da9031fe..8d7bd0fb1 100755 --- a/internal/controller/network/subnet/zz_controller.go +++ b/internal/controller/network/subnet/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Subnet managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Subnet_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Subnet_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", v1beta2.Subnet_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Subnet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Subnet_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Subnet_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_subnet"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Subnet_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Subnet_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Subnet + // register webhooks for the kind v1beta1.Subnet // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Subnet{}). + For(&v1beta1.Subnet{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Subnet") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Subnet") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SubnetList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SubnetList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SubnetList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SubnetList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Subnet_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Subnet_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Subnet{}, eventHandler). + Watches(&v1beta1.Subnet{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/trafficmanagerprofile/zz_controller.go b/internal/controller/network/trafficmanagerprofile/zz_controller.go index 5ae8379b9..8c35ce21e 100755 --- a/internal/controller/network/trafficmanagerprofile/zz_controller.go +++ b/internal/controller/network/trafficmanagerprofile/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles TrafficManagerProfile managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.TrafficManagerProfile_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.TrafficManagerProfile_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", v1beta2.TrafficManagerProfile_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.TrafficManagerProfile_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.TrafficManagerProfile_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.TrafficManagerProfile_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_traffic_manager_profile"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.TrafficManagerProfile_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.TrafficManagerProfile_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.TrafficManagerProfile + // register webhooks for the kind v1beta1.TrafficManagerProfile // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.TrafficManagerProfile{}). + For(&v1beta1.TrafficManagerProfile{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.TrafficManagerProfile") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.TrafficManagerProfile") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.TrafficManagerProfileList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.TrafficManagerProfileList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.TrafficManagerProfileList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.TrafficManagerProfileList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.TrafficManagerProfile_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.TrafficManagerProfile_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.TrafficManagerProfile{}, eventHandler). + Watches(&v1beta1.TrafficManagerProfile{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/virtualhubconnection/zz_controller.go b/internal/controller/network/virtualhubconnection/zz_controller.go index 36f7503fa..d48840f0a 100755 --- a/internal/controller/network/virtualhubconnection/zz_controller.go +++ b/internal/controller/network/virtualhubconnection/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles VirtualHubConnection managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.VirtualHubConnection_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.VirtualHubConnection_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", v1beta2.VirtualHubConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.VirtualHubConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualHubConnection_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualHubConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_hub_connection"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.VirtualHubConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualHubConnection_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.VirtualHubConnection + // register webhooks for the kind v1beta1.VirtualHubConnection // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.VirtualHubConnection{}). + For(&v1beta1.VirtualHubConnection{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.VirtualHubConnection") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.VirtualHubConnection") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.VirtualHubConnectionList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.VirtualHubConnectionList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.VirtualHubConnectionList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.VirtualHubConnectionList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.VirtualHubConnection_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.VirtualHubConnection_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.VirtualHubConnection{}, eventHandler). + Watches(&v1beta1.VirtualHubConnection{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/virtualnetwork/zz_controller.go b/internal/controller/network/virtualnetwork/zz_controller.go index 6fe6876bb..5b8b923d2 100755 --- a/internal/controller/network/virtualnetwork/zz_controller.go +++ b/internal/controller/network/virtualnetwork/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles VirtualNetwork managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.VirtualNetwork_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.VirtualNetwork_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", v1beta2.VirtualNetwork_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.VirtualNetwork_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + 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.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_network"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.VirtualNetwork_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualNetwork_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.VirtualNetwork + // register webhooks for the kind v1beta1.VirtualNetwork // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.VirtualNetwork{}). + For(&v1beta1.VirtualNetwork{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.VirtualNetwork") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.VirtualNetwork") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.VirtualNetworkList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.VirtualNetworkList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.VirtualNetworkList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.VirtualNetworkList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.VirtualNetwork_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.VirtualNetwork_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.VirtualNetwork{}, eventHandler). + Watches(&v1beta1.VirtualNetwork{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/virtualnetworkgateway/zz_controller.go b/internal/controller/network/virtualnetworkgateway/zz_controller.go index 276847970..566960d00 100755 --- a/internal/controller/network/virtualnetworkgateway/zz_controller.go +++ b/internal/controller/network/virtualnetworkgateway/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles VirtualNetworkGateway managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.VirtualNetworkGateway_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.VirtualNetworkGateway_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", v1beta2.VirtualNetworkGateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.VirtualNetworkGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualNetworkGateway_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetworkGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_network_gateway"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.VirtualNetworkGateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualNetworkGateway_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.VirtualNetworkGateway + // register webhooks for the kind v1beta1.VirtualNetworkGateway // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.VirtualNetworkGateway{}). + For(&v1beta1.VirtualNetworkGateway{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.VirtualNetworkGateway") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.VirtualNetworkGateway") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.VirtualNetworkGatewayList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.VirtualNetworkGatewayList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.VirtualNetworkGatewayList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.VirtualNetworkGatewayList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.VirtualNetworkGateway_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.VirtualNetworkGateway_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.VirtualNetworkGateway{}, eventHandler). + Watches(&v1beta1.VirtualNetworkGateway{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/virtualnetworkgatewayconnection/zz_controller.go b/internal/controller/network/virtualnetworkgatewayconnection/zz_controller.go index 3956113cc..bb3202233 100755 --- a/internal/controller/network/virtualnetworkgatewayconnection/zz_controller.go +++ b/internal/controller/network/virtualnetworkgatewayconnection/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles VirtualNetworkGatewayConnection managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.VirtualNetworkGatewayConnection_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.VirtualNetworkGatewayConnection_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", v1beta2.VirtualNetworkGatewayConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.VirtualNetworkGatewayConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VirtualNetworkGatewayConnection_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VirtualNetworkGatewayConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_virtual_network_gateway_connection"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.VirtualNetworkGatewayConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VirtualNetworkGatewayConnection_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.VirtualNetworkGatewayConnection + // register webhooks for the kind v1beta1.VirtualNetworkGatewayConnection // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.VirtualNetworkGatewayConnection{}). + For(&v1beta1.VirtualNetworkGatewayConnection{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.VirtualNetworkGatewayConnection") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.VirtualNetworkGatewayConnection") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.VirtualNetworkGatewayConnectionList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.VirtualNetworkGatewayConnectionList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.VirtualNetworkGatewayConnectionList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.VirtualNetworkGatewayConnectionList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.VirtualNetworkGatewayConnection_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.VirtualNetworkGatewayConnection_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.VirtualNetworkGatewayConnection{}, eventHandler). + Watches(&v1beta1.VirtualNetworkGatewayConnection{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/vpngateway/zz_controller.go b/internal/controller/network/vpngateway/zz_controller.go index 8e72bc784..7c46b7f34 100755 --- a/internal/controller/network/vpngateway/zz_controller.go +++ b/internal/controller/network/vpngateway/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles VPNGateway managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.VPNGateway_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.VPNGateway_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", v1beta2.VPNGateway_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.VPNGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VPNGateway_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPNGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_vpn_gateway"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.VPNGateway_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VPNGateway_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.VPNGateway + // register webhooks for the kind v1beta1.VPNGateway // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.VPNGateway{}). + For(&v1beta1.VPNGateway{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.VPNGateway") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.VPNGateway") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.VPNGatewayList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.VPNGatewayList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.VPNGatewayList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.VPNGatewayList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.VPNGateway_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.VPNGateway_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.VPNGateway{}, eventHandler). + Watches(&v1beta1.VPNGateway{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/vpngatewayconnection/zz_controller.go b/internal/controller/network/vpngatewayconnection/zz_controller.go index 2890a40fa..b24cda103 100755 --- a/internal/controller/network/vpngatewayconnection/zz_controller.go +++ b/internal/controller/network/vpngatewayconnection/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles VPNGatewayConnection managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.VPNGatewayConnection_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.VPNGatewayConnection_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", v1beta2.VPNGatewayConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.VPNGatewayConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VPNGatewayConnection_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPNGatewayConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_vpn_gateway_connection"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.VPNGatewayConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VPNGatewayConnection_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.VPNGatewayConnection + // register webhooks for the kind v1beta1.VPNGatewayConnection // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.VPNGatewayConnection{}). + For(&v1beta1.VPNGatewayConnection{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.VPNGatewayConnection") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.VPNGatewayConnection") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.VPNGatewayConnectionList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.VPNGatewayConnectionList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.VPNGatewayConnectionList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.VPNGatewayConnectionList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.VPNGatewayConnection_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.VPNGatewayConnection_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.VPNGatewayConnection{}, eventHandler). + Watches(&v1beta1.VPNGatewayConnection{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/vpnserverconfiguration/zz_controller.go b/internal/controller/network/vpnserverconfiguration/zz_controller.go index 1f4750f8f..b77c6844f 100755 --- a/internal/controller/network/vpnserverconfiguration/zz_controller.go +++ b/internal/controller/network/vpnserverconfiguration/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles VPNServerConfiguration managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.VPNServerConfiguration_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.VPNServerConfiguration_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", v1beta2.VPNServerConfiguration_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.VPNServerConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VPNServerConfiguration_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPNServerConfiguration_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_vpn_server_configuration"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.VPNServerConfiguration_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VPNServerConfiguration_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.VPNServerConfiguration + // register webhooks for the kind v1beta1.VPNServerConfiguration // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.VPNServerConfiguration{}). + For(&v1beta1.VPNServerConfiguration{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.VPNServerConfiguration") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.VPNServerConfiguration") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.VPNServerConfigurationList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.VPNServerConfigurationList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.VPNServerConfigurationList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.VPNServerConfigurationList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.VPNServerConfiguration_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.VPNServerConfiguration_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.VPNServerConfiguration{}, eventHandler). + Watches(&v1beta1.VPNServerConfiguration{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/vpnsite/zz_controller.go b/internal/controller/network/vpnsite/zz_controller.go index 2eb118e31..576505937 100755 --- a/internal/controller/network/vpnsite/zz_controller.go +++ b/internal/controller/network/vpnsite/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles VPNSite managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.VPNSite_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.VPNSite_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", v1beta2.VPNSite_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.VPNSite_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.VPNSite_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.VPNSite_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_vpn_site"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.VPNSite_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.VPNSite_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.VPNSite + // register webhooks for the kind v1beta1.VPNSite // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.VPNSite{}). + For(&v1beta1.VPNSite{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.VPNSite") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.VPNSite") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.VPNSiteList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.VPNSiteList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.VPNSiteList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.VPNSiteList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.VPNSite_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.VPNSite_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.VPNSite{}, eventHandler). + Watches(&v1beta1.VPNSite{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/watcherflowlog/zz_controller.go b/internal/controller/network/watcherflowlog/zz_controller.go index 30c191030..9605446a7 100755 --- a/internal/controller/network/watcherflowlog/zz_controller.go +++ b/internal/controller/network/watcherflowlog/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles WatcherFlowLog managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.WatcherFlowLog_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.WatcherFlowLog_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", v1beta2.WatcherFlowLog_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.WatcherFlowLog_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + 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.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_network_watcher_flow_log"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.WatcherFlowLog_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WatcherFlowLog_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.WatcherFlowLog + // register webhooks for the kind v1beta1.WatcherFlowLog // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.WatcherFlowLog{}). + For(&v1beta1.WatcherFlowLog{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.WatcherFlowLog") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.WatcherFlowLog") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WatcherFlowLogList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WatcherFlowLogList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WatcherFlowLogList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WatcherFlowLogList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.WatcherFlowLog_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.WatcherFlowLog_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.WatcherFlowLog{}, eventHandler). + Watches(&v1beta1.WatcherFlowLog{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/network/webapplicationfirewallpolicy/zz_controller.go b/internal/controller/network/webapplicationfirewallpolicy/zz_controller.go index 6b4fd4180..0948f6270 100755 --- a/internal/controller/network/webapplicationfirewallpolicy/zz_controller.go +++ b/internal/controller/network/webapplicationfirewallpolicy/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/network/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/network/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles WebApplicationFirewallPolicy managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.WebApplicationFirewallPolicy_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.WebApplicationFirewallPolicy_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", v1beta2.WebApplicationFirewallPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.WebApplicationFirewallPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WebApplicationFirewallPolicy_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WebApplicationFirewallPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_web_application_firewall_policy"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.WebApplicationFirewallPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WebApplicationFirewallPolicy_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.WebApplicationFirewallPolicy + // register webhooks for the kind v1beta1.WebApplicationFirewallPolicy // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.WebApplicationFirewallPolicy{}). + For(&v1beta1.WebApplicationFirewallPolicy{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.WebApplicationFirewallPolicy") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.WebApplicationFirewallPolicy") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WebApplicationFirewallPolicyList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WebApplicationFirewallPolicyList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WebApplicationFirewallPolicyList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WebApplicationFirewallPolicyList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.WebApplicationFirewallPolicy_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.WebApplicationFirewallPolicy_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.WebApplicationFirewallPolicy{}, eventHandler). + Watches(&v1beta1.WebApplicationFirewallPolicy{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/notificationhubs/notificationhub/zz_controller.go b/internal/controller/notificationhubs/notificationhub/zz_controller.go index 59f655e0b..a26483ccb 100755 --- a/internal/controller/notificationhubs/notificationhub/zz_controller.go +++ b/internal/controller/notificationhubs/notificationhub/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/notificationhubs/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/notificationhubs/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles NotificationHub managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.NotificationHub_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.NotificationHub_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", v1beta2.NotificationHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.NotificationHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NotificationHub_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NotificationHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_notification_hub"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.NotificationHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NotificationHub_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.NotificationHub + // register webhooks for the kind v1beta1.NotificationHub // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.NotificationHub{}). + For(&v1beta1.NotificationHub{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.NotificationHub") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.NotificationHub") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.NotificationHubList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.NotificationHubList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.NotificationHubList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.NotificationHubList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.NotificationHub_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.NotificationHub_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.NotificationHub{}, eventHandler). + Watches(&v1beta1.NotificationHub{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/operationalinsights/workspace/zz_controller.go b/internal/controller/operationalinsights/workspace/zz_controller.go index 00dc93433..3700be14b 100755 --- a/internal/controller/operationalinsights/workspace/zz_controller.go +++ b/internal/controller/operationalinsights/workspace/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/operationalinsights/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/operationalinsights/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Workspace managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Workspace_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Workspace_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", v1beta2.Workspace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Workspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Workspace_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Workspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_workspace"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Workspace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Workspace_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Workspace + // register webhooks for the kind v1beta1.Workspace // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Workspace{}). + For(&v1beta1.Workspace{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Workspace") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Workspace") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WorkspaceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WorkspaceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WorkspaceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WorkspaceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Workspace_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Workspace_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Workspace{}, eventHandler). + Watches(&v1beta1.Workspace{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/operationsmanagement/loganalyticssolution/zz_controller.go b/internal/controller/operationsmanagement/loganalyticssolution/zz_controller.go index 22a1a651e..45da46023 100755 --- a/internal/controller/operationsmanagement/loganalyticssolution/zz_controller.go +++ b/internal/controller/operationsmanagement/loganalyticssolution/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/operationsmanagement/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/operationsmanagement/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LogAnalyticsSolution managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LogAnalyticsSolution_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LogAnalyticsSolution_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.LogAnalyticsSolution_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LogAnalyticsSolution_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LogAnalyticsSolution_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsSolution_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_log_analytics_solution"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LogAnalyticsSolution_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LogAnalyticsSolution_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LogAnalyticsSolution + // register webhooks for the kind v1beta1.LogAnalyticsSolution // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LogAnalyticsSolution{}). + For(&v1beta1.LogAnalyticsSolution{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LogAnalyticsSolution") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LogAnalyticsSolution") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LogAnalyticsSolutionList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LogAnalyticsSolutionList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LogAnalyticsSolutionList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LogAnalyticsSolutionList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LogAnalyticsSolution_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LogAnalyticsSolution_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LogAnalyticsSolution{}, eventHandler). + Watches(&v1beta1.LogAnalyticsSolution{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/purview/account/zz_controller.go b/internal/controller/purview/account/zz_controller.go index b0ebe7e98..2b219dc24 100755 --- a/internal/controller/purview/account/zz_controller.go +++ b/internal/controller/purview/account/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/purview/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/purview/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Account managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Account_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Account_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", v1beta2.Account_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Account_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_purview_account"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Account_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Account_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Account + // register webhooks for the kind v1beta1.Account // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Account{}). + For(&v1beta1.Account{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Account") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Account") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.AccountList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.AccountList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.AccountList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.AccountList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Account_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Account{}, eventHandler). + Watches(&v1beta1.Account{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/recoveryservices/backuppolicyfileshare/zz_controller.go b/internal/controller/recoveryservices/backuppolicyfileshare/zz_controller.go index 70b65835b..be8cf7425 100755 --- a/internal/controller/recoveryservices/backuppolicyfileshare/zz_controller.go +++ b/internal/controller/recoveryservices/backuppolicyfileshare/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles BackupPolicyFileShare managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.BackupPolicyFileShare_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.BackupPolicyFileShare_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", v1beta2.BackupPolicyFileShare_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.BackupPolicyFileShare_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupPolicyFileShare_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyFileShare_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_backup_policy_file_share"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.BackupPolicyFileShare_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupPolicyFileShare_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.BackupPolicyFileShare + // register webhooks for the kind v1beta1.BackupPolicyFileShare // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.BackupPolicyFileShare{}). + For(&v1beta1.BackupPolicyFileShare{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.BackupPolicyFileShare") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.BackupPolicyFileShare") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.BackupPolicyFileShareList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.BackupPolicyFileShareList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.BackupPolicyFileShareList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.BackupPolicyFileShareList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.BackupPolicyFileShare_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyFileShare_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.BackupPolicyFileShare{}, eventHandler). + Watches(&v1beta1.BackupPolicyFileShare{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/recoveryservices/backuppolicyvm/zz_controller.go b/internal/controller/recoveryservices/backuppolicyvm/zz_controller.go index f6656762d..de58594eb 100755 --- a/internal/controller/recoveryservices/backuppolicyvm/zz_controller.go +++ b/internal/controller/recoveryservices/backuppolicyvm/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles BackupPolicyVM managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.BackupPolicyVM_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.BackupPolicyVM_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", v1beta2.BackupPolicyVM_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.BackupPolicyVM_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupPolicyVM_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyVM_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_backup_policy_vm"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.BackupPolicyVM_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupPolicyVM_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.BackupPolicyVM + // register webhooks for the kind v1beta1.BackupPolicyVM // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.BackupPolicyVM{}). + For(&v1beta1.BackupPolicyVM{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.BackupPolicyVM") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.BackupPolicyVM") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.BackupPolicyVMList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.BackupPolicyVMList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.BackupPolicyVMList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.BackupPolicyVMList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.BackupPolicyVM_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyVM_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.BackupPolicyVM{}, eventHandler). + Watches(&v1beta1.BackupPolicyVM{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/recoveryservices/backuppolicyvmworkload/zz_controller.go b/internal/controller/recoveryservices/backuppolicyvmworkload/zz_controller.go index a3f29c270..6342c8cba 100755 --- a/internal/controller/recoveryservices/backuppolicyvmworkload/zz_controller.go +++ b/internal/controller/recoveryservices/backuppolicyvmworkload/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles BackupPolicyVMWorkload managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.BackupPolicyVMWorkload_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.BackupPolicyVMWorkload_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", v1beta2.BackupPolicyVMWorkload_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.BackupPolicyVMWorkload_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BackupPolicyVMWorkload_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyVMWorkload_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_backup_policy_vm_workload"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.BackupPolicyVMWorkload_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BackupPolicyVMWorkload_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.BackupPolicyVMWorkload + // register webhooks for the kind v1beta1.BackupPolicyVMWorkload // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.BackupPolicyVMWorkload{}). + For(&v1beta1.BackupPolicyVMWorkload{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.BackupPolicyVMWorkload") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.BackupPolicyVMWorkload") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.BackupPolicyVMWorkloadList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.BackupPolicyVMWorkloadList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.BackupPolicyVMWorkloadList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.BackupPolicyVMWorkloadList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.BackupPolicyVMWorkload_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.BackupPolicyVMWorkload_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.BackupPolicyVMWorkload{}, eventHandler). + Watches(&v1beta1.BackupPolicyVMWorkload{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/recoveryservices/siterecoveryprotectioncontainermapping/zz_controller.go b/internal/controller/recoveryservices/siterecoveryprotectioncontainermapping/zz_controller.go index ce21c539f..a03f58cc8 100755 --- a/internal/controller/recoveryservices/siterecoveryprotectioncontainermapping/zz_controller.go +++ b/internal/controller/recoveryservices/siterecoveryprotectioncontainermapping/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SiteRecoveryProtectionContainerMapping managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SiteRecoveryProtectionContainerMapping_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SiteRecoveryProtectionContainerMapping_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", v1beta2.SiteRecoveryProtectionContainerMapping_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SiteRecoveryProtectionContainerMapping_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SiteRecoveryProtectionContainerMapping_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SiteRecoveryProtectionContainerMapping_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_site_recovery_protection_container_mapping"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SiteRecoveryProtectionContainerMapping_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SiteRecoveryProtectionContainerMapping_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SiteRecoveryProtectionContainerMapping + // register webhooks for the kind v1beta1.SiteRecoveryProtectionContainerMapping // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SiteRecoveryProtectionContainerMapping{}). + For(&v1beta1.SiteRecoveryProtectionContainerMapping{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SiteRecoveryProtectionContainerMapping") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SiteRecoveryProtectionContainerMapping") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SiteRecoveryProtectionContainerMappingList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SiteRecoveryProtectionContainerMappingList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SiteRecoveryProtectionContainerMappingList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SiteRecoveryProtectionContainerMappingList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SiteRecoveryProtectionContainerMapping_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SiteRecoveryProtectionContainerMapping_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SiteRecoveryProtectionContainerMapping{}, eventHandler). + Watches(&v1beta1.SiteRecoveryProtectionContainerMapping{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/recoveryservices/vault/zz_controller.go b/internal/controller/recoveryservices/vault/zz_controller.go index 2127d9f03..725a12217 100755 --- a/internal/controller/recoveryservices/vault/zz_controller.go +++ b/internal/controller/recoveryservices/vault/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/recoveryservices/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Vault managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Vault_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Vault_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", v1beta2.Vault_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Vault_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Vault_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Vault_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_recovery_services_vault"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Vault_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Vault_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Vault + // register webhooks for the kind v1beta1.Vault // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Vault{}). + For(&v1beta1.Vault{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Vault") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Vault") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.VaultList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.VaultList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.VaultList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.VaultList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Vault_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Vault_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Vault{}, eventHandler). + Watches(&v1beta1.Vault{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/resources/resourcedeploymentscriptazurecli/zz_controller.go b/internal/controller/resources/resourcedeploymentscriptazurecli/zz_controller.go index ad3f00f5a..1e3c84457 100755 --- a/internal/controller/resources/resourcedeploymentscriptazurecli/zz_controller.go +++ b/internal/controller/resources/resourcedeploymentscriptazurecli/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/resources/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/resources/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ResourceDeploymentScriptAzureCli managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ResourceDeploymentScriptAzureCli_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ResourceDeploymentScriptAzureCli_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.ResourceDeploymentScriptAzureCli_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ResourceDeploymentScriptAzureCli_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ResourceDeploymentScriptAzureCli_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceDeploymentScriptAzureCli_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_resource_deployment_script_azure_cli"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ResourceDeploymentScriptAzureCli_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ResourceDeploymentScriptAzureCli_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ResourceDeploymentScriptAzureCli + // register webhooks for the kind v1beta1.ResourceDeploymentScriptAzureCli // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ResourceDeploymentScriptAzureCli{}). + For(&v1beta1.ResourceDeploymentScriptAzureCli{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ResourceDeploymentScriptAzureCli") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ResourceDeploymentScriptAzureCli") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ResourceDeploymentScriptAzureCliList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ResourceDeploymentScriptAzureCliList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ResourceDeploymentScriptAzureCliList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ResourceDeploymentScriptAzureCliList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ResourceDeploymentScriptAzureCli_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ResourceDeploymentScriptAzureCli_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ResourceDeploymentScriptAzureCli{}, eventHandler). + Watches(&v1beta1.ResourceDeploymentScriptAzureCli{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/resources/resourcedeploymentscriptazurepowershell/zz_controller.go b/internal/controller/resources/resourcedeploymentscriptazurepowershell/zz_controller.go index 0faf53870..e139c7f9a 100755 --- a/internal/controller/resources/resourcedeploymentscriptazurepowershell/zz_controller.go +++ b/internal/controller/resources/resourcedeploymentscriptazurepowershell/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/resources/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/resources/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ResourceDeploymentScriptAzurePowerShell managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ResourceDeploymentScriptAzurePowerShell_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ResourceDeploymentScriptAzurePowerShell_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.ResourceDeploymentScriptAzurePowerShell_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ResourceDeploymentScriptAzurePowerShell_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ResourceDeploymentScriptAzurePowerShell_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ResourceDeploymentScriptAzurePowerShell_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_resource_deployment_script_azure_power_shell"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ResourceDeploymentScriptAzurePowerShell_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ResourceDeploymentScriptAzurePowerShell_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ResourceDeploymentScriptAzurePowerShell + // register webhooks for the kind v1beta1.ResourceDeploymentScriptAzurePowerShell // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ResourceDeploymentScriptAzurePowerShell{}). + For(&v1beta1.ResourceDeploymentScriptAzurePowerShell{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ResourceDeploymentScriptAzurePowerShell") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ResourceDeploymentScriptAzurePowerShell") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ResourceDeploymentScriptAzurePowerShellList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ResourceDeploymentScriptAzurePowerShellList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ResourceDeploymentScriptAzurePowerShellList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ResourceDeploymentScriptAzurePowerShellList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ResourceDeploymentScriptAzurePowerShell_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ResourceDeploymentScriptAzurePowerShell_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ResourceDeploymentScriptAzurePowerShell{}, eventHandler). + Watches(&v1beta1.ResourceDeploymentScriptAzurePowerShell{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/search/service/zz_controller.go b/internal/controller/search/service/zz_controller.go index 597ba0930..bc7d5c5bf 100755 --- a/internal/controller/search/service/zz_controller.go +++ b/internal/controller/search/service/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/search/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/search/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Service managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Service_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Service_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", v1beta2.Service_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Service_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Service_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Service_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_search_service"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Service_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Service_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Service + // register webhooks for the kind v1beta1.Service // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Service{}). + For(&v1beta1.Service{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Service") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Service") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ServiceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ServiceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ServiceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ServiceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Service_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Service_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Service{}, eventHandler). + Watches(&v1beta1.Service{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/security/iotsecuritydevicegroup/zz_controller.go b/internal/controller/security/iotsecuritydevicegroup/zz_controller.go index 7d3abf7c5..f49f9d21d 100755 --- a/internal/controller/security/iotsecuritydevicegroup/zz_controller.go +++ b/internal/controller/security/iotsecuritydevicegroup/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/security/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/security/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles IOTSecurityDeviceGroup managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.IOTSecurityDeviceGroup_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.IOTSecurityDeviceGroup_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.IOTSecurityDeviceGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.IOTSecurityDeviceGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTSecurityDeviceGroup_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTSecurityDeviceGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iot_security_device_group"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.IOTSecurityDeviceGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTSecurityDeviceGroup_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.IOTSecurityDeviceGroup + // register webhooks for the kind v1beta1.IOTSecurityDeviceGroup // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.IOTSecurityDeviceGroup{}). + For(&v1beta1.IOTSecurityDeviceGroup{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.IOTSecurityDeviceGroup") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.IOTSecurityDeviceGroup") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.IOTSecurityDeviceGroupList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.IOTSecurityDeviceGroupList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.IOTSecurityDeviceGroupList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.IOTSecurityDeviceGroupList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.IOTSecurityDeviceGroup_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.IOTSecurityDeviceGroup_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.IOTSecurityDeviceGroup{}, eventHandler). + Watches(&v1beta1.IOTSecurityDeviceGroup{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/security/iotsecuritysolution/zz_controller.go b/internal/controller/security/iotsecuritysolution/zz_controller.go index 46d3784a6..3958bfd5a 100755 --- a/internal/controller/security/iotsecuritysolution/zz_controller.go +++ b/internal/controller/security/iotsecuritysolution/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/security/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/security/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles IOTSecuritySolution managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.IOTSecuritySolution_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.IOTSecuritySolution_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", v1beta2.IOTSecuritySolution_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.IOTSecuritySolution_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.IOTSecuritySolution_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.IOTSecuritySolution_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iot_security_solution"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.IOTSecuritySolution_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.IOTSecuritySolution_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.IOTSecuritySolution + // register webhooks for the kind v1beta1.IOTSecuritySolution // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.IOTSecuritySolution{}). + For(&v1beta1.IOTSecuritySolution{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.IOTSecuritySolution") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.IOTSecuritySolution") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.IOTSecuritySolutionList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.IOTSecuritySolutionList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.IOTSecuritySolutionList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.IOTSecuritySolutionList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.IOTSecuritySolution_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.IOTSecuritySolution_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.IOTSecuritySolution{}, eventHandler). + Watches(&v1beta1.IOTSecuritySolution{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/security/securitycenterassessment/zz_controller.go b/internal/controller/security/securitycenterassessment/zz_controller.go index c36ae2543..0790c877f 100755 --- a/internal/controller/security/securitycenterassessment/zz_controller.go +++ b/internal/controller/security/securitycenterassessment/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/security/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/security/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SecurityCenterAssessment managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SecurityCenterAssessment_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SecurityCenterAssessment_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.SecurityCenterAssessment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SecurityCenterAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SecurityCenterAssessment_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_security_center_assessment"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SecurityCenterAssessment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SecurityCenterAssessment_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SecurityCenterAssessment + // register webhooks for the kind v1beta1.SecurityCenterAssessment // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SecurityCenterAssessment{}). + For(&v1beta1.SecurityCenterAssessment{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SecurityCenterAssessment") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SecurityCenterAssessment") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SecurityCenterAssessmentList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SecurityCenterAssessmentList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SecurityCenterAssessmentList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SecurityCenterAssessmentList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SecurityCenterAssessment_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SecurityCenterAssessment_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SecurityCenterAssessment{}, eventHandler). + Watches(&v1beta1.SecurityCenterAssessment{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/servicebus/servicebusnamespace/zz_controller.go b/internal/controller/servicebus/servicebusnamespace/zz_controller.go index 03d33704b..121f84828 100755 --- a/internal/controller/servicebus/servicebusnamespace/zz_controller.go +++ b/internal/controller/servicebus/servicebusnamespace/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/servicebus/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/servicebus/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ServiceBusNamespace managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ServiceBusNamespace_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ServiceBusNamespace_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", v1beta2.ServiceBusNamespace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ServiceBusNamespace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ServiceBusNamespace_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ServiceBusNamespace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_namespace"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ServiceBusNamespace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ServiceBusNamespace_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ServiceBusNamespace + // register webhooks for the kind v1beta1.ServiceBusNamespace // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ServiceBusNamespace{}). + For(&v1beta1.ServiceBusNamespace{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ServiceBusNamespace") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ServiceBusNamespace") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ServiceBusNamespaceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ServiceBusNamespaceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ServiceBusNamespaceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ServiceBusNamespaceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ServiceBusNamespace_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ServiceBusNamespace_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ServiceBusNamespace{}, eventHandler). + Watches(&v1beta1.ServiceBusNamespace{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/servicebus/subscription/zz_controller.go b/internal/controller/servicebus/subscription/zz_controller.go index 36e0e1e45..7d9fe1909 100755 --- a/internal/controller/servicebus/subscription/zz_controller.go +++ b/internal/controller/servicebus/subscription/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/servicebus/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/servicebus/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Subscription managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Subscription_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Subscription_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", v1beta2.Subscription_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Subscription_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + 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.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_subscription"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Subscription_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Subscription_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Subscription + // register webhooks for the kind v1beta1.Subscription // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Subscription{}). + For(&v1beta1.Subscription{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Subscription") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Subscription") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SubscriptionList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SubscriptionList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SubscriptionList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SubscriptionList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Subscription_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Subscription_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Subscription{}, eventHandler). + Watches(&v1beta1.Subscription{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/servicebus/subscriptionrule/zz_controller.go b/internal/controller/servicebus/subscriptionrule/zz_controller.go index 06bd588ff..0fd5e262d 100755 --- a/internal/controller/servicebus/subscriptionrule/zz_controller.go +++ b/internal/controller/servicebus/subscriptionrule/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/servicebus/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/servicebus/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SubscriptionRule managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SubscriptionRule_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SubscriptionRule_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", v1beta2.SubscriptionRule_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SubscriptionRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SubscriptionRule_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SubscriptionRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_servicebus_subscription_rule"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SubscriptionRule_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SubscriptionRule_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SubscriptionRule + // register webhooks for the kind v1beta1.SubscriptionRule // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SubscriptionRule{}). + For(&v1beta1.SubscriptionRule{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SubscriptionRule") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SubscriptionRule") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SubscriptionRuleList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SubscriptionRuleList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SubscriptionRuleList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SubscriptionRuleList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SubscriptionRule_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SubscriptionRule_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SubscriptionRule{}, eventHandler). + Watches(&v1beta1.SubscriptionRule{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/servicefabric/cluster/zz_controller.go b/internal/controller/servicefabric/cluster/zz_controller.go index dcfd416b2..ac16ed9c5 100755 --- a/internal/controller/servicefabric/cluster/zz_controller.go +++ b/internal/controller/servicefabric/cluster/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/servicefabric/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/servicefabric/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Cluster managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Cluster_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Cluster_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", v1beta2.Cluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Cluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Cluster_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Cluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_service_fabric_cluster"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Cluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Cluster_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Cluster + // register webhooks for the kind v1beta1.Cluster // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Cluster{}). + For(&v1beta1.Cluster{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Cluster") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Cluster") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ClusterList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ClusterList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ClusterList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ClusterList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Cluster_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Cluster_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Cluster{}, eventHandler). + Watches(&v1beta1.Cluster{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/servicefabric/managedcluster/zz_controller.go b/internal/controller/servicefabric/managedcluster/zz_controller.go index fecbbd1f4..907b5101b 100755 --- a/internal/controller/servicefabric/managedcluster/zz_controller.go +++ b/internal/controller/servicefabric/managedcluster/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/servicefabric/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/servicefabric/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ManagedCluster managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ManagedCluster_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ManagedCluster_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", v1beta2.ManagedCluster_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ManagedCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagedCluster_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagedCluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_service_fabric_managed_cluster"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ManagedCluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagedCluster_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ManagedCluster + // register webhooks for the kind v1beta1.ManagedCluster // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ManagedCluster{}). + For(&v1beta1.ManagedCluster{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ManagedCluster") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ManagedCluster") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ManagedClusterList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ManagedClusterList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ManagedClusterList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ManagedClusterList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ManagedCluster_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ManagedCluster_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ManagedCluster{}, eventHandler). + Watches(&v1beta1.ManagedCluster{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/servicelinker/springcloudconnection/zz_controller.go b/internal/controller/servicelinker/springcloudconnection/zz_controller.go index 7d51b0c33..1df4bd96c 100755 --- a/internal/controller/servicelinker/springcloudconnection/zz_controller.go +++ b/internal/controller/servicelinker/springcloudconnection/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/servicelinker/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/servicelinker/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SpringCloudConnection managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SpringCloudConnection_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SpringCloudConnection_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.SpringCloudConnection_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SpringCloudConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SpringCloudConnection_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SpringCloudConnection_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_spring_cloud_connection"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SpringCloudConnection_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SpringCloudConnection_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SpringCloudConnection + // register webhooks for the kind v1beta1.SpringCloudConnection // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SpringCloudConnection{}). + For(&v1beta1.SpringCloudConnection{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SpringCloudConnection") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SpringCloudConnection") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SpringCloudConnectionList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SpringCloudConnectionList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SpringCloudConnectionList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SpringCloudConnectionList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SpringCloudConnection_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SpringCloudConnection_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SpringCloudConnection{}, eventHandler). + Watches(&v1beta1.SpringCloudConnection{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/signalrservice/networkacl/zz_controller.go b/internal/controller/signalrservice/networkacl/zz_controller.go index 63da3791d..bd96ff316 100755 --- a/internal/controller/signalrservice/networkacl/zz_controller.go +++ b/internal/controller/signalrservice/networkacl/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/signalrservice/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/signalrservice/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles NetworkACL managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.NetworkACL_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.NetworkACL_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.NetworkACL_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.NetworkACL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.NetworkACL_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.NetworkACL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_signalr_service_network_acl"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.NetworkACL_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.NetworkACL_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.NetworkACL + // register webhooks for the kind v1beta1.NetworkACL // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.NetworkACL{}). + For(&v1beta1.NetworkACL{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.NetworkACL") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.NetworkACL") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.NetworkACLList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.NetworkACLList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.NetworkACLList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.NetworkACLList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.NetworkACL_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.NetworkACL_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.NetworkACL{}, eventHandler). + Watches(&v1beta1.NetworkACL{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/signalrservice/service/zz_controller.go b/internal/controller/signalrservice/service/zz_controller.go index 0c1f3280e..f90cff49f 100755 --- a/internal/controller/signalrservice/service/zz_controller.go +++ b/internal/controller/signalrservice/service/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/signalrservice/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/signalrservice/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Service managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Service_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Service_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", v1beta2.Service_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Service_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Service_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Service_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_signalr_service"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Service_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Service_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Service + // register webhooks for the kind v1beta1.Service // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Service{}). + For(&v1beta1.Service{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Service") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Service") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ServiceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ServiceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ServiceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ServiceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Service_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Service_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Service{}, eventHandler). + Watches(&v1beta1.Service{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/signalrservice/webpubsub/zz_controller.go b/internal/controller/signalrservice/webpubsub/zz_controller.go index 561bb7804..d544627e1 100755 --- a/internal/controller/signalrservice/webpubsub/zz_controller.go +++ b/internal/controller/signalrservice/webpubsub/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/signalrservice/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/signalrservice/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles WebPubsub managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.WebPubsub_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.WebPubsub_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.WebPubsub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.WebPubsub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WebPubsub_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WebPubsub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_web_pubsub"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.WebPubsub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WebPubsub_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.WebPubsub + // register webhooks for the kind v1beta1.WebPubsub // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.WebPubsub{}). + For(&v1beta1.WebPubsub{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.WebPubsub") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.WebPubsub") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WebPubsubList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WebPubsubList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WebPubsubList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WebPubsubList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.WebPubsub_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.WebPubsub_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.WebPubsub{}, eventHandler). + Watches(&v1beta1.WebPubsub{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/signalrservice/webpubsubhub/zz_controller.go b/internal/controller/signalrservice/webpubsubhub/zz_controller.go index 2c3c8c589..380122ed2 100755 --- a/internal/controller/signalrservice/webpubsubhub/zz_controller.go +++ b/internal/controller/signalrservice/webpubsubhub/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/signalrservice/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/signalrservice/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles WebPubsubHub managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.WebPubsubHub_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.WebPubsubHub_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.WebPubsubHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.WebPubsubHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WebPubsubHub_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WebPubsubHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_web_pubsub_hub"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.WebPubsubHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WebPubsubHub_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.WebPubsubHub + // register webhooks for the kind v1beta1.WebPubsubHub // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.WebPubsubHub{}). + For(&v1beta1.WebPubsubHub{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.WebPubsubHub") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.WebPubsubHub") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WebPubsubHubList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WebPubsubHubList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WebPubsubHubList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WebPubsubHubList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.WebPubsubHub_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.WebPubsubHub_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.WebPubsubHub{}, eventHandler). + Watches(&v1beta1.WebPubsubHub{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/signalrservice/webpubsubnetworkacl/zz_controller.go b/internal/controller/signalrservice/webpubsubnetworkacl/zz_controller.go index b8123fc04..ba5c35bc2 100755 --- a/internal/controller/signalrservice/webpubsubnetworkacl/zz_controller.go +++ b/internal/controller/signalrservice/webpubsubnetworkacl/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/signalrservice/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/signalrservice/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles WebPubsubNetworkACL managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.WebPubsubNetworkACL_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.WebPubsubNetworkACL_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.WebPubsubNetworkACL_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.WebPubsubNetworkACL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WebPubsubNetworkACL_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WebPubsubNetworkACL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_web_pubsub_network_acl"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.WebPubsubNetworkACL_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WebPubsubNetworkACL_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.WebPubsubNetworkACL + // register webhooks for the kind v1beta1.WebPubsubNetworkACL // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.WebPubsubNetworkACL{}). + For(&v1beta1.WebPubsubNetworkACL{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.WebPubsubNetworkACL") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.WebPubsubNetworkACL") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WebPubsubNetworkACLList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WebPubsubNetworkACLList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WebPubsubNetworkACLList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WebPubsubNetworkACLList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.WebPubsubNetworkACL_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.WebPubsubNetworkACL_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.WebPubsubNetworkACL{}, eventHandler). + Watches(&v1beta1.WebPubsubNetworkACL{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/sql/mssqldatabase/zz_controller.go b/internal/controller/sql/mssqldatabase/zz_controller.go index 2a9e6f4f9..c95f31ed1 100755 --- a/internal/controller/sql/mssqldatabase/zz_controller.go +++ b/internal/controller/sql/mssqldatabase/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/sql/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MSSQLDatabase managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MSSQLDatabase_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MSSQLDatabase_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", v1beta2.MSSQLDatabase_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MSSQLDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLDatabase_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_database"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MSSQLDatabase_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLDatabase_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MSSQLDatabase + // register webhooks for the kind v1beta1.MSSQLDatabase // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MSSQLDatabase{}). + For(&v1beta1.MSSQLDatabase{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MSSQLDatabase") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MSSQLDatabase") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MSSQLDatabaseList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MSSQLDatabaseList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MSSQLDatabaseList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MSSQLDatabaseList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MSSQLDatabase_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MSSQLDatabase_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MSSQLDatabase{}, eventHandler). + Watches(&v1beta1.MSSQLDatabase{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/sql/mssqlelasticpool/zz_controller.go b/internal/controller/sql/mssqlelasticpool/zz_controller.go index d3d1bd629..a21594074 100755 --- a/internal/controller/sql/mssqlelasticpool/zz_controller.go +++ b/internal/controller/sql/mssqlelasticpool/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/sql/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MSSQLElasticPool managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MSSQLElasticPool_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MSSQLElasticPool_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", v1beta2.MSSQLElasticPool_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MSSQLElasticPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLElasticPool_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLElasticPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_elasticpool"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MSSQLElasticPool_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLElasticPool_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MSSQLElasticPool + // register webhooks for the kind v1beta1.MSSQLElasticPool // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MSSQLElasticPool{}). + For(&v1beta1.MSSQLElasticPool{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MSSQLElasticPool") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MSSQLElasticPool") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MSSQLElasticPoolList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MSSQLElasticPoolList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MSSQLElasticPoolList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MSSQLElasticPoolList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MSSQLElasticPool_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MSSQLElasticPool_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MSSQLElasticPool{}, eventHandler). + Watches(&v1beta1.MSSQLElasticPool{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/sql/mssqlfailovergroup/zz_controller.go b/internal/controller/sql/mssqlfailovergroup/zz_controller.go index 964f4e0c8..f278a5dee 100755 --- a/internal/controller/sql/mssqlfailovergroup/zz_controller.go +++ b/internal/controller/sql/mssqlfailovergroup/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/sql/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MSSQLFailoverGroup managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MSSQLFailoverGroup_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MSSQLFailoverGroup_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", v1beta2.MSSQLFailoverGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MSSQLFailoverGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLFailoverGroup_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLFailoverGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_failover_group"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MSSQLFailoverGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLFailoverGroup_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MSSQLFailoverGroup + // register webhooks for the kind v1beta1.MSSQLFailoverGroup // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MSSQLFailoverGroup{}). + For(&v1beta1.MSSQLFailoverGroup{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MSSQLFailoverGroup") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MSSQLFailoverGroup") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MSSQLFailoverGroupList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MSSQLFailoverGroupList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MSSQLFailoverGroupList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MSSQLFailoverGroupList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MSSQLFailoverGroup_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MSSQLFailoverGroup_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MSSQLFailoverGroup{}, eventHandler). + Watches(&v1beta1.MSSQLFailoverGroup{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/sql/mssqlmanageddatabase/zz_controller.go b/internal/controller/sql/mssqlmanageddatabase/zz_controller.go index 8c3a11381..4cfe31716 100755 --- a/internal/controller/sql/mssqlmanageddatabase/zz_controller.go +++ b/internal/controller/sql/mssqlmanageddatabase/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/sql/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MSSQLManagedDatabase managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MSSQLManagedDatabase_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MSSQLManagedDatabase_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", v1beta2.MSSQLManagedDatabase_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MSSQLManagedDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLManagedDatabase_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedDatabase_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_managed_database"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MSSQLManagedDatabase_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLManagedDatabase_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MSSQLManagedDatabase + // register webhooks for the kind v1beta1.MSSQLManagedDatabase // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MSSQLManagedDatabase{}). + For(&v1beta1.MSSQLManagedDatabase{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MSSQLManagedDatabase") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MSSQLManagedDatabase") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MSSQLManagedDatabaseList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MSSQLManagedDatabaseList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MSSQLManagedDatabaseList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MSSQLManagedDatabaseList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MSSQLManagedDatabase_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedDatabase_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MSSQLManagedDatabase{}, eventHandler). + Watches(&v1beta1.MSSQLManagedDatabase{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/sql/mssqlmanagedinstance/zz_controller.go b/internal/controller/sql/mssqlmanagedinstance/zz_controller.go index 6b84bfcc6..8019a8314 100755 --- a/internal/controller/sql/mssqlmanagedinstance/zz_controller.go +++ b/internal/controller/sql/mssqlmanagedinstance/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/sql/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MSSQLManagedInstance managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MSSQLManagedInstance_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MSSQLManagedInstance_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", v1beta2.MSSQLManagedInstance_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MSSQLManagedInstance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLManagedInstance_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedInstance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_managed_instance"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MSSQLManagedInstance_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLManagedInstance_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MSSQLManagedInstance + // register webhooks for the kind v1beta1.MSSQLManagedInstance // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MSSQLManagedInstance{}). + For(&v1beta1.MSSQLManagedInstance{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MSSQLManagedInstance") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MSSQLManagedInstance") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MSSQLManagedInstanceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MSSQLManagedInstanceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MSSQLManagedInstanceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MSSQLManagedInstanceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MSSQLManagedInstance_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedInstance_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MSSQLManagedInstance{}, eventHandler). + Watches(&v1beta1.MSSQLManagedInstance{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/sql/mssqlmanagedinstancefailovergroup/zz_controller.go b/internal/controller/sql/mssqlmanagedinstancefailovergroup/zz_controller.go index 8e4dda3d5..c77c1d07e 100755 --- a/internal/controller/sql/mssqlmanagedinstancefailovergroup/zz_controller.go +++ b/internal/controller/sql/mssqlmanagedinstancefailovergroup/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/sql/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MSSQLManagedInstanceFailoverGroup managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MSSQLManagedInstanceFailoverGroup_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MSSQLManagedInstanceFailoverGroup_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", v1beta2.MSSQLManagedInstanceFailoverGroup_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MSSQLManagedInstanceFailoverGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLManagedInstanceFailoverGroup_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedInstanceFailoverGroup_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_managed_instance_failover_group"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MSSQLManagedInstanceFailoverGroup_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLManagedInstanceFailoverGroup_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MSSQLManagedInstanceFailoverGroup + // register webhooks for the kind v1beta1.MSSQLManagedInstanceFailoverGroup // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MSSQLManagedInstanceFailoverGroup{}). + For(&v1beta1.MSSQLManagedInstanceFailoverGroup{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MSSQLManagedInstanceFailoverGroup") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MSSQLManagedInstanceFailoverGroup") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MSSQLManagedInstanceFailoverGroupList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MSSQLManagedInstanceFailoverGroupList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MSSQLManagedInstanceFailoverGroupList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MSSQLManagedInstanceFailoverGroupList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MSSQLManagedInstanceFailoverGroup_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedInstanceFailoverGroup_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MSSQLManagedInstanceFailoverGroup{}, eventHandler). + Watches(&v1beta1.MSSQLManagedInstanceFailoverGroup{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/sql/mssqlmanagedinstancevulnerabilityassessment/zz_controller.go b/internal/controller/sql/mssqlmanagedinstancevulnerabilityassessment/zz_controller.go index 5dfb1f3db..205f0fd29 100755 --- a/internal/controller/sql/mssqlmanagedinstancevulnerabilityassessment/zz_controller.go +++ b/internal/controller/sql/mssqlmanagedinstancevulnerabilityassessment/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/sql/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MSSQLManagedInstanceVulnerabilityAssessment managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MSSQLManagedInstanceVulnerabilityAssessment_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MSSQLManagedInstanceVulnerabilityAssessment_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", v1beta2.MSSQLManagedInstanceVulnerabilityAssessment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MSSQLManagedInstanceVulnerabilityAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLManagedInstanceVulnerabilityAssessment_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedInstanceVulnerabilityAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_managed_instance_vulnerability_assessment"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MSSQLManagedInstanceVulnerabilityAssessment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLManagedInstanceVulnerabilityAssessment_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MSSQLManagedInstanceVulnerabilityAssessment + // register webhooks for the kind v1beta1.MSSQLManagedInstanceVulnerabilityAssessment // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MSSQLManagedInstanceVulnerabilityAssessment{}). + For(&v1beta1.MSSQLManagedInstanceVulnerabilityAssessment{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MSSQLManagedInstanceVulnerabilityAssessment") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MSSQLManagedInstanceVulnerabilityAssessment") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MSSQLManagedInstanceVulnerabilityAssessmentList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MSSQLManagedInstanceVulnerabilityAssessmentList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MSSQLManagedInstanceVulnerabilityAssessmentList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MSSQLManagedInstanceVulnerabilityAssessmentList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MSSQLManagedInstanceVulnerabilityAssessment_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MSSQLManagedInstanceVulnerabilityAssessment_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MSSQLManagedInstanceVulnerabilityAssessment{}, eventHandler). + Watches(&v1beta1.MSSQLManagedInstanceVulnerabilityAssessment{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/sql/mssqlserver/zz_controller.go b/internal/controller/sql/mssqlserver/zz_controller.go index 25d1c2357..b1afa4c2b 100755 --- a/internal/controller/sql/mssqlserver/zz_controller.go +++ b/internal/controller/sql/mssqlserver/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/sql/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MSSQLServer managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MSSQLServer_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MSSQLServer_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", v1beta2.MSSQLServer_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MSSQLServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLServer_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLServer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_server"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MSSQLServer_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLServer_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MSSQLServer + // register webhooks for the kind v1beta1.MSSQLServer // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MSSQLServer{}). + For(&v1beta1.MSSQLServer{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MSSQLServer") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MSSQLServer") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MSSQLServerList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MSSQLServerList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MSSQLServerList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MSSQLServerList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MSSQLServer_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MSSQLServer_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MSSQLServer{}, eventHandler). + Watches(&v1beta1.MSSQLServer{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/sql/mssqlservervulnerabilityassessment/zz_controller.go b/internal/controller/sql/mssqlservervulnerabilityassessment/zz_controller.go index 5fffa2579..54f2b78a5 100755 --- a/internal/controller/sql/mssqlservervulnerabilityassessment/zz_controller.go +++ b/internal/controller/sql/mssqlservervulnerabilityassessment/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/sql/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/sql/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles MSSQLServerVulnerabilityAssessment managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.MSSQLServerVulnerabilityAssessment_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.MSSQLServerVulnerabilityAssessment_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.MSSQLServerVulnerabilityAssessment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.MSSQLServerVulnerabilityAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.MSSQLServerVulnerabilityAssessment_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.MSSQLServerVulnerabilityAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_mssql_server_vulnerability_assessment"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.MSSQLServerVulnerabilityAssessment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.MSSQLServerVulnerabilityAssessment_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.MSSQLServerVulnerabilityAssessment + // register webhooks for the kind v1beta1.MSSQLServerVulnerabilityAssessment // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.MSSQLServerVulnerabilityAssessment{}). + For(&v1beta1.MSSQLServerVulnerabilityAssessment{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.MSSQLServerVulnerabilityAssessment") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.MSSQLServerVulnerabilityAssessment") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.MSSQLServerVulnerabilityAssessmentList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.MSSQLServerVulnerabilityAssessmentList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.MSSQLServerVulnerabilityAssessmentList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.MSSQLServerVulnerabilityAssessmentList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.MSSQLServerVulnerabilityAssessment_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.MSSQLServerVulnerabilityAssessment_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.MSSQLServerVulnerabilityAssessment{}, eventHandler). + Watches(&v1beta1.MSSQLServerVulnerabilityAssessment{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/storage/account/zz_controller.go b/internal/controller/storage/account/zz_controller.go index 069d3fedc..ceb497c88 100755 --- a/internal/controller/storage/account/zz_controller.go +++ b/internal/controller/storage/account/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/storage/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Account managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Account_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Account_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", v1beta2.Account_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Account_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_account"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Account_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Account_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Account + // register webhooks for the kind v1beta1.Account // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Account{}). + For(&v1beta1.Account{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Account") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Account") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.AccountList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.AccountList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.AccountList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.AccountList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Account_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Account_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Account{}, eventHandler). + Watches(&v1beta1.Account{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/storage/accountlocaluser/zz_controller.go b/internal/controller/storage/accountlocaluser/zz_controller.go index fac1d619c..5cb0f87a4 100755 --- a/internal/controller/storage/accountlocaluser/zz_controller.go +++ b/internal/controller/storage/accountlocaluser/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/storage/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles AccountLocalUser managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.AccountLocalUser_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.AccountLocalUser_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", v1beta2.AccountLocalUser_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.AccountLocalUser_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AccountLocalUser_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AccountLocalUser_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_account_local_user"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.AccountLocalUser_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AccountLocalUser_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.AccountLocalUser + // register webhooks for the kind v1beta1.AccountLocalUser // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.AccountLocalUser{}). + For(&v1beta1.AccountLocalUser{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.AccountLocalUser") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.AccountLocalUser") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.AccountLocalUserList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.AccountLocalUserList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.AccountLocalUserList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.AccountLocalUserList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.AccountLocalUser_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.AccountLocalUser_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.AccountLocalUser{}, eventHandler). + Watches(&v1beta1.AccountLocalUser{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/storage/blobinventorypolicy/zz_controller.go b/internal/controller/storage/blobinventorypolicy/zz_controller.go index cae747991..d8487d82c 100755 --- a/internal/controller/storage/blobinventorypolicy/zz_controller.go +++ b/internal/controller/storage/blobinventorypolicy/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/storage/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles BlobInventoryPolicy managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.BlobInventoryPolicy_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.BlobInventoryPolicy_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.BlobInventoryPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.BlobInventoryPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.BlobInventoryPolicy_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.BlobInventoryPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_blob_inventory_policy"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.BlobInventoryPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.BlobInventoryPolicy_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.BlobInventoryPolicy + // register webhooks for the kind v1beta1.BlobInventoryPolicy // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.BlobInventoryPolicy{}). + For(&v1beta1.BlobInventoryPolicy{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.BlobInventoryPolicy") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.BlobInventoryPolicy") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.BlobInventoryPolicyList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.BlobInventoryPolicyList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.BlobInventoryPolicyList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.BlobInventoryPolicyList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.BlobInventoryPolicy_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.BlobInventoryPolicy_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.BlobInventoryPolicy{}, eventHandler). + Watches(&v1beta1.BlobInventoryPolicy{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/storage/managementpolicy/zz_controller.go b/internal/controller/storage/managementpolicy/zz_controller.go index bf368f3f5..d5a29bc92 100755 --- a/internal/controller/storage/managementpolicy/zz_controller.go +++ b/internal/controller/storage/managementpolicy/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/storage/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/storage/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ManagementPolicy managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ManagementPolicy_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ManagementPolicy_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", v1beta2.ManagementPolicy_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ManagementPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ManagementPolicy_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ManagementPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_storage_management_policy"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ManagementPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ManagementPolicy_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ManagementPolicy + // register webhooks for the kind v1beta1.ManagementPolicy // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ManagementPolicy{}). + For(&v1beta1.ManagementPolicy{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ManagementPolicy") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ManagementPolicy") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ManagementPolicyList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ManagementPolicyList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ManagementPolicyList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ManagementPolicyList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ManagementPolicy_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ManagementPolicy_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ManagementPolicy{}, eventHandler). + Watches(&v1beta1.ManagementPolicy{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/storagecache/hpccache/zz_controller.go b/internal/controller/storagecache/hpccache/zz_controller.go index 422c11d1f..63db75263 100755 --- a/internal/controller/storagecache/hpccache/zz_controller.go +++ b/internal/controller/storagecache/hpccache/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/storagecache/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/storagecache/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles HPCCache managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.HPCCache_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.HPCCache_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", v1beta2.HPCCache_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.HPCCache_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.HPCCache_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.HPCCache_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_hpc_cache"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.HPCCache_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.HPCCache_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.HPCCache + // register webhooks for the kind v1beta1.HPCCache // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.HPCCache{}). + For(&v1beta1.HPCCache{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.HPCCache") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.HPCCache") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.HPCCacheList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.HPCCacheList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.HPCCacheList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.HPCCacheList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.HPCCache_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.HPCCache_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.HPCCache{}, eventHandler). + Watches(&v1beta1.HPCCache{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/streamanalytics/functionjavascriptuda/zz_controller.go b/internal/controller/streamanalytics/functionjavascriptuda/zz_controller.go index fa27de347..ceda470bc 100755 --- a/internal/controller/streamanalytics/functionjavascriptuda/zz_controller.go +++ b/internal/controller/streamanalytics/functionjavascriptuda/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles FunctionJavascriptUda managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.FunctionJavascriptUda_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.FunctionJavascriptUda_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", v1beta2.FunctionJavascriptUda_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.FunctionJavascriptUda_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FunctionJavascriptUda_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FunctionJavascriptUda_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_function_javascript_uda"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.FunctionJavascriptUda_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FunctionJavascriptUda_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.FunctionJavascriptUda + // register webhooks for the kind v1beta1.FunctionJavascriptUda // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.FunctionJavascriptUda{}). + For(&v1beta1.FunctionJavascriptUda{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.FunctionJavascriptUda") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.FunctionJavascriptUda") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FunctionJavascriptUdaList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FunctionJavascriptUdaList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FunctionJavascriptUdaList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FunctionJavascriptUdaList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.FunctionJavascriptUda_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FunctionJavascriptUda_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.FunctionJavascriptUda{}, eventHandler). + Watches(&v1beta1.FunctionJavascriptUda{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/streamanalytics/job/zz_controller.go b/internal/controller/streamanalytics/job/zz_controller.go index 9ba7d337d..6d46cb57f 100755 --- a/internal/controller/streamanalytics/job/zz_controller.go +++ b/internal/controller/streamanalytics/job/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Job managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Job_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Job_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", v1beta2.Job_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Job_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Job_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Job_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_job"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Job_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Job_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Job + // register webhooks for the kind v1beta1.Job // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Job{}). + For(&v1beta1.Job{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Job") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Job") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.JobList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.JobList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.JobList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.JobList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Job_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Job_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Job{}, eventHandler). + Watches(&v1beta1.Job{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/streamanalytics/outputblob/zz_controller.go b/internal/controller/streamanalytics/outputblob/zz_controller.go index 704e7d9de..98190ebe7 100755 --- a/internal/controller/streamanalytics/outputblob/zz_controller.go +++ b/internal/controller/streamanalytics/outputblob/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles OutputBlob managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.OutputBlob_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.OutputBlob_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", v1beta2.OutputBlob_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.OutputBlob_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.OutputBlob_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputBlob_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_blob"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.OutputBlob_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.OutputBlob_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.OutputBlob + // register webhooks for the kind v1beta1.OutputBlob // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.OutputBlob{}). + For(&v1beta1.OutputBlob{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.OutputBlob") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.OutputBlob") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.OutputBlobList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.OutputBlobList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.OutputBlobList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.OutputBlobList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.OutputBlob_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.OutputBlob_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.OutputBlob{}, eventHandler). + Watches(&v1beta1.OutputBlob{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/streamanalytics/outputeventhub/zz_controller.go b/internal/controller/streamanalytics/outputeventhub/zz_controller.go index 7479c7209..d31f5bafc 100755 --- a/internal/controller/streamanalytics/outputeventhub/zz_controller.go +++ b/internal/controller/streamanalytics/outputeventhub/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles OutputEventHub managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.OutputEventHub_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.OutputEventHub_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", v1beta2.OutputEventHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.OutputEventHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.OutputEventHub_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputEventHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_eventhub"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.OutputEventHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.OutputEventHub_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.OutputEventHub + // register webhooks for the kind v1beta1.OutputEventHub // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.OutputEventHub{}). + For(&v1beta1.OutputEventHub{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.OutputEventHub") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.OutputEventHub") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.OutputEventHubList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.OutputEventHubList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.OutputEventHubList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.OutputEventHubList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.OutputEventHub_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.OutputEventHub_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.OutputEventHub{}, eventHandler). + Watches(&v1beta1.OutputEventHub{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/streamanalytics/outputservicebusqueue/zz_controller.go b/internal/controller/streamanalytics/outputservicebusqueue/zz_controller.go index 2d170e213..3c4672c90 100755 --- a/internal/controller/streamanalytics/outputservicebusqueue/zz_controller.go +++ b/internal/controller/streamanalytics/outputservicebusqueue/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles OutputServiceBusQueue managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.OutputServiceBusQueue_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.OutputServiceBusQueue_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.OutputServiceBusQueue_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.OutputServiceBusQueue_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.OutputServiceBusQueue_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputServiceBusQueue_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_servicebus_queue"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.OutputServiceBusQueue_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.OutputServiceBusQueue_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.OutputServiceBusQueue + // register webhooks for the kind v1beta1.OutputServiceBusQueue // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.OutputServiceBusQueue{}). + For(&v1beta1.OutputServiceBusQueue{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.OutputServiceBusQueue") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.OutputServiceBusQueue") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.OutputServiceBusQueueList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.OutputServiceBusQueueList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.OutputServiceBusQueueList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.OutputServiceBusQueueList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.OutputServiceBusQueue_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.OutputServiceBusQueue_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.OutputServiceBusQueue{}, eventHandler). + Watches(&v1beta1.OutputServiceBusQueue{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/streamanalytics/outputservicebustopic/zz_controller.go b/internal/controller/streamanalytics/outputservicebustopic/zz_controller.go index 7ef774934..634a034d6 100755 --- a/internal/controller/streamanalytics/outputservicebustopic/zz_controller.go +++ b/internal/controller/streamanalytics/outputservicebustopic/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles OutputServiceBusTopic managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.OutputServiceBusTopic_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.OutputServiceBusTopic_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.OutputServiceBusTopic_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.OutputServiceBusTopic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.OutputServiceBusTopic_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.OutputServiceBusTopic_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_output_servicebus_topic"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.OutputServiceBusTopic_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.OutputServiceBusTopic_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.OutputServiceBusTopic + // register webhooks for the kind v1beta1.OutputServiceBusTopic // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.OutputServiceBusTopic{}). + For(&v1beta1.OutputServiceBusTopic{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.OutputServiceBusTopic") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.OutputServiceBusTopic") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.OutputServiceBusTopicList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.OutputServiceBusTopicList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.OutputServiceBusTopicList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.OutputServiceBusTopicList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.OutputServiceBusTopic_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.OutputServiceBusTopic_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.OutputServiceBusTopic{}, eventHandler). + Watches(&v1beta1.OutputServiceBusTopic{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/streamanalytics/referenceinputblob/zz_controller.go b/internal/controller/streamanalytics/referenceinputblob/zz_controller.go index 83df6d237..44cf81ccf 100755 --- a/internal/controller/streamanalytics/referenceinputblob/zz_controller.go +++ b/internal/controller/streamanalytics/referenceinputblob/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles ReferenceInputBlob managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.ReferenceInputBlob_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.ReferenceInputBlob_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.ReferenceInputBlob_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.ReferenceInputBlob_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ReferenceInputBlob_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ReferenceInputBlob_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_reference_input_blob"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.ReferenceInputBlob_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ReferenceInputBlob_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.ReferenceInputBlob + // register webhooks for the kind v1beta1.ReferenceInputBlob // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.ReferenceInputBlob{}). + For(&v1beta1.ReferenceInputBlob{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.ReferenceInputBlob") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ReferenceInputBlob") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.ReferenceInputBlobList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ReferenceInputBlobList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.ReferenceInputBlobList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ReferenceInputBlobList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.ReferenceInputBlob_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ReferenceInputBlob_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.ReferenceInputBlob{}, eventHandler). + Watches(&v1beta1.ReferenceInputBlob{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/streamanalytics/streaminputblob/zz_controller.go b/internal/controller/streamanalytics/streaminputblob/zz_controller.go index b5e16ec51..8ee962cc4 100755 --- a/internal/controller/streamanalytics/streaminputblob/zz_controller.go +++ b/internal/controller/streamanalytics/streaminputblob/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles StreamInputBlob managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.StreamInputBlob_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.StreamInputBlob_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.StreamInputBlob_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.StreamInputBlob_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.StreamInputBlob_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamInputBlob_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_stream_input_blob"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.StreamInputBlob_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.StreamInputBlob_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.StreamInputBlob + // register webhooks for the kind v1beta1.StreamInputBlob // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.StreamInputBlob{}). + For(&v1beta1.StreamInputBlob{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.StreamInputBlob") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.StreamInputBlob") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.StreamInputBlobList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.StreamInputBlobList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.StreamInputBlobList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.StreamInputBlobList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.StreamInputBlob_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.StreamInputBlob_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.StreamInputBlob{}, eventHandler). + Watches(&v1beta1.StreamInputBlob{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/streamanalytics/streaminputeventhub/zz_controller.go b/internal/controller/streamanalytics/streaminputeventhub/zz_controller.go index 872a13ef7..6b8aae721 100755 --- a/internal/controller/streamanalytics/streaminputeventhub/zz_controller.go +++ b/internal/controller/streamanalytics/streaminputeventhub/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles StreamInputEventHub managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.StreamInputEventHub_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.StreamInputEventHub_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.StreamInputEventHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.StreamInputEventHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.StreamInputEventHub_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamInputEventHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_stream_input_eventhub"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.StreamInputEventHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.StreamInputEventHub_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.StreamInputEventHub + // register webhooks for the kind v1beta1.StreamInputEventHub // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.StreamInputEventHub{}). + For(&v1beta1.StreamInputEventHub{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.StreamInputEventHub") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.StreamInputEventHub") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.StreamInputEventHubList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.StreamInputEventHubList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.StreamInputEventHubList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.StreamInputEventHubList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.StreamInputEventHub_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.StreamInputEventHub_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.StreamInputEventHub{}, eventHandler). + Watches(&v1beta1.StreamInputEventHub{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/streamanalytics/streaminputiothub/zz_controller.go b/internal/controller/streamanalytics/streaminputiothub/zz_controller.go index 2b60214de..c0d485ee4 100755 --- a/internal/controller/streamanalytics/streaminputiothub/zz_controller.go +++ b/internal/controller/streamanalytics/streaminputiothub/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/streamanalytics/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles StreamInputIOTHub managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.StreamInputIOTHub_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.StreamInputIOTHub_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.StreamInputIOTHub_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.StreamInputIOTHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.StreamInputIOTHub_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StreamInputIOTHub_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_stream_analytics_stream_input_iothub"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.StreamInputIOTHub_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.StreamInputIOTHub_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.StreamInputIOTHub + // register webhooks for the kind v1beta1.StreamInputIOTHub // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.StreamInputIOTHub{}). + For(&v1beta1.StreamInputIOTHub{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.StreamInputIOTHub") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.StreamInputIOTHub") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.StreamInputIOTHubList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.StreamInputIOTHubList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.StreamInputIOTHubList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.StreamInputIOTHubList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.StreamInputIOTHub_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.StreamInputIOTHub_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.StreamInputIOTHub{}, eventHandler). + Watches(&v1beta1.StreamInputIOTHub{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/synapse/linkedservice/zz_controller.go b/internal/controller/synapse/linkedservice/zz_controller.go index f05a97da6..30534e3a4 100755 --- a/internal/controller/synapse/linkedservice/zz_controller.go +++ b/internal/controller/synapse/linkedservice/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/synapse/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinkedService managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinkedService_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinkedService_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", v1beta2.LinkedService_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinkedService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinkedService_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinkedService_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_linked_service"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinkedService_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinkedService_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinkedService + // register webhooks for the kind v1beta1.LinkedService // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinkedService{}). + For(&v1beta1.LinkedService{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinkedService") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinkedService") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinkedServiceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinkedServiceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinkedServiceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinkedServiceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinkedService_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinkedService_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinkedService{}, eventHandler). + Watches(&v1beta1.LinkedService{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/synapse/sparkpool/zz_controller.go b/internal/controller/synapse/sparkpool/zz_controller.go index bd30a9fe4..bae57481d 100755 --- a/internal/controller/synapse/sparkpool/zz_controller.go +++ b/internal/controller/synapse/sparkpool/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/synapse/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SparkPool managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SparkPool_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SparkPool_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", v1beta2.SparkPool_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SparkPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SparkPool_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SparkPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_spark_pool"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SparkPool_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SparkPool_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SparkPool + // register webhooks for the kind v1beta1.SparkPool // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SparkPool{}). + For(&v1beta1.SparkPool{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SparkPool") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SparkPool") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SparkPoolList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SparkPoolList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SparkPoolList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SparkPoolList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SparkPool_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SparkPool_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SparkPool{}, eventHandler). + Watches(&v1beta1.SparkPool{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/synapse/sqlpool/zz_controller.go b/internal/controller/synapse/sqlpool/zz_controller.go index 0db2bba73..196160731 100755 --- a/internal/controller/synapse/sqlpool/zz_controller.go +++ b/internal/controller/synapse/sqlpool/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/synapse/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles SQLPool managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.SQLPool_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.SQLPool_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", v1beta2.SQLPool_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.SQLPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.SQLPool_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.SQLPool_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_sql_pool"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.SQLPool_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.SQLPool_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.SQLPool + // register webhooks for the kind v1beta1.SQLPool // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.SQLPool{}). + For(&v1beta1.SQLPool{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.SQLPool") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.SQLPool") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.SQLPoolList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.SQLPoolList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.SQLPoolList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.SQLPoolList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.SQLPool_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.SQLPool_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.SQLPool{}, eventHandler). + Watches(&v1beta1.SQLPool{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/synapse/workspace/zz_controller.go b/internal/controller/synapse/workspace/zz_controller.go index 007ae8cf3..903d94a4f 100755 --- a/internal/controller/synapse/workspace/zz_controller.go +++ b/internal/controller/synapse/workspace/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/synapse/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Workspace managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Workspace_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Workspace_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", v1beta2.Workspace_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Workspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Workspace_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Workspace_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_workspace"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Workspace_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Workspace_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Workspace + // register webhooks for the kind v1beta1.Workspace // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Workspace{}). + For(&v1beta1.Workspace{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Workspace") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Workspace") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WorkspaceList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WorkspaceList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WorkspaceList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WorkspaceList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Workspace_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Workspace_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Workspace{}, eventHandler). + Watches(&v1beta1.Workspace{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/synapse/workspacevulnerabilityassessment/zz_controller.go b/internal/controller/synapse/workspacevulnerabilityassessment/zz_controller.go index d9e191738..990f8f489 100755 --- a/internal/controller/synapse/workspacevulnerabilityassessment/zz_controller.go +++ b/internal/controller/synapse/workspacevulnerabilityassessment/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/synapse/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/synapse/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles WorkspaceVulnerabilityAssessment managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.WorkspaceVulnerabilityAssessment_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.WorkspaceVulnerabilityAssessment_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.WorkspaceVulnerabilityAssessment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.WorkspaceVulnerabilityAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WorkspaceVulnerabilityAssessment_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WorkspaceVulnerabilityAssessment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_synapse_workspace_vulnerability_assessment"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.WorkspaceVulnerabilityAssessment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WorkspaceVulnerabilityAssessment_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.WorkspaceVulnerabilityAssessment + // register webhooks for the kind v1beta1.WorkspaceVulnerabilityAssessment // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.WorkspaceVulnerabilityAssessment{}). + For(&v1beta1.WorkspaceVulnerabilityAssessment{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.WorkspaceVulnerabilityAssessment") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.WorkspaceVulnerabilityAssessment") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WorkspaceVulnerabilityAssessmentList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WorkspaceVulnerabilityAssessmentList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WorkspaceVulnerabilityAssessmentList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WorkspaceVulnerabilityAssessmentList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.WorkspaceVulnerabilityAssessment_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.WorkspaceVulnerabilityAssessment_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.WorkspaceVulnerabilityAssessment{}, eventHandler). + Watches(&v1beta1.WorkspaceVulnerabilityAssessment{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/timeseriesinsights/gen2environment/zz_controller.go b/internal/controller/timeseriesinsights/gen2environment/zz_controller.go index 399949fd1..a2f24c277 100755 --- a/internal/controller/timeseriesinsights/gen2environment/zz_controller.go +++ b/internal/controller/timeseriesinsights/gen2environment/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/timeseriesinsights/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/timeseriesinsights/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles Gen2Environment managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.Gen2Environment_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.Gen2Environment_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", v1beta2.Gen2Environment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.Gen2Environment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Gen2Environment_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Gen2Environment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_iot_time_series_insights_gen2_environment"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.Gen2Environment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Gen2Environment_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.Gen2Environment + // register webhooks for the kind v1beta1.Gen2Environment // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.Gen2Environment{}). + For(&v1beta1.Gen2Environment{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.Gen2Environment") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Gen2Environment") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.Gen2EnvironmentList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.Gen2EnvironmentList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.Gen2EnvironmentList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.Gen2EnvironmentList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.Gen2Environment_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Gen2Environment_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.Gen2Environment{}, eventHandler). + Watches(&v1beta1.Gen2Environment{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/web/appserviceplan/zz_controller.go b/internal/controller/web/appserviceplan/zz_controller.go index 9b9e3ec29..81496d640 100755 --- a/internal/controller/web/appserviceplan/zz_controller.go +++ b/internal/controller/web/appserviceplan/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/web/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles AppServicePlan managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.AppServicePlan_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.AppServicePlan_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", v1beta2.AppServicePlan_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.AppServicePlan_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AppServicePlan_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AppServicePlan_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_app_service_plan"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.AppServicePlan_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AppServicePlan_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.AppServicePlan + // register webhooks for the kind v1beta1.AppServicePlan // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.AppServicePlan{}). + For(&v1beta1.AppServicePlan{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.AppServicePlan") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.AppServicePlan") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.AppServicePlanList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.AppServicePlanList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.AppServicePlanList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.AppServicePlanList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.AppServicePlan_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.AppServicePlan_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.AppServicePlan{}, eventHandler). + Watches(&v1beta1.AppServicePlan{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/web/functionapp/zz_controller.go b/internal/controller/web/functionapp/zz_controller.go index f268a9045..87e28f24f 100755 --- a/internal/controller/web/functionapp/zz_controller.go +++ b/internal/controller/web/functionapp/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/web/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles FunctionApp managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.FunctionApp_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.FunctionApp_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.FunctionApp_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.FunctionApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FunctionApp_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FunctionApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_function_app"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.FunctionApp_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FunctionApp_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.FunctionApp + // register webhooks for the kind v1beta1.FunctionApp // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.FunctionApp{}). + For(&v1beta1.FunctionApp{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.FunctionApp") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.FunctionApp") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FunctionAppList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FunctionAppList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FunctionAppList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FunctionAppList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.FunctionApp_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FunctionApp_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.FunctionApp{}, eventHandler). + Watches(&v1beta1.FunctionApp{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/web/functionappslot/zz_controller.go b/internal/controller/web/functionappslot/zz_controller.go index d43ab36b0..617735636 100755 --- a/internal/controller/web/functionappslot/zz_controller.go +++ b/internal/controller/web/functionappslot/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/web/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles FunctionAppSlot managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.FunctionAppSlot_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.FunctionAppSlot_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", v1beta2.FunctionAppSlot_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.FunctionAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FunctionAppSlot_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FunctionAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_function_app_slot"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.FunctionAppSlot_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.FunctionAppSlot_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.FunctionAppSlot + // register webhooks for the kind v1beta1.FunctionAppSlot // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.FunctionAppSlot{}). + For(&v1beta1.FunctionAppSlot{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.FunctionAppSlot") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.FunctionAppSlot") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.FunctionAppSlotList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.FunctionAppSlotList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.FunctionAppSlotList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.FunctionAppSlotList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.FunctionAppSlot_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FunctionAppSlot_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.FunctionAppSlot{}, eventHandler). + Watches(&v1beta1.FunctionAppSlot{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/web/linuxfunctionapp/zz_controller.go b/internal/controller/web/linuxfunctionapp/zz_controller.go index 56f6069eb..29aec67ef 100755 --- a/internal/controller/web/linuxfunctionapp/zz_controller.go +++ b/internal/controller/web/linuxfunctionapp/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/web/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinuxFunctionApp managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinuxFunctionApp_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinuxFunctionApp_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.LinuxFunctionApp_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinuxFunctionApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinuxFunctionApp_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxFunctionApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_linux_function_app"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinuxFunctionApp_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinuxFunctionApp_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinuxFunctionApp + // register webhooks for the kind v1beta1.LinuxFunctionApp // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinuxFunctionApp{}). + For(&v1beta1.LinuxFunctionApp{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinuxFunctionApp") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinuxFunctionApp") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinuxFunctionAppList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinuxFunctionAppList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinuxFunctionAppList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinuxFunctionAppList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinuxFunctionApp_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinuxFunctionApp_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinuxFunctionApp{}, eventHandler). + Watches(&v1beta1.LinuxFunctionApp{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/web/linuxfunctionappslot/zz_controller.go b/internal/controller/web/linuxfunctionappslot/zz_controller.go index ff91063f9..f001768b1 100755 --- a/internal/controller/web/linuxfunctionappslot/zz_controller.go +++ b/internal/controller/web/linuxfunctionappslot/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/web/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinuxFunctionAppSlot managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinuxFunctionAppSlot_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinuxFunctionAppSlot_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", v1beta2.LinuxFunctionAppSlot_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinuxFunctionAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinuxFunctionAppSlot_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxFunctionAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_linux_function_app_slot"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinuxFunctionAppSlot_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinuxFunctionAppSlot_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinuxFunctionAppSlot + // register webhooks for the kind v1beta1.LinuxFunctionAppSlot // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinuxFunctionAppSlot{}). + For(&v1beta1.LinuxFunctionAppSlot{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinuxFunctionAppSlot") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinuxFunctionAppSlot") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinuxFunctionAppSlotList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinuxFunctionAppSlotList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinuxFunctionAppSlotList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinuxFunctionAppSlotList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinuxFunctionAppSlot_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinuxFunctionAppSlot_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinuxFunctionAppSlot{}, eventHandler). + Watches(&v1beta1.LinuxFunctionAppSlot{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/web/linuxwebapp/zz_controller.go b/internal/controller/web/linuxwebapp/zz_controller.go index f865e64f9..61f2e873f 100755 --- a/internal/controller/web/linuxwebapp/zz_controller.go +++ b/internal/controller/web/linuxwebapp/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/web/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinuxWebApp managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinuxWebApp_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinuxWebApp_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", v1beta2.LinuxWebApp_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinuxWebApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinuxWebApp_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxWebApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_linux_web_app"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinuxWebApp_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinuxWebApp_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinuxWebApp + // register webhooks for the kind v1beta1.LinuxWebApp // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinuxWebApp{}). + For(&v1beta1.LinuxWebApp{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinuxWebApp") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinuxWebApp") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinuxWebAppList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinuxWebAppList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinuxWebAppList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinuxWebAppList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinuxWebApp_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinuxWebApp_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinuxWebApp{}, eventHandler). + Watches(&v1beta1.LinuxWebApp{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/web/linuxwebappslot/zz_controller.go b/internal/controller/web/linuxwebappslot/zz_controller.go index 7b69bfb75..6f92bb2da 100755 --- a/internal/controller/web/linuxwebappslot/zz_controller.go +++ b/internal/controller/web/linuxwebappslot/zz_controller.go @@ -21,27 +21,27 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/web/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles LinuxWebAppSlot managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.LinuxWebAppSlot_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.LinuxWebAppSlot_GroupVersionKind.String()) var initializers managed.InitializerChain 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", v1beta2.LinuxWebAppSlot_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.LinuxWebAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.LinuxWebAppSlot_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.LinuxWebAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_linux_web_app_slot"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.LinuxWebAppSlot_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.LinuxWebAppSlot_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -61,31 +61,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.LinuxWebAppSlot + // register webhooks for the kind v1beta1.LinuxWebAppSlot // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.LinuxWebAppSlot{}). + For(&v1beta1.LinuxWebAppSlot{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.LinuxWebAppSlot") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.LinuxWebAppSlot") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.LinuxWebAppSlotList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.LinuxWebAppSlotList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.LinuxWebAppSlotList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.LinuxWebAppSlotList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.LinuxWebAppSlot_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.LinuxWebAppSlot_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.LinuxWebAppSlot{}, eventHandler). + Watches(&v1beta1.LinuxWebAppSlot{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/web/staticsite/zz_controller.go b/internal/controller/web/staticsite/zz_controller.go index 6be057d89..19409956d 100755 --- a/internal/controller/web/staticsite/zz_controller.go +++ b/internal/controller/web/staticsite/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/web/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles StaticSite managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.StaticSite_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.StaticSite_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", v1beta2.StaticSite_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.StaticSite_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.StaticSite_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.StaticSite_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_static_site"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.StaticSite_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.StaticSite_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.StaticSite + // register webhooks for the kind v1beta1.StaticSite // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.StaticSite{}). + For(&v1beta1.StaticSite{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.StaticSite") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.StaticSite") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.StaticSiteList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.StaticSiteList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.StaticSiteList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.StaticSiteList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.StaticSite_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.StaticSite_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.StaticSite{}, eventHandler). + Watches(&v1beta1.StaticSite{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/web/windowsfunctionapp/zz_controller.go b/internal/controller/web/windowsfunctionapp/zz_controller.go index 77fd3cc9d..e049ac5b0 100755 --- a/internal/controller/web/windowsfunctionapp/zz_controller.go +++ b/internal/controller/web/windowsfunctionapp/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/web/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles WindowsFunctionApp managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.WindowsFunctionApp_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.WindowsFunctionApp_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", v1beta2.WindowsFunctionApp_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.WindowsFunctionApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WindowsFunctionApp_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsFunctionApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_windows_function_app"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.WindowsFunctionApp_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WindowsFunctionApp_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.WindowsFunctionApp + // register webhooks for the kind v1beta1.WindowsFunctionApp // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.WindowsFunctionApp{}). + For(&v1beta1.WindowsFunctionApp{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.WindowsFunctionApp") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.WindowsFunctionApp") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WindowsFunctionAppList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WindowsFunctionAppList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WindowsFunctionAppList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WindowsFunctionAppList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.WindowsFunctionApp_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.WindowsFunctionApp_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.WindowsFunctionApp{}, eventHandler). + Watches(&v1beta1.WindowsFunctionApp{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/web/windowsfunctionappslot/zz_controller.go b/internal/controller/web/windowsfunctionappslot/zz_controller.go index 9ebd105b3..4e440da89 100755 --- a/internal/controller/web/windowsfunctionappslot/zz_controller.go +++ b/internal/controller/web/windowsfunctionappslot/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/web/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles WindowsFunctionAppSlot managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.WindowsFunctionAppSlot_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.WindowsFunctionAppSlot_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", v1beta2.WindowsFunctionAppSlot_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.WindowsFunctionAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WindowsFunctionAppSlot_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsFunctionAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_windows_function_app_slot"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.WindowsFunctionAppSlot_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WindowsFunctionAppSlot_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.WindowsFunctionAppSlot + // register webhooks for the kind v1beta1.WindowsFunctionAppSlot // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.WindowsFunctionAppSlot{}). + For(&v1beta1.WindowsFunctionAppSlot{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.WindowsFunctionAppSlot") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.WindowsFunctionAppSlot") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WindowsFunctionAppSlotList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WindowsFunctionAppSlotList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WindowsFunctionAppSlotList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WindowsFunctionAppSlotList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.WindowsFunctionAppSlot_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.WindowsFunctionAppSlot_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.WindowsFunctionAppSlot{}, eventHandler). + Watches(&v1beta1.WindowsFunctionAppSlot{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/web/windowswebapp/zz_controller.go b/internal/controller/web/windowswebapp/zz_controller.go index 3b3c7a6d7..a589eca2e 100755 --- a/internal/controller/web/windowswebapp/zz_controller.go +++ b/internal/controller/web/windowswebapp/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/web/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles WindowsWebApp managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.WindowsWebApp_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.WindowsWebApp_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", v1beta2.WindowsWebApp_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.WindowsWebApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WindowsWebApp_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsWebApp_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_windows_web_app"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.WindowsWebApp_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WindowsWebApp_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.WindowsWebApp + // register webhooks for the kind v1beta1.WindowsWebApp // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.WindowsWebApp{}). + For(&v1beta1.WindowsWebApp{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.WindowsWebApp") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.WindowsWebApp") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WindowsWebAppList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WindowsWebAppList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WindowsWebAppList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WindowsWebAppList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.WindowsWebApp_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.WindowsWebApp_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.WindowsWebApp{}, eventHandler). + Watches(&v1beta1.WindowsWebApp{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/web/windowswebappslot/zz_controller.go b/internal/controller/web/windowswebappslot/zz_controller.go index b273a2423..22152fa81 100755 --- a/internal/controller/web/windowswebappslot/zz_controller.go +++ b/internal/controller/web/windowswebappslot/zz_controller.go @@ -21,28 +21,28 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-azure/apis/web/v1beta2" + v1beta1 "github.com/upbound/provider-azure/apis/web/v1beta1" features "github.com/upbound/provider-azure/internal/features" ) // Setup adds a controller that reconciles WindowsWebAppSlot managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.WindowsWebAppSlot_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.WindowsWebAppSlot_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", v1beta2.WindowsWebAppSlot_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.WindowsWebAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.WindowsWebAppSlot_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.WindowsWebAppSlot_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["azurerm_windows_web_app_slot"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.WindowsWebAppSlot_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.WindowsWebAppSlot_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -62,31 +62,31 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) } - // register webhooks for the kind v1beta2.WindowsWebAppSlot + // register webhooks for the kind v1beta1.WindowsWebAppSlot // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.WindowsWebAppSlot{}). + For(&v1beta1.WindowsWebAppSlot{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.WindowsWebAppSlot") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.WindowsWebAppSlot") } } if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { stateMetricsRecorder := statemetrics.NewMRStateRecorder( - mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta2.WindowsWebAppSlotList{}, o.MetricOptions.PollStateMetricInterval, + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.WindowsWebAppSlotList{}, o.MetricOptions.PollStateMetricInterval, ) if err := mgr.Add(stateMetricsRecorder); err != nil { - return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta2.WindowsWebAppSlotList") + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.WindowsWebAppSlotList") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.WindowsWebAppSlot_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.WindowsWebAppSlot_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.WindowsWebAppSlot{}, eventHandler). + Watches(&v1beta1.WindowsWebAppSlot{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) }