From f47495a8e8a58831614c6a0c6c6d36225c59abc1 Mon Sep 17 00:00:00 2001 From: Prachi Gandhi Date: Wed, 6 Jul 2022 17:19:46 -0700 Subject: [PATCH] update cloud-provider-azure version for azure imports --- .../cloudprovider/azure/azure_agent_pool.go | 4 +- .../azure/azure_agent_pool_test.go | 4 +- .../cloudprovider/azure/azure_util.go | 4 +- cluster-autoscaler/go.mod | 10 +- cluster-autoscaler/go.sum | 30 +- .../mgmt/2021-02-01/network/CHANGELOG.md | 2 - .../mgmt/2021-08-01/network/CHANGELOG.md | 9 + .../network/_meta.json | 6 +- ...cationgatewayprivateendpointconnections.go | 8 +- .../applicationgatewayprivatelinkresources.go | 2 +- .../network/applicationgateways.go | 34 +- .../network/applicationsecuritygroups.go | 12 +- .../network/availabledelegations.go | 2 +- .../network/availableendpointservices.go | 2 +- .../network/availableprivateendpointtypes.go | 4 +- .../availableresourcegroupdelegations.go | 2 +- .../network/availableservicealiases.go | 4 +- .../network/azurefirewallfqdntags.go | 2 +- .../network/azurefirewalls.go | 12 +- .../network/bastionhosts.go | 104 +- .../network/bgpservicecommunities.go | 2 +- .../network/client.go | 18 +- .../network/configurationpolicygroups.go | 396 +++ .../network/connectionmonitors.go | 16 +- .../network/customipprefixes.go | 20 +- .../network/ddoscustompolicies.go | 8 +- .../network/ddosprotectionplans.go | 12 +- .../network/defaultsecurityrules.go | 4 +- .../network/dscpconfiguration.go | 10 +- .../network/enums.go | 162 +- .../expressroutecircuitauthorizations.go | 8 +- .../network/expressroutecircuitconnections.go | 8 +- .../network/expressroutecircuitpeerings.go | 8 +- .../network/expressroutecircuits.go | 22 +- .../network/expressrouteconnections.go | 8 +- .../expressroutecrossconnectionpeerings.go | 8 +- .../network/expressroutecrossconnections.go | 16 +- .../network/expressroutegateways.go | 12 +- .../network/expressroutelinks.go | 4 +- .../network/expressrouteportauthorizations.go | 395 +++ .../network/expressrouteports.go | 14 +- .../network/expressrouteportslocations.go | 4 +- .../network/expressrouteserviceproviders.go | 2 +- .../network/firewallpolicies.go | 111 +- .../network/firewallpolicyidpssignatures.go | 120 + ...irewallpolicyidpssignaturesfiltervalues.go | 111 + .../firewallpolicyidpssignaturesoverrides.go | 343 +++ .../firewallpolicyrulecollectiongroups.go | 8 +- .../network/flowlogs.go | 10 +- .../network/hubroutetables.go | 8 +- .../network/hubvirtualnetworkconnections.go | 8 +- .../network/inboundnatrules.go | 24 +- .../network/inboundsecurityrule.go | 2 +- .../network/interfaceipconfigurations.go | 4 +- .../network/interfaceloadbalancers.go | 2 +- .../network/interfacesgroup.go | 32 +- .../network/interfacetapconfigurations.go | 8 +- .../network/ipallocations.go | 12 +- .../network/ipgroups.go | 12 +- .../loadbalancerbackendaddresspools.go | 8 +- .../loadbalancerfrontendipconfigurations.go | 4 +- .../network/loadbalancerloadbalancingrules.go | 4 +- .../network/loadbalancernetworkinterfaces.go | 2 +- .../network/loadbalanceroutboundrules.go | 4 +- .../network/loadbalancerprobes.go | 4 +- .../network/loadbalancers.go | 98 +- .../network/localnetworkgateways.go | 10 +- .../network/models.go | 2553 ++++++++++++++++- .../network/natgateways.go | 12 +- .../network/natrules.go | 8 +- .../network/operations.go | 2 +- .../network/p2svpngateways.go | 22 +- .../network/packetcaptures.go | 12 +- .../peerexpressroutecircuitconnections.go | 4 +- .../network/privatednszonegroups.go | 8 +- .../network/privateendpoints.go | 10 +- .../network/privatelinkservices.go | 26 +- .../network/profiles.go | 12 +- .../network/publicipaddresses.go | 24 +- .../network/publicipprefixes.go | 12 +- .../network/resourcenavigationlinks.go | 2 +- .../network/routefilterrules.go | 8 +- .../network/routefilters.go | 12 +- .../network/routes.go | 8 +- .../network/routetables.go | 12 +- .../mgmt/2021-08-01/network/routingintent.go | 393 +++ .../network/securitygroups.go | 12 +- .../network/securitypartnerproviders.go | 12 +- .../network/securityrules.go | 8 +- .../network/serviceassociationlinks.go | 2 +- .../network/serviceendpointpolicies.go | 12 +- .../serviceendpointpolicydefinitions.go | 8 +- .../network/servicetaginformation.go | 158 + .../network/servicetags.go | 2 +- .../network/subnets.go | 12 +- .../network/usages.go | 2 +- .../network/version.go | 2 +- .../network/virtualappliances.go | 12 +- .../network/virtualappliancesites.go | 8 +- .../network/virtualapplianceskus.go | 4 +- .../network/virtualhubbgpconnection.go | 6 +- .../network/virtualhubbgpconnections.go | 6 +- .../network/virtualhubipconfiguration.go | 8 +- .../network/virtualhubroutetablev2s.go | 8 +- .../network/virtualhubs.go | 15 +- .../virtualnetworkgatewayconnections.go | 24 +- .../network/virtualnetworkgatewaynatrules.go | 8 +- .../network/virtualnetworkgateways.go | 44 +- .../network/virtualnetworkpeerings.go | 10 +- .../network/virtualnetworks.go | 18 +- .../network/virtualnetworktaps.go | 12 +- .../network/virtualrouterpeerings.go | 8 +- .../network/virtualrouters.go | 10 +- .../network/virtualwans.go | 12 +- .../network/vpnconnections.go | 12 +- .../network/vpngateways.go | 18 +- .../network/vpnlinkconnections.go | 6 +- .../network/vpnserverconfigurations.go | 12 +- ...rconfigurationsassociatedwithvirtualwan.go | 2 +- .../network/vpnsitelinkconnections.go | 2 +- .../network/vpnsitelinks.go | 4 +- .../network/vpnsites.go | 12 +- .../network/vpnsitesconfiguration.go | 2 +- .../network/watchers.go | 36 +- .../network/webapplicationfirewallpolicies.go | 10 +- .../network/webcategories.go | 4 +- .../Azure/azure-sdk-for-go/version/version.go | 2 +- .../Azure/go-autorest/autorest/adal/README.md | 8 +- .../Azure/go-autorest/autorest/adal/token.go | 31 +- .../assert/assertion_compare_can_convert.go | 2 +- .../stretchr/testify/suite/suite.go | 10 + .../vendor/gopkg.in/yaml.v3/decode.go | 78 +- .../vendor/gopkg.in/yaml.v3/parserc.go | 11 +- cluster-autoscaler/vendor/modules.txt | 17 +- .../pkg/auth/azure_auth.go | 11 + .../azureclients/armclient/azure_armclient.go | 328 +-- .../pkg/azureclients/armclient/interface.go | 22 +- .../pkg/azureclients/armclient/util.go | 169 ++ .../azure_containerserviceclient.go | 22 +- .../azure_deploymentclient.go | 32 +- .../diskclient/azure_diskclient.go | 74 +- .../pkg/azureclients/diskclient/interface.go | 10 +- .../diskclient/mockdiskclient/interface.go | 40 +- .../fileclient/azure_fileclient.go | 10 + .../interfaceclient/azure_interfaceclient.go | 19 +- .../azureclients/interfaceclient/interface.go | 4 +- .../mockinterfaceclient/interface.go | 2 +- .../azure_loadbalancerclient.go | 37 +- .../loadbalancerclient/interface.go | 4 +- .../mockloadbalancerclient/interface.go | 2 +- .../azure_privatednsclient.go | 199 +- .../privatednsclient/interface.go | 18 +- .../azure_privatednszonegroupclient.go | 209 +- .../privatednszonegroupclient/interface.go | 18 +- .../azure_privateendpointclient.go | 193 +- .../azureclients/privateendpointclient/doc.go | 18 + .../privateendpointclient/interface.go | 15 +- .../azure_privatelinkserviceclient.go | 460 +++ .../privatelinkserviceclient/doc.go | 18 + .../privatelinkserviceclient/interface.go | 54 + .../mockprivatelinkserviceclient/doc.go | 18 + .../mockprivatelinkserviceclient/interface.go | 126 + .../publicipclient/azure_publicipclient.go | 19 +- .../azureclients/publicipclient/interface.go | 4 +- .../mockpublicipclient/interface.go | 2 +- .../routeclient/azure_routeclient.go | 17 +- .../pkg/azureclients/routeclient/interface.go | 4 +- .../routeclient/mockrouteclient/interface.go | 2 +- .../azure_routetableclient.go | 15 +- .../routetableclient/interface.go | 4 +- .../mockroutetableclient/interface.go | 2 +- .../azure_securitygroupclient.go | 24 +- .../securitygroupclient/interface.go | 4 +- .../mocksecuritygroupclient/interface.go | 2 +- .../snapshotclient/azure_snapshotclient.go | 68 +- .../azureclients/snapshotclient/interface.go | 8 +- .../mocksnapshotclient/interface.go | 32 +- .../azure_storageaccountclient.go | 102 +- .../storageaccountclient/interface.go | 12 +- .../mockstorageaccountclient/interface.go | 48 +- .../subnetclient/azure_subnetclient.go | 14 +- .../azureclients/subnetclient/interface.go | 4 +- .../mocksubnetclient/interface.go | 2 +- .../azure_virtualnetworklinksclient.go | 193 +- .../virtualnetworklinksclient/doc.go | 18 + .../virtualnetworklinksclient/interface.go | 16 +- .../vmasclient/azure_vmasclient.go | 11 +- .../azureclients/vmclient/azure_vmclient.go | 20 +- .../vmssclient/azure_vmssclient.go | 25 +- .../vmssvmclient/azure_vmssvmclient.go | 32 +- .../zoneclient/azure_zoneclient.go | 8 +- .../cloud-provider-azure/pkg/consts/consts.go | 51 +- .../pkg/consts/helpers.go | 5 + .../pkg/provider/azure.go | 18 + .../pkg/provider/azure_backoff.go | 85 +- .../pkg/provider/azure_controller_common.go | 40 +- .../pkg/provider/azure_controller_standard.go | 17 +- .../pkg/provider/azure_controller_vmss.go | 77 +- .../pkg/provider/azure_fakes.go | 4 + .../pkg/provider/azure_loadbalancer.go | 265 +- .../azure_loadbalancer_backendpool.go | 3 +- .../provider/azure_managedDiskController.go | 100 +- .../azure_mock_loadbalancer_backendpool.go | 2 +- .../pkg/provider/azure_mock_vmsets.go | 14 +- .../pkg/provider/azure_privatelinkservice.go | 667 +++++ .../pkg/provider/azure_routes.go | 6 +- .../pkg/provider/azure_standard.go | 22 +- .../pkg/provider/azure_storageaccount.go | 157 +- .../pkg/provider/azure_utils.go | 26 +- .../pkg/provider/azure_vmsets.go | 8 +- .../pkg/provider/azure_vmss.go | 164 +- .../pkg/provider/azure_wrap.go | 52 +- .../provider/virtualmachine/virtualmachine.go | 146 + .../pkg/retry/azure_retry.go | 3 +- 214 files changed, 9231 insertions(+), 1770 deletions(-) delete mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/CHANGELOG.md create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/CHANGELOG.md rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/_meta.json (80%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/applicationgatewayprivateendpointconnections.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/applicationgatewayprivatelinkresources.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/applicationgateways.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/applicationsecuritygroups.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/availabledelegations.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/availableendpointservices.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/availableprivateendpointtypes.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/availableresourcegroupdelegations.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/availableservicealiases.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/azurefirewallfqdntags.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/azurefirewalls.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/bastionhosts.go (81%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/bgpservicecommunities.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/client.go (99%) create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/configurationpolicygroups.go rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/connectionmonitors.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/customipprefixes.go (96%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/ddoscustompolicies.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/ddosprotectionplans.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/defaultsecurityrules.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/dscpconfiguration.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/enums.go (93%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/expressroutecircuitauthorizations.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/expressroutecircuitconnections.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/expressroutecircuitpeerings.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/expressroutecircuits.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/expressrouteconnections.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/expressroutecrossconnectionpeerings.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/expressroutecrossconnections.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/expressroutegateways.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/expressroutelinks.go (99%) create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteportauthorizations.go rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/expressrouteports.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/expressrouteportslocations.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/expressrouteserviceproviders.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/firewallpolicies.go (77%) create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignatures.go create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignaturesfiltervalues.go create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignaturesoverrides.go rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/firewallpolicyrulecollectiongroups.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/flowlogs.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/hubroutetables.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/hubvirtualnetworkconnections.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/inboundnatrules.go (96%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/inboundsecurityrule.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/interfaceipconfigurations.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/interfaceloadbalancers.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/interfacesgroup.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/interfacetapconfigurations.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/ipallocations.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/ipgroups.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/loadbalancerbackendaddresspools.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/loadbalancerfrontendipconfigurations.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/loadbalancerloadbalancingrules.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/loadbalancernetworkinterfaces.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/loadbalanceroutboundrules.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/loadbalancerprobes.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/loadbalancers.go (85%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/localnetworkgateways.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/models.go (94%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/natgateways.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/natrules.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/operations.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/p2svpngateways.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/packetcaptures.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/peerexpressroutecircuitconnections.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/privatednszonegroups.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/privateendpoints.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/privatelinkservices.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/profiles.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/publicipaddresses.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/publicipprefixes.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/resourcenavigationlinks.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/routefilterrules.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/routefilters.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/routes.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/routetables.go (99%) create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routingintent.go rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/securitygroups.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/securitypartnerproviders.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/securityrules.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/serviceassociationlinks.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/serviceendpointpolicies.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/serviceendpointpolicydefinitions.go (99%) create mode 100644 cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/servicetaginformation.go rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/servicetags.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/subnets.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/usages.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/version.go (90%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualappliances.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualappliancesites.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualapplianceskus.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualhubbgpconnection.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualhubbgpconnections.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualhubipconfiguration.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualhubroutetablev2s.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualhubs.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualnetworkgatewayconnections.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualnetworkgatewaynatrules.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualnetworkgateways.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualnetworkpeerings.go (97%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualnetworks.go (98%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualnetworktaps.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualrouterpeerings.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualrouters.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/virtualwans.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/vpnconnections.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/vpngateways.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/vpnlinkconnections.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/vpnserverconfigurations.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/vpnserverconfigurationsassociatedwithvirtualwan.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/vpnsitelinkconnections.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/vpnsitelinks.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/vpnsites.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/vpnsitesconfiguration.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/watchers.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/webapplicationfirewallpolicies.go (99%) rename cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/{2021-02-01 => 2021-08-01}/network/webcategories.go (99%) create mode 100644 cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/util.go create mode 100644 cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/doc.go create mode 100644 cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/azure_privatelinkserviceclient.go create mode 100644 cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/doc.go create mode 100644 cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/interface.go create mode 100644 cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/mockprivatelinkserviceclient/doc.go create mode 100644 cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/mockprivatelinkserviceclient/interface.go create mode 100644 cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/virtualnetworklinksclient/doc.go create mode 100644 cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_privatelinkservice.go create mode 100644 cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/virtualmachine/virtualmachine.go diff --git a/cluster-autoscaler/cloudprovider/azure/azure_agent_pool.go b/cluster-autoscaler/cloudprovider/azure/azure_agent_pool.go index dbc697016e29..ed5a42878b15 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_agent_pool.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_agent_pool.go @@ -498,7 +498,7 @@ func (as *AgentPool) deleteBlob(accountName, vhdContainer, vhdBlob string) error ctx, cancel := getContextWithCancel() defer cancel() - storageKeysResult, rerr := as.manager.azClient.storageAccountsClient.ListKeys(ctx, as.manager.config.ResourceGroup, accountName) + storageKeysResult, rerr := as.manager.azClient.storageAccountsClient.ListKeys(ctx, as.manager.config.SubscriptionID, as.manager.config.ResourceGroup, accountName) if rerr != nil { return rerr.Error() } @@ -600,7 +600,7 @@ func (as *AgentPool) deleteVirtualMachine(name string) error { klog.Infof("deleting managed disk: %s/%s", as.manager.config.ResourceGroup, *osDiskName) disksCtx, disksCancel := getContextWithCancel() defer disksCancel() - rerr := as.manager.azClient.disksClient.Delete(disksCtx, as.manager.config.ResourceGroup, *osDiskName) + rerr := as.manager.azClient.disksClient.Delete(disksCtx, as.manager.config.SubscriptionID, as.manager.config.ResourceGroup, *osDiskName) _, realErr := checkResourceExistsFromRetryError(rerr) if realErr != nil { return realErr diff --git a/cluster-autoscaler/cloudprovider/azure/azure_agent_pool_test.go b/cluster-autoscaler/cloudprovider/azure/azure_agent_pool_test.go index cf410db02f7c..661e4de6c246 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_agent_pool_test.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_agent_pool_test.go @@ -409,7 +409,7 @@ func TestDeleteInstances(t *testing.T) { } mockVMClient.EXPECT().Get(gomock.Any(), as.manager.config.ResourceGroup, "as-vm-0", gomock.Any()).Return(getExpectedVMs()[0], nil) mockVMClient.EXPECT().Delete(gomock.Any(), as.manager.config.ResourceGroup, "as-vm-0").Return(nil) - mockSAClient.EXPECT().ListKeys(gomock.Any(), as.manager.config.ResourceGroup, "foo").Return(storage.AccountListKeysResult{ + mockSAClient.EXPECT().ListKeys(gomock.Any(), as.manager.config.SubscriptionID, as.manager.config.ResourceGroup, "foo").Return(storage.AccountListKeysResult{ Keys: &[]storage.AccountKey{ {Value: to.StringPtr("dmFsdWUK")}, }, @@ -458,7 +458,7 @@ func TestAgentPoolDeleteNodes(t *testing.T) { as.manager.azureCache.instanceToNodeGroup[azureRef{Name: testValidProviderID0}] = as mockVMClient.EXPECT().Get(gomock.Any(), as.manager.config.ResourceGroup, "as-vm-0", gomock.Any()).Return(getExpectedVMs()[0], nil) mockVMClient.EXPECT().Delete(gomock.Any(), as.manager.config.ResourceGroup, "as-vm-0").Return(nil) - mockSAClient.EXPECT().ListKeys(gomock.Any(), as.manager.config.ResourceGroup, "foo").Return(storage.AccountListKeysResult{ + mockSAClient.EXPECT().ListKeys(gomock.Any(), as.manager.config.SubscriptionID, as.manager.config.ResourceGroup, "foo").Return(storage.AccountListKeysResult{ Keys: &[]storage.AccountKey{ {Value: to.StringPtr("dmFsdWUK")}, }, diff --git a/cluster-autoscaler/cloudprovider/azure/azure_util.go b/cluster-autoscaler/cloudprovider/azure/azure_util.go index 9ddd33e768d9..f10a99ddf0bf 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_util.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_util.go @@ -103,7 +103,7 @@ func (util *AzUtil) DeleteBlob(accountName, vhdContainer, vhdBlob string) error ctx, cancel := getContextWithCancel() defer cancel() - storageKeysResult, rerr := util.manager.azClient.storageAccountsClient.ListKeys(ctx, util.manager.config.ResourceGroup, accountName) + storageKeysResult, rerr := util.manager.azClient.storageAccountsClient.ListKeys(ctx, util.manager.config.SubscriptionID, util.manager.config.ResourceGroup, accountName) if rerr != nil { return rerr.Error() } @@ -206,7 +206,7 @@ func (util *AzUtil) DeleteVirtualMachine(rg string, name string) error { klog.Infof("deleting managed disk: %s/%s", rg, *osDiskName) disksCtx, disksCancel := getContextWithCancel() defer disksCancel() - diskErr := util.manager.azClient.disksClient.Delete(disksCtx, rg, *osDiskName) + diskErr := util.manager.azClient.disksClient.Delete(disksCtx, util.manager.config.SubscriptionID, rg, *osDiskName) _, realErr := checkResourceExistsFromRetryError(diskErr) if realErr != nil { return realErr diff --git a/cluster-autoscaler/go.mod b/cluster-autoscaler/go.mod index 7f951c17de1b..af4d2f1c9f0f 100644 --- a/cluster-autoscaler/go.mod +++ b/cluster-autoscaler/go.mod @@ -4,9 +4,9 @@ go 1.16 require ( cloud.google.com/go v0.81.0 - github.com/Azure/azure-sdk-for-go v63.4.0+incompatible + github.com/Azure/azure-sdk-for-go v65.0.0+incompatible github.com/Azure/go-autorest/autorest v0.11.27 - github.com/Azure/go-autorest/autorest/adal v0.9.19 + github.com/Azure/go-autorest/autorest/adal v0.9.20 github.com/Azure/go-autorest/autorest/azure/auth v0.5.8 github.com/Azure/go-autorest/autorest/date v0.3.0 github.com/Azure/go-autorest/autorest/to v0.4.0 @@ -25,7 +25,7 @@ require ( github.com/prometheus/client_golang v1.12.1 github.com/satori/go.uuid v1.2.0 github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.7.1 + github.com/stretchr/testify v1.7.2 golang.org/x/crypto v0.0.0-20220214200702-86341886e292 golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 google.golang.org/api v0.46.0 @@ -41,11 +41,11 @@ require ( k8s.io/component-base v0.25.0-alpha.0 k8s.io/component-helpers v0.25.0-alpha.0 k8s.io/klog/v2 v2.60.1 - k8s.io/kubelet v0.24.0 + k8s.io/kubelet v0.24.1 k8s.io/kubernetes v1.25.0-alpha.0 k8s.io/legacy-cloud-providers v0.0.0 k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 - sigs.k8s.io/cloud-provider-azure v1.23.11 + sigs.k8s.io/cloud-provider-azure v1.24.2 ) replace github.com/aws/aws-sdk-go/service/eks => github.com/aws/aws-sdk-go/service/eks v1.38.49 diff --git a/cluster-autoscaler/go.sum b/cluster-autoscaler/go.sum index 2b6861f95d04..cb3a379c3ad2 100644 --- a/cluster-autoscaler/go.sum +++ b/cluster-autoscaler/go.sum @@ -43,9 +43,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go v46.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v55.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v63.4.0+incompatible h1:fle3M5Q7vr8auaiPffKyUQmLbvYeqpw30bKU6PrWJFo= -github.com/Azure/azure-sdk-for-go v63.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/azure-sdk-for-go v65.0.0+incompatible h1:HzKLt3kIwMm4KeJYTdx9EbjRYTySD/t8i1Ee/W5EGXw= +github.com/Azure/azure-sdk-for-go v65.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= @@ -60,8 +59,8 @@ github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyC github.com/Azure/go-autorest/autorest/adal v0.9.11/go.mod h1:nBKAnTomx8gDtl+3ZCJv2v0KACFHWTB2drffI1B68Pk= github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= -github.com/Azure/go-autorest/autorest/adal v0.9.19 h1:5CHCGJjd9AedaD0iHhMTCRJPypw+hyCrtT9sLk/dD0w= -github.com/Azure/go-autorest/autorest/adal v0.9.19/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= +github.com/Azure/go-autorest/autorest/adal v0.9.20 h1:gJ3E98kMpFB1MFqQCvA1yFab8vthOeD4VlFRQULxahg= +github.com/Azure/go-autorest/autorest/adal v0.9.20/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= github.com/Azure/go-autorest/autorest/azure/auth v0.5.8 h1:TzPg6B6fTZ0G1zBf3T54aI7p3cAT6u//TOXGPmFMOXg= github.com/Azure/go-autorest/autorest/azure/auth v0.5.8/go.mod h1:kxyKZTSfKh8OVFWPAgOgQ/frrJgeYQJPyR5fLFmXko4= github.com/Azure/go-autorest/autorest/azure/cli v0.4.2 h1:dMOmEJfkLKW/7JsokJqkyoYSgmR08hi9KrhjZb+JALY= @@ -413,7 +412,6 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/gophercloud/gophercloud v0.1.0 h1:P/nh25+rzXouhytV2pUHBb65fnds26Ghl8/391+sT5o= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -550,7 +548,6 @@ github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0Gq github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= github.com/moby/sys/mountinfo v0.6.0 h1:gUDhXQx58YNrpHlK4nSL+7y2pxFZkUcXqzFDKWdC0Oo= github.com/moby/sys/mountinfo v0.6.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= -github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -638,7 +635,6 @@ github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -717,8 +713,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= @@ -826,7 +822,6 @@ golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220214200702-86341886e292 h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1007,7 +1002,6 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1058,7 +1052,6 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1215,7 +1208,6 @@ google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaE google.golang.org/genproto v0.0.0-20210429181445-86c259c2b4ab/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368 h1:Et6SkiuvnBn+SgrSYXs/BrUpGB4mbdwt4R3vaPIlicA= google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1292,8 +1284,9 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= @@ -1333,13 +1326,11 @@ k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAE k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/klog/v2 v2.60.1 h1:VW25q3bZx9uE3vvdL6M8ezOX79vA2Aq1nEWLqNQclHc= k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-aggregator v0.25.0-alpha.0/go.mod h1:olUoQP9QzHZXFHlanZEsN/PidLiFmofGlye1vfnc9wE= k8s.io/kube-controller-manager v0.25.0-alpha.0/go.mod h1:dXBOS6Y2tkaicPsYw0BjwJL54u/wWc7BSLuNUjGpKcw= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 h1:Gii5eqf+GmIEwGNKQYQClCayuJCe2/4fZUvF7VG99sU= k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= k8s.io/kube-proxy v0.25.0-alpha.0 h1:Mkuvc9thTA22fuScC7Ue9qR5NXbhwATmy270QL12B4s= @@ -1375,9 +1366,8 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30 h1:dUk62HQ3ZFhD48Qr8MIXCiKA8wInBQCtuE4QGfFW7yA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= -sigs.k8s.io/cloud-provider-azure v1.23.11 h1:qyK1Sc765r6SDnSHjYxYf+iSP/XKIpus4pW7Z36g2Wk= -sigs.k8s.io/cloud-provider-azure v1.23.11/go.mod h1:erGu3WmmGrDhGeW2NZw7H0zBaFKqgK70FwMzruxLN64= -sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= +sigs.k8s.io/cloud-provider-azure v1.24.2 h1:t0c3Q7GAGQ0oqyl/KiHLtkS4obEYJpAMRYUuhEtgs/k= +sigs.k8s.io/cloud-provider-azure v1.24.2/go.mod h1:uKqonMQbC2zqwq7NIWOfQLgrsMzD02Wj5UFFl1te1GY= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= sigs.k8s.io/kustomize/api v0.11.4/go.mod h1:k+8RsqYbgpkIrJ4p9jcdPqe8DprLxFUUO0yNOq8C+xI= diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/CHANGELOG.md deleted file mode 100644 index 52911e4cc5e4..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Change History - diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/CHANGELOG.md new file mode 100644 index 000000000000..93fd201bfc3e --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/CHANGELOG.md @@ -0,0 +1,9 @@ +# Change History + +## Additive Changes + +### Struct Changes + +#### New Struct Fields + +1. ApplicationGatewayRoutingRulePropertiesFormat.Priority diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/_meta.json b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/_meta.json similarity index 80% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/_meta.json rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/_meta.json index 3da7957dccb8..9b636be005b5 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/_meta.json +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/_meta.json @@ -1,10 +1,10 @@ { - "commit": "47545c5f0842f5be29529674a4609d75a973d783", + "commit": "a8a52b9e6c305f03c3a4c5411d59fc4454b5b372", "readme": "/_/azure-rest-api-specs/specification/network/resource-manager/readme.md", - "tag": "package-2021-02", + "tag": "package-2021-08", "use": "@microsoft.azure/autorest.go@2.1.187", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-02 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/network/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-08 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/network/resource-manager/readme.md", "additional_properties": { "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/applicationgatewayprivateendpointconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgatewayprivateendpointconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/applicationgatewayprivateendpointconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgatewayprivateendpointconnections.go index f310ef63b189..2e1a4a6839b9 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/applicationgatewayprivateendpointconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgatewayprivateendpointconnections.go @@ -72,7 +72,7 @@ func (client ApplicationGatewayPrivateEndpointConnectionsClient) DeletePreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client ApplicationGatewayPrivateEndpointConnectionsClient) GetPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -240,7 +240,7 @@ func (client ApplicationGatewayPrivateEndpointConnectionsClient) ListPreparer(ct "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -349,7 +349,7 @@ func (client ApplicationGatewayPrivateEndpointConnectionsClient) UpdatePreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/applicationgatewayprivatelinkresources.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgatewayprivatelinkresources.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/applicationgatewayprivatelinkresources.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgatewayprivatelinkresources.go index 1c93ae267bac..b3c4a19361d6 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/applicationgatewayprivatelinkresources.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgatewayprivatelinkresources.go @@ -82,7 +82,7 @@ func (client ApplicationGatewayPrivateLinkResourcesClient) ListPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/applicationgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgateways.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/applicationgateways.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgateways.go index 1c6c64591138..08eed6176d25 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/applicationgateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgateways.go @@ -71,7 +71,7 @@ func (client ApplicationGatewaysClient) BackendHealthPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -156,7 +156,7 @@ func (client ApplicationGatewaysClient) BackendHealthOnDemandPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -269,7 +269,7 @@ func (client ApplicationGatewaysClient) CreateOrUpdatePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -351,7 +351,7 @@ func (client ApplicationGatewaysClient) DeletePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -436,7 +436,7 @@ func (client ApplicationGatewaysClient) GetPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -510,7 +510,7 @@ func (client ApplicationGatewaysClient) GetSslPredefinedPolicyPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -589,7 +589,7 @@ func (client ApplicationGatewaysClient) ListPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -702,7 +702,7 @@ func (client ApplicationGatewaysClient) ListAllPreparer(ctx context.Context) (*h "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -810,7 +810,7 @@ func (client ApplicationGatewaysClient) ListAvailableRequestHeadersPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -881,7 +881,7 @@ func (client ApplicationGatewaysClient) ListAvailableResponseHeadersPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -952,7 +952,7 @@ func (client ApplicationGatewaysClient) ListAvailableServerVariablesPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1023,7 +1023,7 @@ func (client ApplicationGatewaysClient) ListAvailableSslOptionsPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1099,7 +1099,7 @@ func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesPrepar "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1207,7 +1207,7 @@ func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1276,7 +1276,7 @@ func (client ApplicationGatewaysClient) StartPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1354,7 +1354,7 @@ func (client ApplicationGatewaysClient) StopPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1440,7 +1440,7 @@ func (client ApplicationGatewaysClient) UpdateTagsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/applicationsecuritygroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationsecuritygroups.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/applicationsecuritygroups.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationsecuritygroups.go index 2903fcc11b41..062cd381e95b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/applicationsecuritygroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationsecuritygroups.go @@ -70,7 +70,7 @@ func (client ApplicationSecurityGroupsClient) CreateOrUpdatePreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client ApplicationSecurityGroupsClient) DeletePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client ApplicationSecurityGroupsClient) GetPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -316,7 +316,7 @@ func (client ApplicationSecurityGroupsClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -429,7 +429,7 @@ func (client ApplicationSecurityGroupsClient) ListAllPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -543,7 +543,7 @@ func (client ApplicationSecurityGroupsClient) UpdateTagsPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/availabledelegations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availabledelegations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/availabledelegations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availabledelegations.go index 196cfae29ec4..14c6080dde1d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/availabledelegations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availabledelegations.go @@ -79,7 +79,7 @@ func (client AvailableDelegationsClient) ListPreparer(ctx context.Context, locat "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/availableendpointservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableendpointservices.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/availableendpointservices.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableendpointservices.go index 16ba8de700c2..6da78683f7f8 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/availableendpointservices.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableendpointservices.go @@ -79,7 +79,7 @@ func (client AvailableEndpointServicesClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/availableprivateendpointtypes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableprivateendpointtypes.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/availableprivateendpointtypes.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableprivateendpointtypes.go index 085a4cd396e0..2a76e1d7f1f0 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/availableprivateendpointtypes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableprivateendpointtypes.go @@ -79,7 +79,7 @@ func (client AvailablePrivateEndpointTypesClient) ListPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -198,7 +198,7 @@ func (client AvailablePrivateEndpointTypesClient) ListByResourceGroupPreparer(ct "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/availableresourcegroupdelegations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableresourcegroupdelegations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/availableresourcegroupdelegations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableresourcegroupdelegations.go index e858e71e8828..240254d7c7cc 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/availableresourcegroupdelegations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableresourcegroupdelegations.go @@ -82,7 +82,7 @@ func (client AvailableResourceGroupDelegationsClient) ListPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/availableservicealiases.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableservicealiases.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/availableservicealiases.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableservicealiases.go index 840c262dc755..439235398ba2 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/availableservicealiases.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableservicealiases.go @@ -79,7 +79,7 @@ func (client AvailableServiceAliasesClient) ListPreparer(ctx context.Context, lo "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -197,7 +197,7 @@ func (client AvailableServiceAliasesClient) ListByResourceGroupPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/azurefirewallfqdntags.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/azurefirewallfqdntags.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/azurefirewallfqdntags.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/azurefirewallfqdntags.go index ffc743a76225..d6bc156d54d6 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/azurefirewallfqdntags.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/azurefirewallfqdntags.go @@ -76,7 +76,7 @@ func (client AzureFirewallFqdnTagsClient) ListAllPreparer(ctx context.Context) ( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/azurefirewalls.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/azurefirewalls.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/azurefirewalls.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/azurefirewalls.go index 2290c42b9ba7..df0196dca0e0 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/azurefirewalls.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/azurefirewalls.go @@ -77,7 +77,7 @@ func (client AzureFirewallsClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client AzureFirewallsClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +244,7 @@ func (client AzureFirewallsClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -323,7 +323,7 @@ func (client AzureFirewallsClient) ListPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -436,7 +436,7 @@ func (client AzureFirewallsClient) ListAllPreparer(ctx context.Context) (*http.R "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -543,7 +543,7 @@ func (client AzureFirewallsClient) UpdateTagsPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/bastionhosts.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/bastionhosts.go similarity index 81% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/bastionhosts.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/bastionhosts.go index 265a077de9f3..79580ade1c35 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/bastionhosts.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/bastionhosts.go @@ -10,6 +10,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -46,6 +47,17 @@ func (client BastionHostsClient) CreateOrUpdate(ctx context.Context, resourceGro tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.BastionHostPropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.BastionHostPropertiesFormat.ScaleUnits", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.BastionHostPropertiesFormat.ScaleUnits", Name: validation.InclusiveMaximum, Rule: int64(50), Chain: nil}, + {Target: "parameters.BastionHostPropertiesFormat.ScaleUnits", Name: validation.InclusiveMinimum, Rule: int64(2), Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("network.BastionHostsClient", "CreateOrUpdate", err.Error()) + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, bastionHostName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -69,7 +81,7 @@ func (client BastionHostsClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +163,7 @@ func (client BastionHostsClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -236,7 +248,7 @@ func (client BastionHostsClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -312,7 +324,7 @@ func (client BastionHostsClient) ListPreparer(ctx context.Context) (*http.Reques "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -428,7 +440,7 @@ func (client BastionHostsClient) ListByResourceGroupPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -495,3 +507,85 @@ func (client BastionHostsClient) ListByResourceGroupComplete(ctx context.Context result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) return } + +// UpdateTags updates Tags for BastionHost resource +// Parameters: +// resourceGroupName - the name of the resource group. +// bastionHostName - the name of the Bastion Host. +// parameters - parameters supplied to update BastionHost tags. +func (client BastionHostsClient) UpdateTags(ctx context.Context, resourceGroupName string, bastionHostName string, parameters TagsObject) (result BastionHostsUpdateTagsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.UpdateTags") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, bastionHostName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "UpdateTags", nil, "Failure preparing request") + return + } + + result, err = client.UpdateTagsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "UpdateTags", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateTagsPreparer prepares the UpdateTags request. +func (client BastionHostsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, bastionHostName string, parameters TagsObject) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "bastionHostName": autorest.Encode("path", bastionHostName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTagsSender sends the UpdateTags request. The method will close the +// http.Response Body if it receives an error. +func (client BastionHostsClient) UpdateTagsSender(req *http.Request) (future BastionHostsUpdateTagsFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateTagsResponder handles the response to the UpdateTags request. The method always +// closes the http.Response Body. +func (client BastionHostsClient) UpdateTagsResponder(resp *http.Response) (result BastionHost, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/bgpservicecommunities.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/bgpservicecommunities.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/bgpservicecommunities.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/bgpservicecommunities.go index dc3e12bca15d..b4898bf21d2d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/bgpservicecommunities.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/bgpservicecommunities.go @@ -76,7 +76,7 @@ func (client BgpServiceCommunitiesClient) ListPreparer(ctx context.Context) (*ht "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/client.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/client.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/client.go index 6271bf8734ca..47c958e96bb1 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/client.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/client.go @@ -1,4 +1,4 @@ -// Package network implements the Azure ARM Network service API version . +// Package network implements the Azure ARM Network service API version 2021-08-01. // // Network Client package network @@ -89,7 +89,7 @@ func (client BaseClient) CheckDNSNameAvailabilityPreparer(ctx context.Context, l "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "domainNameLabel": autorest.Encode("query", domainNameLabel), @@ -160,7 +160,7 @@ func (client BaseClient) DeleteBastionShareableLinkPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -253,7 +253,7 @@ func (client BaseClient) DisconnectActiveSessionsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -363,7 +363,7 @@ func (client BaseClient) GeneratevirtualwanvpnserverconfigurationvpnprofilePrepa "virtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -444,7 +444,7 @@ func (client BaseClient) GetActiveSessionsPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -577,7 +577,7 @@ func (client BaseClient) GetBastionShareableLinkPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -686,7 +686,7 @@ func (client BaseClient) PutBastionShareableLinkPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -815,7 +815,7 @@ func (client BaseClient) SupportedSecurityProvidersPreparer(ctx context.Context, "virtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/configurationpolicygroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/configurationpolicygroups.go new file mode 100644 index 000000000000..ee4daf6dba50 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/configurationpolicygroups.go @@ -0,0 +1,396 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ConfigurationPolicyGroupsClient is the network Client +type ConfigurationPolicyGroupsClient struct { + BaseClient +} + +// NewConfigurationPolicyGroupsClient creates an instance of the ConfigurationPolicyGroupsClient client. +func NewConfigurationPolicyGroupsClient(subscriptionID string) ConfigurationPolicyGroupsClient { + return NewConfigurationPolicyGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConfigurationPolicyGroupsClientWithBaseURI creates an instance of the ConfigurationPolicyGroupsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewConfigurationPolicyGroupsClientWithBaseURI(baseURI string, subscriptionID string) ConfigurationPolicyGroupsClient { + return ConfigurationPolicyGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. +// Parameters: +// resourceGroupName - the resource group name of the ConfigurationPolicyGroup. +// vpnServerConfigurationName - the name of the VpnServerConfiguration. +// configurationPolicyGroupName - the name of the ConfigurationPolicyGroup. +// vpnServerConfigurationPolicyGroupParameters - parameters supplied to create or update a +// VpnServerConfiguration PolicyGroup. +func (client ConfigurationPolicyGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, vpnServerConfigurationPolicyGroupParameters VpnServerConfigurationPolicyGroup) (result ConfigurationPolicyGroupsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationPolicyGroupsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ConfigurationPolicyGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, vpnServerConfigurationPolicyGroupParameters VpnServerConfigurationPolicyGroup) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationPolicyGroupName": autorest.Encode("path", configurationPolicyGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + vpnServerConfigurationPolicyGroupParameters.Etag = nil + vpnServerConfigurationPolicyGroupParameters.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}", pathParameters), + autorest.WithJSON(vpnServerConfigurationPolicyGroupParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationPolicyGroupsClient) CreateOrUpdateSender(req *http.Request) (future ConfigurationPolicyGroupsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ConfigurationPolicyGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result VpnServerConfigurationPolicyGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a ConfigurationPolicyGroup. +// Parameters: +// resourceGroupName - the resource group name of the ConfigurationPolicyGroup. +// vpnServerConfigurationName - the name of the VpnServerConfiguration. +// configurationPolicyGroupName - the name of the ConfigurationPolicyGroup. +func (client ConfigurationPolicyGroupsClient) Delete(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string) (result ConfigurationPolicyGroupsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationPolicyGroupsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ConfigurationPolicyGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationPolicyGroupName": autorest.Encode("path", configurationPolicyGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationPolicyGroupsClient) DeleteSender(req *http.Request) (future ConfigurationPolicyGroupsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ConfigurationPolicyGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves the details of a ConfigurationPolicyGroup. +// Parameters: +// resourceGroupName - the resource group name of the VpnServerConfiguration. +// vpnServerConfigurationName - the name of the VpnServerConfiguration. +// configurationPolicyGroupName - the name of the ConfigurationPolicyGroup being retrieved. +func (client ConfigurationPolicyGroupsClient) Get(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string) (result VpnServerConfigurationPolicyGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationPolicyGroupsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ConfigurationPolicyGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationPolicyGroupName": autorest.Encode("path", configurationPolicyGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationPolicyGroupsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ConfigurationPolicyGroupsClient) GetResponder(resp *http.Response) (result VpnServerConfigurationPolicyGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByVpnServerConfiguration lists all the configurationPolicyGroups in a resource group for a +// vpnServerConfiguration. +// Parameters: +// resourceGroupName - the resource group name of the VpnServerConfiguration. +// vpnServerConfigurationName - the name of the VpnServerConfiguration. +func (client ConfigurationPolicyGroupsClient) ListByVpnServerConfiguration(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string) (result ListVpnServerConfigurationPolicyGroupsResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationPolicyGroupsClient.ListByVpnServerConfiguration") + defer func() { + sc := -1 + if result.lvscpgr.Response.Response != nil { + sc = result.lvscpgr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByVpnServerConfigurationNextResults + req, err := client.ListByVpnServerConfigurationPreparer(ctx, resourceGroupName, vpnServerConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "ListByVpnServerConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.ListByVpnServerConfigurationSender(req) + if err != nil { + result.lvscpgr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "ListByVpnServerConfiguration", resp, "Failure sending request") + return + } + + result.lvscpgr, err = client.ListByVpnServerConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "ListByVpnServerConfiguration", resp, "Failure responding to request") + return + } + if result.lvscpgr.hasNextLink() && result.lvscpgr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByVpnServerConfigurationPreparer prepares the ListByVpnServerConfiguration request. +func (client ConfigurationPolicyGroupsClient) ListByVpnServerConfigurationPreparer(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByVpnServerConfigurationSender sends the ListByVpnServerConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationPolicyGroupsClient) ListByVpnServerConfigurationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByVpnServerConfigurationResponder handles the response to the ListByVpnServerConfiguration request. The method always +// closes the http.Response Body. +func (client ConfigurationPolicyGroupsClient) ListByVpnServerConfigurationResponder(resp *http.Response) (result ListVpnServerConfigurationPolicyGroupsResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByVpnServerConfigurationNextResults retrieves the next set of results, if any. +func (client ConfigurationPolicyGroupsClient) listByVpnServerConfigurationNextResults(ctx context.Context, lastResults ListVpnServerConfigurationPolicyGroupsResult) (result ListVpnServerConfigurationPolicyGroupsResult, err error) { + req, err := lastResults.listVpnServerConfigurationPolicyGroupsResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "listByVpnServerConfigurationNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByVpnServerConfigurationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "listByVpnServerConfigurationNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByVpnServerConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "listByVpnServerConfigurationNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByVpnServerConfigurationComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConfigurationPolicyGroupsClient) ListByVpnServerConfigurationComplete(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string) (result ListVpnServerConfigurationPolicyGroupsResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationPolicyGroupsClient.ListByVpnServerConfiguration") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByVpnServerConfiguration(ctx, resourceGroupName, vpnServerConfigurationName) + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/connectionmonitors.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/connectionmonitors.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/connectionmonitors.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/connectionmonitors.go index 4e3c76fee850..9c7ea471a494 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/connectionmonitors.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/connectionmonitors.go @@ -98,7 +98,7 @@ func (client ConnectionMonitorsClient) CreateOrUpdatePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -184,7 +184,7 @@ func (client ConnectionMonitorsClient) DeletePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -271,7 +271,7 @@ func (client ConnectionMonitorsClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -347,7 +347,7 @@ func (client ConnectionMonitorsClient) ListPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -418,7 +418,7 @@ func (client ConnectionMonitorsClient) QueryPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -499,7 +499,7 @@ func (client ConnectionMonitorsClient) StartPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -579,7 +579,7 @@ func (client ConnectionMonitorsClient) StopPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -667,7 +667,7 @@ func (client ConnectionMonitorsClient) UpdateTagsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/customipprefixes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/customipprefixes.go similarity index 96% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/customipprefixes.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/customipprefixes.go index 67c72eb66c74..4cccfbc1611b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/customipprefixes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/customipprefixes.go @@ -10,7 +10,6 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -48,13 +47,6 @@ func (client CustomIPPrefixesClient) CreateOrUpdate(ctx context.Context, resourc tracing.EndSpan(ctx, sc, err) }() } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.CustomIPPrefixPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.CustomIPPrefixPropertiesFormat.CustomIPPrefixParent", Name: validation.Null, Rule: false, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("network.CustomIPPrefixesClient", "CreateOrUpdate", err.Error()) - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, customIPPrefixName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -78,7 +70,7 @@ func (client CustomIPPrefixesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -160,7 +152,7 @@ func (client CustomIPPrefixesClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -246,7 +238,7 @@ func (client CustomIPPrefixesClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -328,7 +320,7 @@ func (client CustomIPPrefixesClient) ListPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -441,7 +433,7 @@ func (client CustomIPPrefixesClient) ListAllPreparer(ctx context.Context) (*http "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -555,7 +547,7 @@ func (client CustomIPPrefixesClient) UpdateTagsPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/ddoscustompolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ddoscustompolicies.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/ddoscustompolicies.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ddoscustompolicies.go index cb52e222ea71..57341307e42d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/ddoscustompolicies.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ddoscustompolicies.go @@ -70,7 +70,7 @@ func (client DdosCustomPoliciesClient) CreateOrUpdatePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client DdosCustomPoliciesClient) DeletePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client DdosCustomPoliciesClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -314,7 +314,7 @@ func (client DdosCustomPoliciesClient) UpdateTagsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/ddosprotectionplans.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ddosprotectionplans.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/ddosprotectionplans.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ddosprotectionplans.go index 7ca89dd3143b..84dd6888cf26 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/ddosprotectionplans.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ddosprotectionplans.go @@ -70,7 +70,7 @@ func (client DdosProtectionPlansClient) CreateOrUpdatePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -155,7 +155,7 @@ func (client DdosProtectionPlansClient) DeletePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -240,7 +240,7 @@ func (client DdosProtectionPlansClient) GetPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -316,7 +316,7 @@ func (client DdosProtectionPlansClient) ListPreparer(ctx context.Context) (*http "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client DdosProtectionPlansClient) ListByResourceGroupPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -546,7 +546,7 @@ func (client DdosProtectionPlansClient) UpdateTagsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/defaultsecurityrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/defaultsecurityrules.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/defaultsecurityrules.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/defaultsecurityrules.go index 8c1f47232a83..43a559531ba5 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/defaultsecurityrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/defaultsecurityrules.go @@ -78,7 +78,7 @@ func (client DefaultSecurityRulesClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client DefaultSecurityRulesClient) ListPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/dscpconfiguration.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/dscpconfiguration.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/dscpconfiguration.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/dscpconfiguration.go index 1865da477bab..1721a2d088f0 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/dscpconfiguration.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/dscpconfiguration.go @@ -70,7 +70,7 @@ func (client DscpConfigurationClient) CreateOrUpdatePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client DscpConfigurationClient) DeletePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client DscpConfigurationClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -316,7 +316,7 @@ func (client DscpConfigurationClient) ListPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -429,7 +429,7 @@ func (client DscpConfigurationClient) ListAllPreparer(ctx context.Context) (*htt "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/enums.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/enums.go similarity index 93% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/enums.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/enums.go index f5a2e0384a61..5c9c1b81969e 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/enums.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/enums.go @@ -89,6 +89,24 @@ func PossibleApplicationGatewayFirewallModeValues() []ApplicationGatewayFirewall return []ApplicationGatewayFirewallMode{ApplicationGatewayFirewallModeDetection, ApplicationGatewayFirewallModePrevention} } +// ApplicationGatewayLoadDistributionAlgorithm enumerates the values for application gateway load distribution +// algorithm. +type ApplicationGatewayLoadDistributionAlgorithm string + +const ( + // ApplicationGatewayLoadDistributionAlgorithmIPHash ... + ApplicationGatewayLoadDistributionAlgorithmIPHash ApplicationGatewayLoadDistributionAlgorithm = "IpHash" + // ApplicationGatewayLoadDistributionAlgorithmLeastConnections ... + ApplicationGatewayLoadDistributionAlgorithmLeastConnections ApplicationGatewayLoadDistributionAlgorithm = "LeastConnections" + // ApplicationGatewayLoadDistributionAlgorithmRoundRobin ... + ApplicationGatewayLoadDistributionAlgorithmRoundRobin ApplicationGatewayLoadDistributionAlgorithm = "RoundRobin" +) + +// PossibleApplicationGatewayLoadDistributionAlgorithmValues returns an array of possible values for the ApplicationGatewayLoadDistributionAlgorithm const type. +func PossibleApplicationGatewayLoadDistributionAlgorithmValues() []ApplicationGatewayLoadDistributionAlgorithm { + return []ApplicationGatewayLoadDistributionAlgorithm{ApplicationGatewayLoadDistributionAlgorithmIPHash, ApplicationGatewayLoadDistributionAlgorithmLeastConnections, ApplicationGatewayLoadDistributionAlgorithmRoundRobin} +} + // ApplicationGatewayOperationalState enumerates the values for application gateway operational state. type ApplicationGatewayOperationalState string @@ -116,11 +134,15 @@ const ( ApplicationGatewayProtocolHTTP ApplicationGatewayProtocol = "Http" // ApplicationGatewayProtocolHTTPS ... ApplicationGatewayProtocolHTTPS ApplicationGatewayProtocol = "Https" + // ApplicationGatewayProtocolTCP ... + ApplicationGatewayProtocolTCP ApplicationGatewayProtocol = "Tcp" + // ApplicationGatewayProtocolTLS ... + ApplicationGatewayProtocolTLS ApplicationGatewayProtocol = "Tls" ) // PossibleApplicationGatewayProtocolValues returns an array of possible values for the ApplicationGatewayProtocol const type. func PossibleApplicationGatewayProtocolValues() []ApplicationGatewayProtocol { - return []ApplicationGatewayProtocol{ApplicationGatewayProtocolHTTP, ApplicationGatewayProtocolHTTPS} + return []ApplicationGatewayProtocol{ApplicationGatewayProtocolHTTP, ApplicationGatewayProtocolHTTPS, ApplicationGatewayProtocolTCP, ApplicationGatewayProtocolTLS} } // ApplicationGatewayRedirectType enumerates the values for application gateway redirect type. @@ -449,6 +471,8 @@ func PossibleAzureFirewallSkuNameValues() []AzureFirewallSkuName { type AzureFirewallSkuTier string const ( + // AzureFirewallSkuTierBasic ... + AzureFirewallSkuTierBasic AzureFirewallSkuTier = "Basic" // AzureFirewallSkuTierPremium ... AzureFirewallSkuTierPremium AzureFirewallSkuTier = "Premium" // AzureFirewallSkuTierStandard ... @@ -457,7 +481,7 @@ const ( // PossibleAzureFirewallSkuTierValues returns an array of possible values for the AzureFirewallSkuTier const type. func PossibleAzureFirewallSkuTierValues() []AzureFirewallSkuTier { - return []AzureFirewallSkuTier{AzureFirewallSkuTierPremium, AzureFirewallSkuTierStandard} + return []AzureFirewallSkuTier{AzureFirewallSkuTierBasic, AzureFirewallSkuTierPremium, AzureFirewallSkuTierStandard} } // AzureFirewallThreatIntelMode enumerates the values for azure firewall threat intel mode. @@ -1084,6 +1108,22 @@ func PossibleExpressRoutePeeringTypeValues() []ExpressRoutePeeringType { return []ExpressRoutePeeringType{ExpressRoutePeeringTypeAzurePrivatePeering, ExpressRoutePeeringTypeAzurePublicPeering, ExpressRoutePeeringTypeMicrosoftPeering} } +// ExpressRoutePortAuthorizationUseStatus enumerates the values for express route port authorization use +// status. +type ExpressRoutePortAuthorizationUseStatus string + +const ( + // ExpressRoutePortAuthorizationUseStatusAvailable ... + ExpressRoutePortAuthorizationUseStatusAvailable ExpressRoutePortAuthorizationUseStatus = "Available" + // ExpressRoutePortAuthorizationUseStatusInUse ... + ExpressRoutePortAuthorizationUseStatusInUse ExpressRoutePortAuthorizationUseStatus = "InUse" +) + +// PossibleExpressRoutePortAuthorizationUseStatusValues returns an array of possible values for the ExpressRoutePortAuthorizationUseStatus const type. +func PossibleExpressRoutePortAuthorizationUseStatusValues() []ExpressRoutePortAuthorizationUseStatus { + return []ExpressRoutePortAuthorizationUseStatus{ExpressRoutePortAuthorizationUseStatusAvailable, ExpressRoutePortAuthorizationUseStatusInUse} +} + // ExpressRoutePortsEncapsulation enumerates the values for express route ports encapsulation. type ExpressRoutePortsEncapsulation string @@ -1128,6 +1168,21 @@ func PossibleFirewallPolicyFilterRuleCollectionActionTypeValues() []FirewallPoli return []FirewallPolicyFilterRuleCollectionActionType{FirewallPolicyFilterRuleCollectionActionTypeAllow, FirewallPolicyFilterRuleCollectionActionTypeDeny} } +// FirewallPolicyIDPSQuerySortOrder enumerates the values for firewall policy idps query sort order. +type FirewallPolicyIDPSQuerySortOrder string + +const ( + // FirewallPolicyIDPSQuerySortOrderAscending ... + FirewallPolicyIDPSQuerySortOrderAscending FirewallPolicyIDPSQuerySortOrder = "Ascending" + // FirewallPolicyIDPSQuerySortOrderDescending ... + FirewallPolicyIDPSQuerySortOrderDescending FirewallPolicyIDPSQuerySortOrder = "Descending" +) + +// PossibleFirewallPolicyIDPSQuerySortOrderValues returns an array of possible values for the FirewallPolicyIDPSQuerySortOrder const type. +func PossibleFirewallPolicyIDPSQuerySortOrderValues() []FirewallPolicyIDPSQuerySortOrder { + return []FirewallPolicyIDPSQuerySortOrder{FirewallPolicyIDPSQuerySortOrderAscending, FirewallPolicyIDPSQuerySortOrderDescending} +} + // FirewallPolicyIntrusionDetectionProtocol enumerates the values for firewall policy intrusion detection // protocol. type FirewallPolicyIntrusionDetectionProtocol string @@ -1219,6 +1274,8 @@ func PossibleFirewallPolicyRuleNetworkProtocolValues() []FirewallPolicyRuleNetwo type FirewallPolicySkuTier string const ( + // FirewallPolicySkuTierBasic ... + FirewallPolicySkuTierBasic FirewallPolicySkuTier = "Basic" // FirewallPolicySkuTierPremium ... FirewallPolicySkuTierPremium FirewallPolicySkuTier = "Premium" // FirewallPolicySkuTierStandard ... @@ -1227,7 +1284,7 @@ const ( // PossibleFirewallPolicySkuTierValues returns an array of possible values for the FirewallPolicySkuTier const type. func PossibleFirewallPolicySkuTierValues() []FirewallPolicySkuTier { - return []FirewallPolicySkuTier{FirewallPolicySkuTierPremium, FirewallPolicySkuTierStandard} + return []FirewallPolicySkuTier{FirewallPolicySkuTierBasic, FirewallPolicySkuTierPremium, FirewallPolicySkuTierStandard} } // FlowLogFormatType enumerates the values for flow log format type. @@ -1325,6 +1382,23 @@ func PossibleHubBgpConnectionStatusValues() []HubBgpConnectionStatus { return []HubBgpConnectionStatus{HubBgpConnectionStatusConnected, HubBgpConnectionStatusConnecting, HubBgpConnectionStatusNotConnected, HubBgpConnectionStatusUnknown} } +// HubRoutingPreference enumerates the values for hub routing preference. +type HubRoutingPreference string + +const ( + // HubRoutingPreferenceASPath ... + HubRoutingPreferenceASPath HubRoutingPreference = "ASPath" + // HubRoutingPreferenceExpressRoute ... + HubRoutingPreferenceExpressRoute HubRoutingPreference = "ExpressRoute" + // HubRoutingPreferenceVpnGateway ... + HubRoutingPreferenceVpnGateway HubRoutingPreference = "VpnGateway" +) + +// PossibleHubRoutingPreferenceValues returns an array of possible values for the HubRoutingPreference const type. +func PossibleHubRoutingPreferenceValues() []HubRoutingPreference { + return []HubRoutingPreference{HubRoutingPreferenceASPath, HubRoutingPreferenceExpressRoute, HubRoutingPreferenceVpnGateway} +} + // HubVirtualNetworkConnectionStatus enumerates the values for hub virtual network connection status. type HubVirtualNetworkConnectionStatus string @@ -1407,6 +1481,23 @@ func PossibleInboundSecurityRulesProtocolValues() []InboundSecurityRulesProtocol return []InboundSecurityRulesProtocol{InboundSecurityRulesProtocolTCP, InboundSecurityRulesProtocolUDP} } +// InterfaceAuxiliaryMode enumerates the values for interface auxiliary mode. +type InterfaceAuxiliaryMode string + +const ( + // InterfaceAuxiliaryModeFloating ... + InterfaceAuxiliaryModeFloating InterfaceAuxiliaryMode = "Floating" + // InterfaceAuxiliaryModeMaxConnections ... + InterfaceAuxiliaryModeMaxConnections InterfaceAuxiliaryMode = "MaxConnections" + // InterfaceAuxiliaryModeNone ... + InterfaceAuxiliaryModeNone InterfaceAuxiliaryMode = "None" +) + +// PossibleInterfaceAuxiliaryModeValues returns an array of possible values for the InterfaceAuxiliaryMode const type. +func PossibleInterfaceAuxiliaryModeValues() []InterfaceAuxiliaryMode { + return []InterfaceAuxiliaryMode{InterfaceAuxiliaryModeFloating, InterfaceAuxiliaryModeMaxConnections, InterfaceAuxiliaryModeNone} +} + // InterfaceMigrationPhase enumerates the values for interface migration phase. type InterfaceMigrationPhase string @@ -1584,6 +1675,25 @@ func PossibleIssueTypeValues() []IssueType { return []IssueType{IssueTypeAgentStopped, IssueTypeDNSResolution, IssueTypeGuestFirewall, IssueTypeNetworkSecurityRule, IssueTypePlatform, IssueTypePortThrottled, IssueTypeSocketBind, IssueTypeUnknown, IssueTypeUserDefinedRoute} } +// LoadBalancerBackendAddressAdminState enumerates the values for load balancer backend address admin state. +type LoadBalancerBackendAddressAdminState string + +const ( + // LoadBalancerBackendAddressAdminStateDown ... + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + // LoadBalancerBackendAddressAdminStateDrain ... + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + // LoadBalancerBackendAddressAdminStateNone ... + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + // LoadBalancerBackendAddressAdminStateUp ... + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +// PossibleLoadBalancerBackendAddressAdminStateValues returns an array of possible values for the LoadBalancerBackendAddressAdminState const type. +func PossibleLoadBalancerBackendAddressAdminStateValues() []LoadBalancerBackendAddressAdminState { + return []LoadBalancerBackendAddressAdminState{LoadBalancerBackendAddressAdminStateDown, LoadBalancerBackendAddressAdminStateDrain, LoadBalancerBackendAddressAdminStateNone, LoadBalancerBackendAddressAdminStateUp} +} + // LoadBalancerOutboundRuleProtocol enumerates the values for load balancer outbound rule protocol. type LoadBalancerOutboundRuleProtocol string @@ -1769,17 +1879,29 @@ func PossibleOutputTypeValues() []OutputType { type OwaspCrsExclusionEntryMatchVariable string const ( + // OwaspCrsExclusionEntryMatchVariableRequestArgKeys ... + OwaspCrsExclusionEntryMatchVariableRequestArgKeys OwaspCrsExclusionEntryMatchVariable = "RequestArgKeys" // OwaspCrsExclusionEntryMatchVariableRequestArgNames ... OwaspCrsExclusionEntryMatchVariableRequestArgNames OwaspCrsExclusionEntryMatchVariable = "RequestArgNames" + // OwaspCrsExclusionEntryMatchVariableRequestArgValues ... + OwaspCrsExclusionEntryMatchVariableRequestArgValues OwaspCrsExclusionEntryMatchVariable = "RequestArgValues" + // OwaspCrsExclusionEntryMatchVariableRequestCookieKeys ... + OwaspCrsExclusionEntryMatchVariableRequestCookieKeys OwaspCrsExclusionEntryMatchVariable = "RequestCookieKeys" // OwaspCrsExclusionEntryMatchVariableRequestCookieNames ... OwaspCrsExclusionEntryMatchVariableRequestCookieNames OwaspCrsExclusionEntryMatchVariable = "RequestCookieNames" + // OwaspCrsExclusionEntryMatchVariableRequestCookieValues ... + OwaspCrsExclusionEntryMatchVariableRequestCookieValues OwaspCrsExclusionEntryMatchVariable = "RequestCookieValues" + // OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys ... + OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys OwaspCrsExclusionEntryMatchVariable = "RequestHeaderKeys" // OwaspCrsExclusionEntryMatchVariableRequestHeaderNames ... OwaspCrsExclusionEntryMatchVariableRequestHeaderNames OwaspCrsExclusionEntryMatchVariable = "RequestHeaderNames" + // OwaspCrsExclusionEntryMatchVariableRequestHeaderValues ... + OwaspCrsExclusionEntryMatchVariableRequestHeaderValues OwaspCrsExclusionEntryMatchVariable = "RequestHeaderValues" ) // PossibleOwaspCrsExclusionEntryMatchVariableValues returns an array of possible values for the OwaspCrsExclusionEntryMatchVariable const type. func PossibleOwaspCrsExclusionEntryMatchVariableValues() []OwaspCrsExclusionEntryMatchVariable { - return []OwaspCrsExclusionEntryMatchVariable{OwaspCrsExclusionEntryMatchVariableRequestArgNames, OwaspCrsExclusionEntryMatchVariableRequestCookieNames, OwaspCrsExclusionEntryMatchVariableRequestHeaderNames} + return []OwaspCrsExclusionEntryMatchVariable{OwaspCrsExclusionEntryMatchVariableRequestArgKeys, OwaspCrsExclusionEntryMatchVariableRequestArgNames, OwaspCrsExclusionEntryMatchVariableRequestArgValues, OwaspCrsExclusionEntryMatchVariableRequestCookieKeys, OwaspCrsExclusionEntryMatchVariableRequestCookieNames, OwaspCrsExclusionEntryMatchVariableRequestCookieValues, OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys, OwaspCrsExclusionEntryMatchVariableRequestHeaderNames, OwaspCrsExclusionEntryMatchVariableRequestHeaderValues} } // OwaspCrsExclusionEntrySelectorMatchOperator enumerates the values for owasp crs exclusion entry selector @@ -2387,6 +2509,21 @@ func PossibleVerbosityLevelValues() []VerbosityLevel { return []VerbosityLevel{VerbosityLevelFull, VerbosityLevelMinimum, VerbosityLevelNormal} } +// VirtualNetworkEncryptionEnforcement enumerates the values for virtual network encryption enforcement. +type VirtualNetworkEncryptionEnforcement string + +const ( + // VirtualNetworkEncryptionEnforcementAllowUnencrypted ... + VirtualNetworkEncryptionEnforcementAllowUnencrypted VirtualNetworkEncryptionEnforcement = "AllowUnencrypted" + // VirtualNetworkEncryptionEnforcementDropUnencrypted ... + VirtualNetworkEncryptionEnforcementDropUnencrypted VirtualNetworkEncryptionEnforcement = "DropUnencrypted" +) + +// PossibleVirtualNetworkEncryptionEnforcementValues returns an array of possible values for the VirtualNetworkEncryptionEnforcement const type. +func PossibleVirtualNetworkEncryptionEnforcementValues() []VirtualNetworkEncryptionEnforcement { + return []VirtualNetworkEncryptionEnforcement{VirtualNetworkEncryptionEnforcementAllowUnencrypted, VirtualNetworkEncryptionEnforcementDropUnencrypted} +} + // VirtualNetworkGatewayConnectionMode enumerates the values for virtual network gateway connection mode. type VirtualNetworkGatewayConnectionMode string @@ -2780,6 +2917,23 @@ func PossibleVpnNatRuleTypeValues() []VpnNatRuleType { return []VpnNatRuleType{VpnNatRuleTypeDynamic, VpnNatRuleTypeStatic} } +// VpnPolicyMemberAttributeType enumerates the values for vpn policy member attribute type. +type VpnPolicyMemberAttributeType string + +const ( + // VpnPolicyMemberAttributeTypeAADGroupID ... + VpnPolicyMemberAttributeTypeAADGroupID VpnPolicyMemberAttributeType = "AADGroupId" + // VpnPolicyMemberAttributeTypeCertificateGroupID ... + VpnPolicyMemberAttributeTypeCertificateGroupID VpnPolicyMemberAttributeType = "CertificateGroupId" + // VpnPolicyMemberAttributeTypeRadiusAzureGroupID ... + VpnPolicyMemberAttributeTypeRadiusAzureGroupID VpnPolicyMemberAttributeType = "RadiusAzureGroupId" +) + +// PossibleVpnPolicyMemberAttributeTypeValues returns an array of possible values for the VpnPolicyMemberAttributeType const type. +func PossibleVpnPolicyMemberAttributeTypeValues() []VpnPolicyMemberAttributeType { + return []VpnPolicyMemberAttributeType{VpnPolicyMemberAttributeTypeAADGroupID, VpnPolicyMemberAttributeTypeCertificateGroupID, VpnPolicyMemberAttributeTypeRadiusAzureGroupID} +} + // VpnType enumerates the values for vpn type. type VpnType string diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecircuitauthorizations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitauthorizations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecircuitauthorizations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitauthorizations.go index dfab0d4a0da2..b266a6cf1a4d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecircuitauthorizations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitauthorizations.go @@ -74,7 +74,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeletePreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -246,7 +246,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) GetPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -327,7 +327,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) ListPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecircuitconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecircuitconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitconnections.go index 61fb94890615..83674223397e 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecircuitconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitconnections.go @@ -75,7 +75,7 @@ func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdatePreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -162,7 +162,7 @@ func (client ExpressRouteCircuitConnectionsClient) DeletePreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -251,7 +251,7 @@ func (client ExpressRouteCircuitConnectionsClient) GetPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -334,7 +334,7 @@ func (client ExpressRouteCircuitConnectionsClient) ListPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecircuitpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitpeerings.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecircuitpeerings.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitpeerings.go index 824f44c84e27..f502d7a7ae49 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecircuitpeerings.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitpeerings.go @@ -84,7 +84,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -169,7 +169,7 @@ func (client ExpressRouteCircuitPeeringsClient) DeletePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -256,7 +256,7 @@ func (client ExpressRouteCircuitPeeringsClient) GetPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -337,7 +337,7 @@ func (client ExpressRouteCircuitPeeringsClient) ListPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecircuits.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuits.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecircuits.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuits.go index 8fe3e78b60d4..6e6d664c9edd 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecircuits.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuits.go @@ -70,7 +70,7 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdatePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client ExpressRouteCircuitsClient) DeletePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client ExpressRouteCircuitsClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -315,7 +315,7 @@ func (client ExpressRouteCircuitsClient) GetPeeringStatsPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -391,7 +391,7 @@ func (client ExpressRouteCircuitsClient) GetStatsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -470,7 +470,7 @@ func (client ExpressRouteCircuitsClient) ListPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -583,7 +583,7 @@ func (client ExpressRouteCircuitsClient) ListAllPreparer(ctx context.Context) (* "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -693,7 +693,7 @@ func (client ExpressRouteCircuitsClient) ListArpTablePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -777,7 +777,7 @@ func (client ExpressRouteCircuitsClient) ListRoutesTablePreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -861,7 +861,7 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableSummaryPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -948,7 +948,7 @@ func (client ExpressRouteCircuitsClient) UpdateTagsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressrouteconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressrouteconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteconnections.go index 79f3ed62bd49..b58cfdf034cb 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressrouteconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteconnections.go @@ -81,7 +81,7 @@ func (client ExpressRouteConnectionsClient) CreateOrUpdatePreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +164,7 @@ func (client ExpressRouteConnectionsClient) DeletePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -251,7 +251,7 @@ func (client ExpressRouteConnectionsClient) GetPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -327,7 +327,7 @@ func (client ExpressRouteConnectionsClient) ListPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecrossconnectionpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecrossconnectionpeerings.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecrossconnectionpeerings.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecrossconnectionpeerings.go index 790120212719..a4fbcebcd450 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecrossconnectionpeerings.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecrossconnectionpeerings.go @@ -86,7 +86,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdatePreparer(c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -170,7 +170,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) DeletePreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -257,7 +257,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) GetPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -338,7 +338,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) ListPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecrossconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecrossconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecrossconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecrossconnections.go index 5903044ce3ca..5f644efbaa72 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutecrossconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecrossconnections.go @@ -70,7 +70,7 @@ func (client ExpressRouteCrossConnectionsClient) CreateOrUpdatePreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client ExpressRouteCrossConnectionsClient) GetPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -235,7 +235,7 @@ func (client ExpressRouteCrossConnectionsClient) ListPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -346,7 +346,7 @@ func (client ExpressRouteCrossConnectionsClient) ListArpTablePreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -435,7 +435,7 @@ func (client ExpressRouteCrossConnectionsClient) ListByResourceGroupPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -546,7 +546,7 @@ func (client ExpressRouteCrossConnectionsClient) ListRoutesTablePreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -630,7 +630,7 @@ func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummaryPreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -717,7 +717,7 @@ func (client ExpressRouteCrossConnectionsClient) UpdateTagsPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutegateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutegateways.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutegateways.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutegateways.go index 1dcd0b6d859c..7073ce13ba27 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutegateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutegateways.go @@ -78,7 +78,7 @@ func (client ExpressRouteGatewaysClient) CreateOrUpdatePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -161,7 +161,7 @@ func (client ExpressRouteGatewaysClient) DeletePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -246,7 +246,7 @@ func (client ExpressRouteGatewaysClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -320,7 +320,7 @@ func (client ExpressRouteGatewaysClient) ListByResourceGroupPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -391,7 +391,7 @@ func (client ExpressRouteGatewaysClient) ListBySubscriptionPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -461,7 +461,7 @@ func (client ExpressRouteGatewaysClient) UpdateTagsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutelinks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutelinks.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutelinks.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutelinks.go index e70df38e2863..3f973edf64bf 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressroutelinks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutelinks.go @@ -78,7 +78,7 @@ func (client ExpressRouteLinksClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client ExpressRouteLinksClient) ListPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteportauthorizations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteportauthorizations.go new file mode 100644 index 000000000000..43ea09b6d404 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteportauthorizations.go @@ -0,0 +1,395 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ExpressRoutePortAuthorizationsClient is the network Client +type ExpressRoutePortAuthorizationsClient struct { + BaseClient +} + +// NewExpressRoutePortAuthorizationsClient creates an instance of the ExpressRoutePortAuthorizationsClient client. +func NewExpressRoutePortAuthorizationsClient(subscriptionID string) ExpressRoutePortAuthorizationsClient { + return NewExpressRoutePortAuthorizationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewExpressRoutePortAuthorizationsClientWithBaseURI creates an instance of the ExpressRoutePortAuthorizationsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewExpressRoutePortAuthorizationsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRoutePortAuthorizationsClient { + return ExpressRoutePortAuthorizationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an authorization in the specified express route port. +// Parameters: +// resourceGroupName - the name of the resource group. +// expressRoutePortName - the name of the express route port. +// authorizationName - the name of the authorization. +// authorizationParameters - parameters supplied to the create or update express route port authorization +// operation. +func (client ExpressRoutePortAuthorizationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, authorizationParameters ExpressRoutePortAuthorization) (result ExpressRoutePortAuthorizationsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortAuthorizationsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ExpressRoutePortAuthorizationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, authorizationParameters ExpressRoutePortAuthorization) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authorizationName": autorest.Encode("path", authorizationName), + "expressRoutePortName": autorest.Encode("path", expressRoutePortName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + authorizationParameters.Etag = nil + authorizationParameters.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}", pathParameters), + autorest.WithJSON(authorizationParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ExpressRoutePortAuthorizationsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRoutePortAuthorizationsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ExpressRoutePortAuthorizationsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRoutePortAuthorization, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified authorization from the specified express route port. +// Parameters: +// resourceGroupName - the name of the resource group. +// expressRoutePortName - the name of the express route port. +// authorizationName - the name of the authorization. +func (client ExpressRoutePortAuthorizationsClient) Delete(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string) (result ExpressRoutePortAuthorizationsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortAuthorizationsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, expressRoutePortName, authorizationName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ExpressRoutePortAuthorizationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authorizationName": autorest.Encode("path", authorizationName), + "expressRoutePortName": autorest.Encode("path", expressRoutePortName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ExpressRoutePortAuthorizationsClient) DeleteSender(req *http.Request) (future ExpressRoutePortAuthorizationsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ExpressRoutePortAuthorizationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified authorization from the specified express route port. +// Parameters: +// resourceGroupName - the name of the resource group. +// expressRoutePortName - the name of the express route port. +// authorizationName - the name of the authorization. +func (client ExpressRoutePortAuthorizationsClient) Get(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string) (result ExpressRoutePortAuthorization, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortAuthorizationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, expressRoutePortName, authorizationName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ExpressRoutePortAuthorizationsClient) GetPreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authorizationName": autorest.Encode("path", authorizationName), + "expressRoutePortName": autorest.Encode("path", expressRoutePortName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ExpressRoutePortAuthorizationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ExpressRoutePortAuthorizationsClient) GetResponder(resp *http.Response) (result ExpressRoutePortAuthorization, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets all authorizations in an express route port. +// Parameters: +// resourceGroupName - the name of the resource group. +// expressRoutePortName - the name of the express route port. +func (client ExpressRoutePortAuthorizationsClient) List(ctx context.Context, resourceGroupName string, expressRoutePortName string) (result ExpressRoutePortAuthorizationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortAuthorizationsClient.List") + defer func() { + sc := -1 + if result.erpalr.Response.Response != nil { + sc = result.erpalr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, expressRoutePortName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.erpalr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "List", resp, "Failure sending request") + return + } + + result.erpalr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "List", resp, "Failure responding to request") + return + } + if result.erpalr.hasNextLink() && result.erpalr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ExpressRoutePortAuthorizationsClient) ListPreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "expressRoutePortName": autorest.Encode("path", expressRoutePortName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ExpressRoutePortAuthorizationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ExpressRoutePortAuthorizationsClient) ListResponder(resp *http.Response) (result ExpressRoutePortAuthorizationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ExpressRoutePortAuthorizationsClient) listNextResults(ctx context.Context, lastResults ExpressRoutePortAuthorizationListResult) (result ExpressRoutePortAuthorizationListResult, err error) { + req, err := lastResults.expressRoutePortAuthorizationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ExpressRoutePortAuthorizationsClient) ListComplete(ctx context.Context, resourceGroupName string, expressRoutePortName string) (result ExpressRoutePortAuthorizationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortAuthorizationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, expressRoutePortName) + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressrouteports.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteports.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressrouteports.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteports.go index b7af0d6018c5..bec868899b61 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressrouteports.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteports.go @@ -71,7 +71,7 @@ func (client ExpressRoutePortsClient) CreateOrUpdatePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -153,7 +153,7 @@ func (client ExpressRoutePortsClient) DeletePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -245,7 +245,7 @@ func (client ExpressRoutePortsClient) GenerateLOAPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -323,7 +323,7 @@ func (client ExpressRoutePortsClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -399,7 +399,7 @@ func (client ExpressRoutePortsClient) ListPreparer(ctx context.Context) (*http.R "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -515,7 +515,7 @@ func (client ExpressRoutePortsClient) ListByResourceGroupPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -629,7 +629,7 @@ func (client ExpressRoutePortsClient) UpdateTagsPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressrouteportslocations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteportslocations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressrouteportslocations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteportslocations.go index fee08d8254a4..feca9cf4eddc 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressrouteportslocations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteportslocations.go @@ -75,7 +75,7 @@ func (client ExpressRoutePortsLocationsClient) GetPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client ExpressRoutePortsLocationsClient) ListPreparer(ctx context.Context) "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressrouteserviceproviders.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteserviceproviders.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressrouteserviceproviders.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteserviceproviders.go index a0294a11afea..c237501b4d03 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/expressrouteserviceproviders.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteserviceproviders.go @@ -76,7 +76,7 @@ func (client ExpressRouteServiceProvidersClient) ListPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/firewallpolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicies.go similarity index 77% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/firewallpolicies.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicies.go index c85fa8941b23..dddc0c3b11f5 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/firewallpolicies.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicies.go @@ -10,6 +10,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -47,6 +48,27 @@ func (client FirewallPoliciesClient) CreateOrUpdate(ctx context.Context, resourc tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.HTTPPort", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.HTTPPort", Name: validation.InclusiveMaximum, Rule: int64(64000), Chain: nil}, + {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.HTTPPort", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.HTTPSPort", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.HTTPSPort", Name: validation.InclusiveMaximum, Rule: int64(64000), Chain: nil}, + {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.HTTPSPort", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.PacFilePort", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.PacFilePort", Name: validation.InclusiveMaximum, Rule: int64(64000), Chain: nil}, + {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.PacFilePort", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("network.FirewallPoliciesClient", "CreateOrUpdate", err.Error()) + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, firewallPolicyName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -70,7 +92,7 @@ func (client FirewallPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +174,7 @@ func (client FirewallPoliciesClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -238,7 +260,7 @@ func (client FirewallPoliciesClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -320,7 +342,7 @@ func (client FirewallPoliciesClient) ListPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -433,7 +455,7 @@ func (client FirewallPoliciesClient) ListAllPreparer(ctx context.Context) (*http "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -500,3 +522,82 @@ func (client FirewallPoliciesClient) ListAllComplete(ctx context.Context) (resul result.page, err = client.ListAll(ctx) return } + +// UpdateTags updates tags of a Azure Firewall Policy resource. +// Parameters: +// resourceGroupName - the name of the resource group. +// firewallPolicyName - the name of the Firewall Policy. +// parameters - parameters supplied to update Azure Firewall Policy tags. +func (client FirewallPoliciesClient) UpdateTags(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters TagsObject) (result FirewallPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.UpdateTags") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, firewallPolicyName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "UpdateTags", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateTagsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "UpdateTags", resp, "Failure sending request") + return + } + + result, err = client.UpdateTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "UpdateTags", resp, "Failure responding to request") + return + } + + return +} + +// UpdateTagsPreparer prepares the UpdateTags request. +func (client FirewallPoliciesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters TagsObject) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "firewallPolicyName": autorest.Encode("path", firewallPolicyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTagsSender sends the UpdateTags request. The method will close the +// http.Response Body if it receives an error. +func (client FirewallPoliciesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateTagsResponder handles the response to the UpdateTags request. The method always +// closes the http.Response Body. +func (client FirewallPoliciesClient) UpdateTagsResponder(resp *http.Response) (result FirewallPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignatures.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignatures.go new file mode 100644 index 000000000000..c920b64009a5 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignatures.go @@ -0,0 +1,120 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// FirewallPolicyIdpsSignaturesClient is the network Client +type FirewallPolicyIdpsSignaturesClient struct { + BaseClient +} + +// NewFirewallPolicyIdpsSignaturesClient creates an instance of the FirewallPolicyIdpsSignaturesClient client. +func NewFirewallPolicyIdpsSignaturesClient(subscriptionID string) FirewallPolicyIdpsSignaturesClient { + return NewFirewallPolicyIdpsSignaturesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewFirewallPolicyIdpsSignaturesClientWithBaseURI creates an instance of the FirewallPolicyIdpsSignaturesClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewFirewallPolicyIdpsSignaturesClientWithBaseURI(baseURI string, subscriptionID string) FirewallPolicyIdpsSignaturesClient { + return FirewallPolicyIdpsSignaturesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List retrieves the current status of IDPS signatures for the relevant policy +// Parameters: +// resourceGroupName - the name of the resource group. +// firewallPolicyName - the name of the Firewall Policy. +func (client FirewallPolicyIdpsSignaturesClient) List(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters IDPSQueryObject) (result QueryResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyIdpsSignaturesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ResultsPerPage", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ResultsPerPage", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, + {Target: "parameters.ResultsPerPage", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.FirewallPolicyIdpsSignaturesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, firewallPolicyName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client FirewallPolicyIdpsSignaturesClient) ListPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters IDPSQueryObject) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "firewallPolicyName": autorest.Encode("path", firewallPolicyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsSignatures", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client FirewallPolicyIdpsSignaturesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client FirewallPolicyIdpsSignaturesClient) ListResponder(resp *http.Response) (result QueryResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignaturesfiltervalues.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignaturesfiltervalues.go new file mode 100644 index 000000000000..576612c8ed27 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignaturesfiltervalues.go @@ -0,0 +1,111 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// FirewallPolicyIdpsSignaturesFilterValuesClient is the network Client +type FirewallPolicyIdpsSignaturesFilterValuesClient struct { + BaseClient +} + +// NewFirewallPolicyIdpsSignaturesFilterValuesClient creates an instance of the +// FirewallPolicyIdpsSignaturesFilterValuesClient client. +func NewFirewallPolicyIdpsSignaturesFilterValuesClient(subscriptionID string) FirewallPolicyIdpsSignaturesFilterValuesClient { + return NewFirewallPolicyIdpsSignaturesFilterValuesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewFirewallPolicyIdpsSignaturesFilterValuesClientWithBaseURI creates an instance of the +// FirewallPolicyIdpsSignaturesFilterValuesClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewFirewallPolicyIdpsSignaturesFilterValuesClientWithBaseURI(baseURI string, subscriptionID string) FirewallPolicyIdpsSignaturesFilterValuesClient { + return FirewallPolicyIdpsSignaturesFilterValuesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List retrieves the current filter values for the signatures overrides +// Parameters: +// resourceGroupName - the name of the resource group. +// firewallPolicyName - the name of the Firewall Policy. +func (client FirewallPolicyIdpsSignaturesFilterValuesClient) List(ctx context.Context, parameters SignatureOverridesFilterValuesQuery, resourceGroupName string, firewallPolicyName string) (result SignatureOverridesFilterValuesResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyIdpsSignaturesFilterValuesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, parameters, resourceGroupName, firewallPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesFilterValuesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesFilterValuesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesFilterValuesClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client FirewallPolicyIdpsSignaturesFilterValuesClient) ListPreparer(ctx context.Context, parameters SignatureOverridesFilterValuesQuery, resourceGroupName string, firewallPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "firewallPolicyName": autorest.Encode("path", firewallPolicyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsFilterOptions", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client FirewallPolicyIdpsSignaturesFilterValuesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client FirewallPolicyIdpsSignaturesFilterValuesClient) ListResponder(resp *http.Response) (result SignatureOverridesFilterValuesResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignaturesoverrides.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignaturesoverrides.go new file mode 100644 index 000000000000..6ab55b16199b --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignaturesoverrides.go @@ -0,0 +1,343 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// FirewallPolicyIdpsSignaturesOverridesClient is the network Client +type FirewallPolicyIdpsSignaturesOverridesClient struct { + BaseClient +} + +// NewFirewallPolicyIdpsSignaturesOverridesClient creates an instance of the +// FirewallPolicyIdpsSignaturesOverridesClient client. +func NewFirewallPolicyIdpsSignaturesOverridesClient(subscriptionID string) FirewallPolicyIdpsSignaturesOverridesClient { + return NewFirewallPolicyIdpsSignaturesOverridesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewFirewallPolicyIdpsSignaturesOverridesClientWithBaseURI creates an instance of the +// FirewallPolicyIdpsSignaturesOverridesClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewFirewallPolicyIdpsSignaturesOverridesClientWithBaseURI(baseURI string, subscriptionID string) FirewallPolicyIdpsSignaturesOverridesClient { + return FirewallPolicyIdpsSignaturesOverridesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get returns all signatures overrides for a specific policy. +// Parameters: +// resourceGroupName - the name of the resource group. +// firewallPolicyName - the name of the Firewall Policy. +func (client FirewallPolicyIdpsSignaturesOverridesClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string) (result SignaturesOverrides, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyIdpsSignaturesOverridesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, firewallPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client FirewallPolicyIdpsSignaturesOverridesClient) GetPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "firewallPolicyName": autorest.Encode("path", firewallPolicyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client FirewallPolicyIdpsSignaturesOverridesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client FirewallPolicyIdpsSignaturesOverridesClient) GetResponder(resp *http.Response) (result SignaturesOverrides, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List returns all signatures overrides objects for a specific policy as a list containing a single value. +// Parameters: +// resourceGroupName - the name of the resource group. +// firewallPolicyName - the name of the Firewall Policy. +func (client FirewallPolicyIdpsSignaturesOverridesClient) List(ctx context.Context, resourceGroupName string, firewallPolicyName string) (result SignaturesOverridesList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyIdpsSignaturesOverridesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, resourceGroupName, firewallPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client FirewallPolicyIdpsSignaturesOverridesClient) ListPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "firewallPolicyName": autorest.Encode("path", firewallPolicyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client FirewallPolicyIdpsSignaturesOverridesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client FirewallPolicyIdpsSignaturesOverridesClient) ListResponder(resp *http.Response) (result SignaturesOverridesList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Patch will update the status of policy's signature overrides for IDPS +// Parameters: +// parameters - will contain all properties of the object to put +// resourceGroupName - the name of the resource group. +// firewallPolicyName - the name of the Firewall Policy. +func (client FirewallPolicyIdpsSignaturesOverridesClient) Patch(ctx context.Context, parameters SignaturesOverrides, resourceGroupName string, firewallPolicyName string) (result SignaturesOverrides, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyIdpsSignaturesOverridesClient.Patch") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PatchPreparer(ctx, parameters, resourceGroupName, firewallPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Patch", nil, "Failure preparing request") + return + } + + resp, err := client.PatchSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Patch", resp, "Failure sending request") + return + } + + result, err = client.PatchResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Patch", resp, "Failure responding to request") + return + } + + return +} + +// PatchPreparer prepares the Patch request. +func (client FirewallPolicyIdpsSignaturesOverridesClient) PatchPreparer(ctx context.Context, parameters SignaturesOverrides, resourceGroupName string, firewallPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "firewallPolicyName": autorest.Encode("path", firewallPolicyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PatchSender sends the Patch request. The method will close the +// http.Response Body if it receives an error. +func (client FirewallPolicyIdpsSignaturesOverridesClient) PatchSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// PatchResponder handles the response to the Patch request. The method always +// closes the http.Response Body. +func (client FirewallPolicyIdpsSignaturesOverridesClient) PatchResponder(resp *http.Response) (result SignaturesOverrides, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Put will override/create a new signature overrides for the policy's IDPS +// Parameters: +// parameters - will contain all properties of the object to put +// resourceGroupName - the name of the resource group. +// firewallPolicyName - the name of the Firewall Policy. +func (client FirewallPolicyIdpsSignaturesOverridesClient) Put(ctx context.Context, parameters SignaturesOverrides, resourceGroupName string, firewallPolicyName string) (result SignaturesOverrides, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyIdpsSignaturesOverridesClient.Put") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PutPreparer(ctx, parameters, resourceGroupName, firewallPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Put", nil, "Failure preparing request") + return + } + + resp, err := client.PutSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Put", resp, "Failure sending request") + return + } + + result, err = client.PutResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Put", resp, "Failure responding to request") + return + } + + return +} + +// PutPreparer prepares the Put request. +func (client FirewallPolicyIdpsSignaturesOverridesClient) PutPreparer(ctx context.Context, parameters SignaturesOverrides, resourceGroupName string, firewallPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "firewallPolicyName": autorest.Encode("path", firewallPolicyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PutSender sends the Put request. The method will close the +// http.Response Body if it receives an error. +func (client FirewallPolicyIdpsSignaturesOverridesClient) PutSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// PutResponder handles the response to the Put request. The method always +// closes the http.Response Body. +func (client FirewallPolicyIdpsSignaturesOverridesClient) PutResponder(resp *http.Response) (result SignaturesOverrides, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/firewallpolicyrulecollectiongroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyrulecollectiongroups.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/firewallpolicyrulecollectiongroups.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyrulecollectiongroups.go index b22194bb72c3..5e93d360c63b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/firewallpolicyrulecollectiongroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyrulecollectiongroups.go @@ -85,7 +85,7 @@ func (client FirewallPolicyRuleCollectionGroupsClient) CreateOrUpdatePreparer(ct "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -170,7 +170,7 @@ func (client FirewallPolicyRuleCollectionGroupsClient) DeletePreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -257,7 +257,7 @@ func (client FirewallPolicyRuleCollectionGroupsClient) GetPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -338,7 +338,7 @@ func (client FirewallPolicyRuleCollectionGroupsClient) ListPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/flowlogs.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/flowlogs.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/flowlogs.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/flowlogs.go index 965bab5e2ae7..6437b94c0910 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/flowlogs.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/flowlogs.go @@ -81,7 +81,7 @@ func (client FlowLogsClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,7 +165,7 @@ func (client FlowLogsClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -252,7 +252,7 @@ func (client FlowLogsClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -333,7 +333,7 @@ func (client FlowLogsClient) ListPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -449,7 +449,7 @@ func (client FlowLogsClient) UpdateTagsPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/hubroutetables.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/hubroutetables.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/hubroutetables.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/hubroutetables.go index 6551acf62e7e..579df8d7267c 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/hubroutetables.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/hubroutetables.go @@ -71,7 +71,7 @@ func (client HubRouteTablesClient) CreateOrUpdatePreparer(ctx context.Context, r "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -156,7 +156,7 @@ func (client HubRouteTablesClient) DeletePreparer(ctx context.Context, resourceG "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -243,7 +243,7 @@ func (client HubRouteTablesClient) GetPreparer(ctx context.Context, resourceGrou "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -324,7 +324,7 @@ func (client HubRouteTablesClient) ListPreparer(ctx context.Context, resourceGro "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/hubvirtualnetworkconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/hubvirtualnetworkconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/hubvirtualnetworkconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/hubvirtualnetworkconnections.go index 11fbce0d1b32..2e68e70e460f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/hubvirtualnetworkconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/hubvirtualnetworkconnections.go @@ -73,7 +73,7 @@ func (client HubVirtualNetworkConnectionsClient) CreateOrUpdatePreparer(ctx cont "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -157,7 +157,7 @@ func (client HubVirtualNetworkConnectionsClient) DeletePreparer(ctx context.Cont "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +244,7 @@ func (client HubVirtualNetworkConnectionsClient) GetPreparer(ctx context.Context "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -325,7 +325,7 @@ func (client HubVirtualNetworkConnectionsClient) ListPreparer(ctx context.Contex "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/inboundnatrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/inboundnatrules.go similarity index 96% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/inboundnatrules.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/inboundnatrules.go index 38eba29463e5..f603374e192e 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/inboundnatrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/inboundnatrules.go @@ -31,12 +31,12 @@ func NewInboundNatRulesClientWithBaseURI(baseURI string, subscriptionID string) return InboundNatRulesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a load balancer inbound nat rule. +// CreateOrUpdate creates or updates a load balancer inbound NAT rule. // Parameters: // resourceGroupName - the name of the resource group. // loadBalancerName - the name of the load balancer. -// inboundNatRuleName - the name of the inbound nat rule. -// inboundNatRuleParameters - parameters supplied to the create or update inbound nat rule operation. +// inboundNatRuleName - the name of the inbound NAT rule. +// inboundNatRuleParameters - parameters supplied to the create or update inbound NAT rule operation. func (client InboundNatRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule) (result InboundNatRulesCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRulesClient.CreateOrUpdate") @@ -93,7 +93,7 @@ func (client InboundNatRulesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -138,11 +138,11 @@ func (client InboundNatRulesClient) CreateOrUpdateResponder(resp *http.Response) return } -// Delete deletes the specified load balancer inbound nat rule. +// Delete deletes the specified load balancer inbound NAT rule. // Parameters: // resourceGroupName - the name of the resource group. // loadBalancerName - the name of the load balancer. -// inboundNatRuleName - the name of the inbound nat rule. +// inboundNatRuleName - the name of the inbound NAT rule. func (client InboundNatRulesClient) Delete(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string) (result InboundNatRulesDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRulesClient.Delete") @@ -178,7 +178,7 @@ func (client InboundNatRulesClient) DeletePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -218,11 +218,11 @@ func (client InboundNatRulesClient) DeleteResponder(resp *http.Response) (result return } -// Get gets the specified load balancer inbound nat rule. +// Get gets the specified load balancer inbound NAT rule. // Parameters: // resourceGroupName - the name of the resource group. // loadBalancerName - the name of the load balancer. -// inboundNatRuleName - the name of the inbound nat rule. +// inboundNatRuleName - the name of the inbound NAT rule. // expand - expands referenced resources. func (client InboundNatRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, expand string) (result InboundNatRule, err error) { if tracing.IsEnabled() { @@ -266,7 +266,7 @@ func (client InboundNatRulesClient) GetPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -300,7 +300,7 @@ func (client InboundNatRulesClient) GetResponder(resp *http.Response) (result In return } -// List gets all the inbound nat rules in a load balancer. +// List gets all the inbound NAT rules in a load balancer. // Parameters: // resourceGroupName - the name of the resource group. // loadBalancerName - the name of the load balancer. @@ -350,7 +350,7 @@ func (client InboundNatRulesClient) ListPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/inboundsecurityrule.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/inboundsecurityrule.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/inboundsecurityrule.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/inboundsecurityrule.go index e2296fcb5a3b..d4279e18a391 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/inboundsecurityrule.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/inboundsecurityrule.go @@ -73,7 +73,7 @@ func (client InboundSecurityRuleClient) CreateOrUpdatePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/interfaceipconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfaceipconfigurations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/interfaceipconfigurations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfaceipconfigurations.go index 3df04e3e8e3b..c2675352841f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/interfaceipconfigurations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfaceipconfigurations.go @@ -78,7 +78,7 @@ func (client InterfaceIPConfigurationsClient) GetPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client InterfaceIPConfigurationsClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/interfaceloadbalancers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfaceloadbalancers.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/interfaceloadbalancers.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfaceloadbalancers.go index d62da2a65a82..cc49e62e6ecc 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/interfaceloadbalancers.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfaceloadbalancers.go @@ -81,7 +81,7 @@ func (client InterfaceLoadBalancersClient) ListPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/interfacesgroup.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfacesgroup.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/interfacesgroup.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfacesgroup.go index 58c91cc78fdb..2ace149c5a5f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/interfacesgroup.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfacesgroup.go @@ -69,7 +69,7 @@ func (client InterfacesClient) CreateOrUpdatePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client InterfacesClient) DeletePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client InterfacesClient) GetPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -321,7 +321,7 @@ func (client InterfacesClient) GetCloudServiceNetworkInterfacePreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -393,7 +393,7 @@ func (client InterfacesClient) GetEffectiveRouteTablePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -487,7 +487,7 @@ func (client InterfacesClient) GetVirtualMachineScaleSetIPConfigurationPreparer( "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -571,7 +571,7 @@ func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfacePreparer "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -653,7 +653,7 @@ func (client InterfacesClient) ListPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -766,7 +766,7 @@ func (client InterfacesClient) ListAllPreparer(ctx context.Context) (*http.Reque "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -884,7 +884,7 @@ func (client InterfacesClient) ListCloudServiceNetworkInterfacesPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1005,7 +1005,7 @@ func (client InterfacesClient) ListCloudServiceRoleInstanceNetworkInterfacesPrep "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1111,7 +1111,7 @@ func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsPreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1208,7 +1208,7 @@ func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurationsPrepare "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1329,7 +1329,7 @@ func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesPrepar "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1450,7 +1450,7 @@ func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesPrep "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1564,7 +1564,7 @@ func (client InterfacesClient) UpdateTagsPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/interfacetapconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfacetapconfigurations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/interfacetapconfigurations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfacetapconfigurations.go index 881dc349ae86..bf16177e294e 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/interfacetapconfigurations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfacetapconfigurations.go @@ -112,7 +112,7 @@ func (client InterfaceTapConfigurationsClient) CreateOrUpdatePreparer(ctx contex "tapConfigurationName": autorest.Encode("path", tapConfigurationName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -197,7 +197,7 @@ func (client InterfaceTapConfigurationsClient) DeletePreparer(ctx context.Contex "tapConfigurationName": autorest.Encode("path", tapConfigurationName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -284,7 +284,7 @@ func (client InterfaceTapConfigurationsClient) GetPreparer(ctx context.Context, "tapConfigurationName": autorest.Encode("path", tapConfigurationName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -365,7 +365,7 @@ func (client InterfaceTapConfigurationsClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/ipallocations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ipallocations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/ipallocations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ipallocations.go index ae0cded0e2f1..764e051e0052 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/ipallocations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ipallocations.go @@ -69,7 +69,7 @@ func (client IPAllocationsClient) CreateOrUpdatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client IPAllocationsClient) DeletePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client IPAllocationsClient) GetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -316,7 +316,7 @@ func (client IPAllocationsClient) ListPreparer(ctx context.Context) (*http.Reque "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client IPAllocationsClient) ListByResourceGroupPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -546,7 +546,7 @@ func (client IPAllocationsClient) UpdateTagsPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/ipgroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ipgroups.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/ipgroups.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ipgroups.go index 34aa7d0b896c..ec763e6966c1 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/ipgroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ipgroups.go @@ -69,7 +69,7 @@ func (client IPGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client IPGroupsClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -238,7 +238,7 @@ func (client IPGroupsClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -317,7 +317,7 @@ func (client IPGroupsClient) ListPreparer(ctx context.Context) (*http.Request, e "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -433,7 +433,7 @@ func (client IPGroupsClient) ListByResourceGroupPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -547,7 +547,7 @@ func (client IPGroupsClient) UpdateGroupsPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancerbackendaddresspools.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerbackendaddresspools.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancerbackendaddresspools.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerbackendaddresspools.go index 395e3427621e..8f5cf4c572b0 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancerbackendaddresspools.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerbackendaddresspools.go @@ -72,7 +72,7 @@ func (client LoadBalancerBackendAddressPoolsClient) CreateOrUpdatePreparer(ctx c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -157,7 +157,7 @@ func (client LoadBalancerBackendAddressPoolsClient) DeletePreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +244,7 @@ func (client LoadBalancerBackendAddressPoolsClient) GetPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -325,7 +325,7 @@ func (client LoadBalancerBackendAddressPoolsClient) ListPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancerfrontendipconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerfrontendipconfigurations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancerfrontendipconfigurations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerfrontendipconfigurations.go index 6ddb4c8810c9..89fcfa437255 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancerfrontendipconfigurations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerfrontendipconfigurations.go @@ -79,7 +79,7 @@ func (client LoadBalancerFrontendIPConfigurationsClient) GetPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -160,7 +160,7 @@ func (client LoadBalancerFrontendIPConfigurationsClient) ListPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancerloadbalancingrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerloadbalancingrules.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancerloadbalancingrules.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerloadbalancingrules.go index f88f07a6b65e..61d0a0eb6ad6 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancerloadbalancingrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerloadbalancingrules.go @@ -78,7 +78,7 @@ func (client LoadBalancerLoadBalancingRulesClient) GetPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client LoadBalancerLoadBalancingRulesClient) ListPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancernetworkinterfaces.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancernetworkinterfaces.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancernetworkinterfaces.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancernetworkinterfaces.go index 2ae0cba966ed..979d6bbc8d46 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancernetworkinterfaces.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancernetworkinterfaces.go @@ -81,7 +81,7 @@ func (client LoadBalancerNetworkInterfacesClient) ListPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalanceroutboundrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalanceroutboundrules.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalanceroutboundrules.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalanceroutboundrules.go index ee9993f415cd..c0a7ee956cb1 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalanceroutboundrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalanceroutboundrules.go @@ -78,7 +78,7 @@ func (client LoadBalancerOutboundRulesClient) GetPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client LoadBalancerOutboundRulesClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancerprobes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerprobes.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancerprobes.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerprobes.go index 61e69dcd2643..e6f4119d9d0a 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancerprobes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerprobes.go @@ -78,7 +78,7 @@ func (client LoadBalancerProbesClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client LoadBalancerProbesClient) ListPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancers.go similarity index 85% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancers.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancers.go index 02766bd8002b..47a59550a3ba 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/loadbalancers.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancers.go @@ -69,7 +69,7 @@ func (client LoadBalancersClient) CreateOrUpdatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client LoadBalancersClient) DeletePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client LoadBalancersClient) GetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -319,7 +319,7 @@ func (client LoadBalancersClient) ListPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client LoadBalancersClient) ListAllPreparer(ctx context.Context) (*http.Re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -500,6 +500,90 @@ func (client LoadBalancersClient) ListAllComplete(ctx context.Context) (result L return } +// ListInboundNatRulePortMappings list of inbound NAT rule port mappings. +// Parameters: +// groupName - the name of the resource group. +// loadBalancerName - the name of the load balancer. +// backendPoolName - the name of the load balancer backend address pool. +// parameters - query inbound NAT rule port mapping request. +func (client LoadBalancersClient) ListInboundNatRulePortMappings(ctx context.Context, groupName string, loadBalancerName string, backendPoolName string, parameters QueryInboundNatRulePortMappingRequest) (result LoadBalancersListInboundNatRulePortMappingsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.ListInboundNatRulePortMappings") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListInboundNatRulePortMappingsPreparer(ctx, groupName, loadBalancerName, backendPoolName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListInboundNatRulePortMappings", nil, "Failure preparing request") + return + } + + result, err = client.ListInboundNatRulePortMappingsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListInboundNatRulePortMappings", result.Response(), "Failure sending request") + return + } + + return +} + +// ListInboundNatRulePortMappingsPreparer prepares the ListInboundNatRulePortMappings request. +func (client LoadBalancersClient) ListInboundNatRulePortMappingsPreparer(ctx context.Context, groupName string, loadBalancerName string, backendPoolName string, parameters QueryInboundNatRulePortMappingRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backendPoolName": autorest.Encode("path", backendPoolName), + "groupName": autorest.Encode("path", groupName), + "loadBalancerName": autorest.Encode("path", loadBalancerName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendPoolName}/queryInboundNatRulePortMapping", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListInboundNatRulePortMappingsSender sends the ListInboundNatRulePortMappings request. The method will close the +// http.Response Body if it receives an error. +func (client LoadBalancersClient) ListInboundNatRulePortMappingsSender(req *http.Request) (future LoadBalancersListInboundNatRulePortMappingsFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ListInboundNatRulePortMappingsResponder handles the response to the ListInboundNatRulePortMappings request. The method always +// closes the http.Response Body. +func (client LoadBalancersClient) ListInboundNatRulePortMappingsResponder(resp *http.Response) (result BackendAddressInboundNatRulePortMappings, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // SwapPublicIPAddresses swaps VIPs between two load balancers. // Parameters: // location - the region where load balancers are located at. @@ -537,7 +621,7 @@ func (client LoadBalancersClient) SwapPublicIPAddressesPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -625,7 +709,7 @@ func (client LoadBalancersClient) UpdateTagsPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/localnetworkgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/localnetworkgateways.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/localnetworkgateways.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/localnetworkgateways.go index 163240394d21..c7cd62e8c913 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/localnetworkgateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/localnetworkgateways.go @@ -86,7 +86,7 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -174,7 +174,7 @@ func (client LocalNetworkGatewaysClient) DeletePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -265,7 +265,7 @@ func (client LocalNetworkGatewaysClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -344,7 +344,7 @@ func (client LocalNetworkGatewaysClient) ListPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -464,7 +464,7 @@ func (client LocalNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/models.go similarity index 94% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/models.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/models.go index 97e198bf6264..fc6475f7f815 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/models.go @@ -18,7 +18,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" // AadAuthenticationParameters AAD Vpn authentication type related parameters. type AadAuthenticationParameters struct { @@ -838,7 +838,7 @@ func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) e type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { // Port - The destination port on the backend. Port *int32 `json:"port,omitempty"` - // Protocol - The protocol used to communicate with the backend. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS' + // Protocol - The protocol used to communicate with the backend. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS', 'ApplicationGatewayProtocolTCP', 'ApplicationGatewayProtocolTLS' Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` // CookieBasedAffinity - Cookie based affinity. Possible values include: 'ApplicationGatewayCookieBasedAffinityEnabled', 'ApplicationGatewayCookieBasedAffinityDisabled' CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` @@ -911,6 +911,143 @@ func (agbhspf ApplicationGatewayBackendHTTPSettingsPropertiesFormat) MarshalJSON return json.Marshal(objectMap) } +// ApplicationGatewayBackendSettings backend address pool settings of an application gateway. +type ApplicationGatewayBackendSettings struct { + // ApplicationGatewayBackendSettingsPropertiesFormat - Properties of the application gateway backend settings. + *ApplicationGatewayBackendSettingsPropertiesFormat `json:"properties,omitempty"` + // Name - Name of the backend settings that is unique within an Application Gateway. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayBackendSettings. +func (agbs ApplicationGatewayBackendSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agbs.ApplicationGatewayBackendSettingsPropertiesFormat != nil { + objectMap["properties"] = agbs.ApplicationGatewayBackendSettingsPropertiesFormat + } + if agbs.Name != nil { + objectMap["name"] = agbs.Name + } + if agbs.ID != nil { + objectMap["id"] = agbs.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendSettings struct. +func (agbs *ApplicationGatewayBackendSettings) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayBackendSettingsPropertiesFormat ApplicationGatewayBackendSettingsPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayBackendSettingsPropertiesFormat) + if err != nil { + return err + } + agbs.ApplicationGatewayBackendSettingsPropertiesFormat = &applicationGatewayBackendSettingsPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agbs.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agbs.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agbs.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agbs.ID = &ID + } + } + } + + return nil +} + +// ApplicationGatewayBackendSettingsPropertiesFormat properties of Backend address pool settings of an +// application gateway. +type ApplicationGatewayBackendSettingsPropertiesFormat struct { + // Port - The destination port on the backend. + Port *int32 `json:"port,omitempty"` + // Protocol - The protocol used to communicate with the backend. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS', 'ApplicationGatewayProtocolTCP', 'ApplicationGatewayProtocolTLS' + Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` + // Timeout - Connection timeout in seconds. Application Gateway will fail the request if response is not received within ConnectionTimeout. Acceptable values are from 1 second to 86400 seconds. + Timeout *int32 `json:"timeout,omitempty"` + // Probe - Probe resource of an application gateway. + Probe *SubResource `json:"probe,omitempty"` + // TrustedRootCertificates - Array of references to application gateway trusted root certificates. + TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"` + // HostName - Server name indication to be sent to the backend servers for Tls protocol. + HostName *string `json:"hostName,omitempty"` + // PickHostNameFromBackendAddress - Whether to pick server name indication from the host name of the backend server for Tls protocol. Default value is false. + PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the backend HTTP settings resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayBackendSettingsPropertiesFormat. +func (agbspf ApplicationGatewayBackendSettingsPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agbspf.Port != nil { + objectMap["port"] = agbspf.Port + } + if agbspf.Protocol != "" { + objectMap["protocol"] = agbspf.Protocol + } + if agbspf.Timeout != nil { + objectMap["timeout"] = agbspf.Timeout + } + if agbspf.Probe != nil { + objectMap["probe"] = agbspf.Probe + } + if agbspf.TrustedRootCertificates != nil { + objectMap["trustedRootCertificates"] = agbspf.TrustedRootCertificates + } + if agbspf.HostName != nil { + objectMap["hostName"] = agbspf.HostName + } + if agbspf.PickHostNameFromBackendAddress != nil { + objectMap["pickHostNameFromBackendAddress"] = agbspf.PickHostNameFromBackendAddress + } + return json.Marshal(objectMap) +} + // ApplicationGatewayClientAuthConfiguration application gateway client authentication configuration. type ApplicationGatewayClientAuthConfiguration struct { // VerifyClientCertIssuerDN - Verify client certificate issuer name on the application gateway. @@ -1335,6 +1472,14 @@ func (agfppf ApplicationGatewayFrontendPortPropertiesFormat) MarshalJSON() ([]by return json.Marshal(objectMap) } +// ApplicationGatewayGlobalConfiguration application Gateway global configuration. +type ApplicationGatewayGlobalConfiguration struct { + // EnableRequestBuffering - Enable request buffering. + EnableRequestBuffering *bool `json:"enableRequestBuffering,omitempty"` + // EnableResponseBuffering - Enable response buffering. + EnableResponseBuffering *bool `json:"enableResponseBuffering,omitempty"` +} + // ApplicationGatewayHeaderConfiguration header configuration of the Actions set in Application Gateway. type ApplicationGatewayHeaderConfiguration struct { // HeaderName - Header name of the header configuration. @@ -1438,7 +1583,7 @@ type ApplicationGatewayHTTPListenerPropertiesFormat struct { FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` // FrontendPort - Frontend port resource of an application gateway. FrontendPort *SubResource `json:"frontendPort,omitempty"` - // Protocol - Protocol of the HTTP listener. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS' + // Protocol - Protocol of the HTTP listener. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS', 'ApplicationGatewayProtocolTCP', 'ApplicationGatewayProtocolTLS' Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` // HostName - Host name of HTTP listener. HostName *string `json:"hostName,omitempty"` @@ -1602,6 +1747,132 @@ func (agicpf ApplicationGatewayIPConfigurationPropertiesFormat) MarshalJSON() ([ return json.Marshal(objectMap) } +// ApplicationGatewayListener listener of an application gateway. +type ApplicationGatewayListener struct { + // ApplicationGatewayListenerPropertiesFormat - Properties of the application gateway listener. + *ApplicationGatewayListenerPropertiesFormat `json:"properties,omitempty"` + // Name - Name of the listener that is unique within an Application Gateway. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayListener. +func (agl ApplicationGatewayListener) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agl.ApplicationGatewayListenerPropertiesFormat != nil { + objectMap["properties"] = agl.ApplicationGatewayListenerPropertiesFormat + } + if agl.Name != nil { + objectMap["name"] = agl.Name + } + if agl.ID != nil { + objectMap["id"] = agl.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayListener struct. +func (agl *ApplicationGatewayListener) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayListenerPropertiesFormat ApplicationGatewayListenerPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayListenerPropertiesFormat) + if err != nil { + return err + } + agl.ApplicationGatewayListenerPropertiesFormat = &applicationGatewayListenerPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agl.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agl.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agl.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agl.ID = &ID + } + } + } + + return nil +} + +// ApplicationGatewayListenerPropertiesFormat properties of listener of an application gateway. +type ApplicationGatewayListenerPropertiesFormat struct { + // FrontendIPConfiguration - Frontend IP configuration resource of an application gateway. + FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` + // FrontendPort - Frontend port resource of an application gateway. + FrontendPort *SubResource `json:"frontendPort,omitempty"` + // Protocol - Protocol of the listener. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS', 'ApplicationGatewayProtocolTCP', 'ApplicationGatewayProtocolTLS' + Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` + // SslCertificate - SSL certificate resource of an application gateway. + SslCertificate *SubResource `json:"sslCertificate,omitempty"` + // SslProfile - SSL profile resource of the application gateway. + SslProfile *SubResource `json:"sslProfile,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the listener resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayListenerPropertiesFormat. +func (aglpf ApplicationGatewayListenerPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aglpf.FrontendIPConfiguration != nil { + objectMap["frontendIPConfiguration"] = aglpf.FrontendIPConfiguration + } + if aglpf.FrontendPort != nil { + objectMap["frontendPort"] = aglpf.FrontendPort + } + if aglpf.Protocol != "" { + objectMap["protocol"] = aglpf.Protocol + } + if aglpf.SslCertificate != nil { + objectMap["sslCertificate"] = aglpf.SslCertificate + } + if aglpf.SslProfile != nil { + objectMap["sslProfile"] = aglpf.SslProfile + } + return json.Marshal(objectMap) +} + // ApplicationGatewayListResult response for ListApplicationGateways API service call. type ApplicationGatewayListResult struct { autorest.Response `json:"-"` @@ -1761,9 +2032,218 @@ func NewApplicationGatewayListResultPage(cur ApplicationGatewayListResult, getNe } } +// ApplicationGatewayLoadDistributionPolicy load Distribution Policy of an application gateway. +type ApplicationGatewayLoadDistributionPolicy struct { + // ApplicationGatewayLoadDistributionPolicyPropertiesFormat - Properties of the application gateway load distribution policy. + *ApplicationGatewayLoadDistributionPolicyPropertiesFormat `json:"properties,omitempty"` + // Name - Name of the load distribution policy that is unique within an Application Gateway. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayLoadDistributionPolicy. +func (agldp ApplicationGatewayLoadDistributionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agldp.ApplicationGatewayLoadDistributionPolicyPropertiesFormat != nil { + objectMap["properties"] = agldp.ApplicationGatewayLoadDistributionPolicyPropertiesFormat + } + if agldp.Name != nil { + objectMap["name"] = agldp.Name + } + if agldp.ID != nil { + objectMap["id"] = agldp.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayLoadDistributionPolicy struct. +func (agldp *ApplicationGatewayLoadDistributionPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayLoadDistributionPolicyPropertiesFormat ApplicationGatewayLoadDistributionPolicyPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayLoadDistributionPolicyPropertiesFormat) + if err != nil { + return err + } + agldp.ApplicationGatewayLoadDistributionPolicyPropertiesFormat = &applicationGatewayLoadDistributionPolicyPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agldp.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agldp.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agldp.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agldp.ID = &ID + } + } + } + + return nil +} + +// ApplicationGatewayLoadDistributionPolicyPropertiesFormat properties of Load Distribution Policy of an +// application gateway. +type ApplicationGatewayLoadDistributionPolicyPropertiesFormat struct { + // LoadDistributionTargets - Load Distribution Targets resource of an application gateway. + LoadDistributionTargets *[]ApplicationGatewayLoadDistributionTarget `json:"loadDistributionTargets,omitempty"` + // LoadDistributionAlgorithm - Load Distribution Targets resource of an application gateway. Possible values include: 'ApplicationGatewayLoadDistributionAlgorithmRoundRobin', 'ApplicationGatewayLoadDistributionAlgorithmLeastConnections', 'ApplicationGatewayLoadDistributionAlgorithmIPHash' + LoadDistributionAlgorithm ApplicationGatewayLoadDistributionAlgorithm `json:"loadDistributionAlgorithm,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the Load Distribution Policy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayLoadDistributionPolicyPropertiesFormat. +func (agldppf ApplicationGatewayLoadDistributionPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agldppf.LoadDistributionTargets != nil { + objectMap["loadDistributionTargets"] = agldppf.LoadDistributionTargets + } + if agldppf.LoadDistributionAlgorithm != "" { + objectMap["loadDistributionAlgorithm"] = agldppf.LoadDistributionAlgorithm + } + return json.Marshal(objectMap) +} + +// ApplicationGatewayLoadDistributionTarget load Distribution Target of an application gateway. +type ApplicationGatewayLoadDistributionTarget struct { + // ApplicationGatewayLoadDistributionTargetPropertiesFormat - Properties of the application gateway load distribution target. + *ApplicationGatewayLoadDistributionTargetPropertiesFormat `json:"properties,omitempty"` + // Name - Name of the load distribution policy that is unique within an Application Gateway. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayLoadDistributionTarget. +func (agldt ApplicationGatewayLoadDistributionTarget) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agldt.ApplicationGatewayLoadDistributionTargetPropertiesFormat != nil { + objectMap["properties"] = agldt.ApplicationGatewayLoadDistributionTargetPropertiesFormat + } + if agldt.Name != nil { + objectMap["name"] = agldt.Name + } + if agldt.ID != nil { + objectMap["id"] = agldt.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayLoadDistributionTarget struct. +func (agldt *ApplicationGatewayLoadDistributionTarget) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayLoadDistributionTargetPropertiesFormat ApplicationGatewayLoadDistributionTargetPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayLoadDistributionTargetPropertiesFormat) + if err != nil { + return err + } + agldt.ApplicationGatewayLoadDistributionTargetPropertiesFormat = &applicationGatewayLoadDistributionTargetPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agldt.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agldt.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agldt.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agldt.ID = &ID + } + } + } + + return nil +} + +// ApplicationGatewayLoadDistributionTargetPropertiesFormat ... +type ApplicationGatewayLoadDistributionTargetPropertiesFormat struct { + // WeightPerServer - Weight per server. Range between 1 and 100. + WeightPerServer *int32 `json:"weightPerServer,omitempty"` + // BackendAddressPool - Backend address pool resource of the application gateway. + BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` +} + // ApplicationGatewayOnDemandProbe details of on demand test probe request. type ApplicationGatewayOnDemandProbe struct { - // Protocol - The protocol used for the probe. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS' + // Protocol - The protocol used for the probe. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS', 'ApplicationGatewayProtocolTCP', 'ApplicationGatewayProtocolTLS' Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` // Host - Host name to send the probe to. Host *string `json:"host,omitempty"` @@ -1882,6 +2362,8 @@ type ApplicationGatewayPathRulePropertiesFormat struct { RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` // RewriteRuleSet - Rewrite rule set resource of URL path map path rule. RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` + // LoadDistributionPolicy - Load Distribution Policy resource of URL path map path rule. + LoadDistributionPolicy *SubResource `json:"loadDistributionPolicy,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the path rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // FirewallPolicy - Reference to the FirewallPolicy resource. @@ -1906,6 +2388,9 @@ func (agprpf ApplicationGatewayPathRulePropertiesFormat) MarshalJSON() ([]byte, if agprpf.RewriteRuleSet != nil { objectMap["rewriteRuleSet"] = agprpf.RewriteRuleSet } + if agprpf.LoadDistributionPolicy != nil { + objectMap["loadDistributionPolicy"] = agprpf.LoadDistributionPolicy + } if agprpf.FirewallPolicy != nil { objectMap["firewallPolicy"] = agprpf.FirewallPolicy } @@ -2865,7 +3350,7 @@ type ApplicationGatewayProbeHealthResponseMatch struct { // ApplicationGatewayProbePropertiesFormat properties of probe of an application gateway. type ApplicationGatewayProbePropertiesFormat struct { - // Protocol - The protocol used for the probe. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS' + // Protocol - The protocol used for the probe. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS', 'ApplicationGatewayProtocolTCP', 'ApplicationGatewayProtocolTLS' Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` // Host - Host name to send the probe to. Host *string `json:"host,omitempty"` @@ -2879,6 +3364,8 @@ type ApplicationGatewayProbePropertiesFormat struct { UnhealthyThreshold *int32 `json:"unhealthyThreshold,omitempty"` // PickHostNameFromBackendHTTPSettings - Whether the host header should be picked from the backend http settings. Default value is false. PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"` + // PickHostNameFromBackendSettings - Whether the server name indication should be picked from the backend settings for Tls protocol. Default value is false. + PickHostNameFromBackendSettings *bool `json:"pickHostNameFromBackendSettings,omitempty"` // MinServers - Minimum number of servers that are always marked healthy. Default value is 0. MinServers *int32 `json:"minServers,omitempty"` // Match - Criterion for classifying a healthy probe response. @@ -2913,6 +3400,9 @@ func (agppf ApplicationGatewayProbePropertiesFormat) MarshalJSON() ([]byte, erro if agppf.PickHostNameFromBackendHTTPSettings != nil { objectMap["pickHostNameFromBackendHttpSettings"] = agppf.PickHostNameFromBackendHTTPSettings } + if agppf.PickHostNameFromBackendSettings != nil { + objectMap["pickHostNameFromBackendSettings"] = agppf.PickHostNameFromBackendSettings + } if agppf.MinServers != nil { objectMap["minServers"] = agppf.MinServers } @@ -2953,14 +3443,20 @@ type ApplicationGatewayPropertiesFormat struct { BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` // BackendHTTPSettingsCollection - Backend http settings of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` + // BackendSettingsCollection - Backend settings of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + BackendSettingsCollection *[]ApplicationGatewayBackendSettings `json:"backendSettingsCollection,omitempty"` // HTTPListeners - Http listeners of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` + // Listeners - Listeners of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + Listeners *[]ApplicationGatewayListener `json:"listeners,omitempty"` // SslProfiles - SSL profiles of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` // URLPathMaps - URL path map of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). URLPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` // RequestRoutingRules - Request routing rules of the application gateway resource. RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` + // RoutingRules - Routing rules of the application gateway resource. + RoutingRules *[]ApplicationGatewayRoutingRule `json:"routingRules,omitempty"` // RewriteRuleSets - Rewrite rules for the application gateway resource. RewriteRuleSets *[]ApplicationGatewayRewriteRuleSet `json:"rewriteRuleSets,omitempty"` // RedirectConfigurations - Redirect configurations of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). @@ -2987,6 +3483,10 @@ type ApplicationGatewayPropertiesFormat struct { CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` // ForceFirewallPolicyAssociation - If true, associates a firewall policy with an application gateway regardless whether the policy differs from the WAF Config. ForceFirewallPolicyAssociation *bool `json:"forceFirewallPolicyAssociation,omitempty"` + // LoadDistributionPolicies - Load distribution policies of the application gateway resource. + LoadDistributionPolicies *[]ApplicationGatewayLoadDistributionPolicy `json:"loadDistributionPolicies,omitempty"` + // GlobalConfiguration - Global Configuration. + GlobalConfiguration *ApplicationGatewayGlobalConfiguration `json:"globalConfiguration,omitempty"` } // MarshalJSON is the custom marshaler for ApplicationGatewayPropertiesFormat. @@ -3028,9 +3528,15 @@ func (agpf ApplicationGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { if agpf.BackendHTTPSettingsCollection != nil { objectMap["backendHttpSettingsCollection"] = agpf.BackendHTTPSettingsCollection } + if agpf.BackendSettingsCollection != nil { + objectMap["backendSettingsCollection"] = agpf.BackendSettingsCollection + } if agpf.HTTPListeners != nil { objectMap["httpListeners"] = agpf.HTTPListeners } + if agpf.Listeners != nil { + objectMap["listeners"] = agpf.Listeners + } if agpf.SslProfiles != nil { objectMap["sslProfiles"] = agpf.SslProfiles } @@ -3040,6 +3546,9 @@ func (agpf ApplicationGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { if agpf.RequestRoutingRules != nil { objectMap["requestRoutingRules"] = agpf.RequestRoutingRules } + if agpf.RoutingRules != nil { + objectMap["routingRules"] = agpf.RoutingRules + } if agpf.RewriteRuleSets != nil { objectMap["rewriteRuleSets"] = agpf.RewriteRuleSets } @@ -3070,6 +3579,12 @@ func (agpf ApplicationGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { if agpf.ForceFirewallPolicyAssociation != nil { objectMap["forceFirewallPolicyAssociation"] = agpf.ForceFirewallPolicyAssociation } + if agpf.LoadDistributionPolicies != nil { + objectMap["loadDistributionPolicies"] = agpf.LoadDistributionPolicies + } + if agpf.GlobalConfiguration != nil { + objectMap["globalConfiguration"] = agpf.GlobalConfiguration + } return json.Marshal(objectMap) } @@ -3291,6 +3806,8 @@ type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` // RedirectConfiguration - Redirect configuration resource of the application gateway. RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` + // LoadDistributionPolicy - Load Distribution Policy resource of the application gateway. + LoadDistributionPolicy *SubResource `json:"loadDistributionPolicy,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the request routing rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -3322,6 +3839,9 @@ func (agrrrpf ApplicationGatewayRequestRoutingRulePropertiesFormat) MarshalJSON( if agrrrpf.RedirectConfiguration != nil { objectMap["redirectConfiguration"] = agrrrpf.RedirectConfiguration } + if agrrrpf.LoadDistributionPolicy != nil { + objectMap["loadDistributionPolicy"] = agrrrpf.LoadDistributionPolicy + } return json.Marshal(objectMap) } @@ -3455,6 +3975,132 @@ func (agrrspf ApplicationGatewayRewriteRuleSetPropertiesFormat) MarshalJSON() ([ return json.Marshal(objectMap) } +// ApplicationGatewayRoutingRule routing rule of an application gateway. +type ApplicationGatewayRoutingRule struct { + // ApplicationGatewayRoutingRulePropertiesFormat - Properties of the application gateway routing rule. + *ApplicationGatewayRoutingRulePropertiesFormat `json:"properties,omitempty"` + // Name - Name of the routing rule that is unique within an Application Gateway. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayRoutingRule. +func (agrr ApplicationGatewayRoutingRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agrr.ApplicationGatewayRoutingRulePropertiesFormat != nil { + objectMap["properties"] = agrr.ApplicationGatewayRoutingRulePropertiesFormat + } + if agrr.Name != nil { + objectMap["name"] = agrr.Name + } + if agrr.ID != nil { + objectMap["id"] = agrr.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRoutingRule struct. +func (agrr *ApplicationGatewayRoutingRule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayRoutingRulePropertiesFormat ApplicationGatewayRoutingRulePropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayRoutingRulePropertiesFormat) + if err != nil { + return err + } + agrr.ApplicationGatewayRoutingRulePropertiesFormat = &applicationGatewayRoutingRulePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agrr.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agrr.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agrr.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agrr.ID = &ID + } + } + } + + return nil +} + +// ApplicationGatewayRoutingRulePropertiesFormat properties of routing rule of the application gateway. +type ApplicationGatewayRoutingRulePropertiesFormat struct { + // RuleType - Rule type. Possible values include: 'ApplicationGatewayRequestRoutingRuleTypeBasic', 'ApplicationGatewayRequestRoutingRuleTypePathBasedRouting' + RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` + // Priority - Priority of the routing rule. + Priority *int32 `json:"priority,omitempty"` + // BackendAddressPool - Backend address pool resource of the application gateway. + BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` + // BackendSettings - Backend settings resource of the application gateway. + BackendSettings *SubResource `json:"backendSettings,omitempty"` + // Listener - Listener resource of the application gateway. + Listener *SubResource `json:"listener,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the request routing rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayRoutingRulePropertiesFormat. +func (agrrpf ApplicationGatewayRoutingRulePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agrrpf.RuleType != "" { + objectMap["ruleType"] = agrrpf.RuleType + } + if agrrpf.Priority != nil { + objectMap["priority"] = agrrpf.Priority + } + if agrrpf.BackendAddressPool != nil { + objectMap["backendAddressPool"] = agrrpf.BackendAddressPool + } + if agrrpf.BackendSettings != nil { + objectMap["backendSettings"] = agrrpf.BackendSettings + } + if agrrpf.Listener != nil { + objectMap["listener"] = agrrpf.Listener + } + return json.Marshal(objectMap) +} + // ApplicationGatewaysBackendHealthFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ApplicationGatewaysBackendHealthFuture struct { @@ -4364,6 +5010,8 @@ type ApplicationGatewayURLPathMapPropertiesFormat struct { DefaultRewriteRuleSet *SubResource `json:"defaultRewriteRuleSet,omitempty"` // DefaultRedirectConfiguration - Default redirect configuration resource of URL path map. DefaultRedirectConfiguration *SubResource `json:"defaultRedirectConfiguration,omitempty"` + // DefaultLoadDistributionPolicy - Default Load Distribution Policy resource of URL path map. + DefaultLoadDistributionPolicy *SubResource `json:"defaultLoadDistributionPolicy,omitempty"` // PathRules - Path rule of URL path map resource. PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the URL path map resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' @@ -4385,6 +5033,9 @@ func (agupmpf ApplicationGatewayURLPathMapPropertiesFormat) MarshalJSON() ([]byt if agupmpf.DefaultRedirectConfiguration != nil { objectMap["defaultRedirectConfiguration"] = agupmpf.DefaultRedirectConfiguration } + if agupmpf.DefaultLoadDistributionPolicy != nil { + objectMap["defaultLoadDistributionPolicy"] = agupmpf.DefaultLoadDistributionPolicy + } if agupmpf.PathRules != nil { objectMap["pathRules"] = agupmpf.PathRules } @@ -7128,7 +7779,7 @@ func (future *AzureFirewallsDeleteFuture) result(client AzureFirewallsClient) (a type AzureFirewallSku struct { // Name - Name of an Azure Firewall SKU. Possible values include: 'AzureFirewallSkuNameAZFWVNet', 'AzureFirewallSkuNameAZFWHub' Name AzureFirewallSkuName `json:"name,omitempty"` - // Tier - Tier of an Azure Firewall. Possible values include: 'AzureFirewallSkuTierStandard', 'AzureFirewallSkuTierPremium' + // Tier - Tier of an Azure Firewall. Possible values include: 'AzureFirewallSkuTierStandard', 'AzureFirewallSkuTierPremium', 'AzureFirewallSkuTierBasic' Tier AzureFirewallSkuTier `json:"tier,omitempty"` } @@ -7486,6 +8137,13 @@ func (awcpf AzureWebCategoryPropertiesFormat) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// BackendAddressInboundNatRulePortMappings the response for a QueryInboundNatRulePortMapping API. +type BackendAddressInboundNatRulePortMappings struct { + autorest.Response `json:"-"` + // InboundNatRulePortMappings - Collection of inbound NAT rule port mappings. + InboundNatRulePortMappings *[]InboundNatRulePortMapping `json:"inboundNatRulePortMappings,omitempty"` +} + // BackendAddressPool pool of backend IP addresses. type BackendAddressPool struct { autorest.Response `json:"-"` @@ -7592,8 +8250,12 @@ type BackendAddressPoolPropertiesFormat struct { OutboundRule *SubResource `json:"outboundRule,omitempty"` // OutboundRules - READ-ONLY; An array of references to outbound rules that use this backend address pool. OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + // InboundNatRules - READ-ONLY; An array of references to inbound NAT rules that use this backend address pool. + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the backend address pool resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // DrainPeriodInSeconds - Amount of seconds Load Balancer waits for before sending RESET to client and backend address. + DrainPeriodInSeconds *int32 `json:"drainPeriodInSeconds,omitempty"` } // MarshalJSON is the custom marshaler for BackendAddressPoolPropertiesFormat. @@ -7608,6 +8270,9 @@ func (bappf BackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { if bappf.LoadBalancerBackendAddresses != nil { objectMap["loadBalancerBackendAddresses"] = bappf.LoadBalancerBackendAddresses } + if bappf.DrainPeriodInSeconds != nil { + objectMap["drainPeriodInSeconds"] = bappf.DrainPeriodInSeconds + } return json.Marshal(objectMap) } @@ -8215,6 +8880,18 @@ type BastionHostPropertiesFormat struct { DNSName *string `json:"dnsName,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the bastion host resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ScaleUnits - The scale units for the Bastion Host resource. + ScaleUnits *int32 `json:"scaleUnits,omitempty"` + // DisableCopyPaste - Enable/Disable Copy/Paste feature of the Bastion Host resource. + DisableCopyPaste *bool `json:"disableCopyPaste,omitempty"` + // EnableFileCopy - Enable/Disable File Copy feature of the Bastion Host resource. + EnableFileCopy *bool `json:"enableFileCopy,omitempty"` + // EnableIPConnect - Enable/Disable IP Connect feature of the Bastion Host resource. + EnableIPConnect *bool `json:"enableIpConnect,omitempty"` + // EnableShareableLink - Enable/Disable Shareable Link of the Bastion Host resource. + EnableShareableLink *bool `json:"enableShareableLink,omitempty"` + // EnableTunneling - Enable/Disable Tunneling feature of the Bastion Host resource. + EnableTunneling *bool `json:"enableTunneling,omitempty"` } // MarshalJSON is the custom marshaler for BastionHostPropertiesFormat. @@ -8226,6 +8903,24 @@ func (bhpf BastionHostPropertiesFormat) MarshalJSON() ([]byte, error) { if bhpf.DNSName != nil { objectMap["dnsName"] = bhpf.DNSName } + if bhpf.ScaleUnits != nil { + objectMap["scaleUnits"] = bhpf.ScaleUnits + } + if bhpf.DisableCopyPaste != nil { + objectMap["disableCopyPaste"] = bhpf.DisableCopyPaste + } + if bhpf.EnableFileCopy != nil { + objectMap["enableFileCopy"] = bhpf.EnableFileCopy + } + if bhpf.EnableIPConnect != nil { + objectMap["enableIpConnect"] = bhpf.EnableIPConnect + } + if bhpf.EnableShareableLink != nil { + objectMap["enableShareableLink"] = bhpf.EnableShareableLink + } + if bhpf.EnableTunneling != nil { + objectMap["enableTunneling"] = bhpf.EnableTunneling + } return json.Marshal(objectMap) } @@ -8309,6 +9004,49 @@ func (future *BastionHostsDeleteFuture) result(client BastionHostsClient) (ar au return } +// BastionHostsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type BastionHostsUpdateTagsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(BastionHostsClient) (BastionHost, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *BastionHostsUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for BastionHostsUpdateTagsFuture.Result. +func (future *BastionHostsUpdateTagsFuture) result(client BastionHostsClient) (bh BastionHost, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.BastionHostsUpdateTagsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + bh.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.BastionHostsUpdateTagsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if bh.Response.Response, err = future.GetResult(sender); err == nil && bh.Response.Response.StatusCode != http.StatusNoContent { + bh, err = client.UpdateTagsResponder(bh.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.BastionHostsUpdateTagsFuture", "Result", bh.Response.Response, "Failure responding to request") + } + } + return +} + // BastionSessionDeleteResult response for DisconnectActiveSessions. type BastionSessionDeleteResult struct { autorest.Response `json:"-"` @@ -8783,6 +9521,8 @@ type BgpConnectionProperties struct { PeerAsn *int64 `json:"peerAsn,omitempty"` // PeerIP - Peer IP. PeerIP *string `json:"peerIp,omitempty"` + // HubVirtualNetworkConnection - The reference to the HubVirtualNetworkConnection resource. + HubVirtualNetworkConnection *SubResource `json:"hubVirtualNetworkConnection,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ConnectionState - READ-ONLY; The current state of the VirtualHub to Peer. Possible values include: 'HubBgpConnectionStatusUnknown', 'HubBgpConnectionStatusConnecting', 'HubBgpConnectionStatusConnected', 'HubBgpConnectionStatusNotConnected' @@ -8798,6 +9538,9 @@ func (bcp BgpConnectionProperties) MarshalJSON() ([]byte, error) { if bcp.PeerIP != nil { objectMap["peerIp"] = bcp.PeerIP } + if bcp.HubVirtualNetworkConnection != nil { + objectMap["hubVirtualNetworkConnection"] = bcp.HubVirtualNetworkConnection + } return json.Marshal(objectMap) } @@ -9198,6 +9941,86 @@ type ConfigurationDiagnosticResult struct { NetworkSecurityGroupResult *SecurityGroupResult `json:"networkSecurityGroupResult,omitempty"` } +// ConfigurationPolicyGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ConfigurationPolicyGroupsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ConfigurationPolicyGroupsClient) (VpnServerConfigurationPolicyGroup, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ConfigurationPolicyGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ConfigurationPolicyGroupsCreateOrUpdateFuture.Result. +func (future *ConfigurationPolicyGroupsCreateOrUpdateFuture) result(client ConfigurationPolicyGroupsClient) (vscpg VpnServerConfigurationPolicyGroup, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vscpg.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.ConfigurationPolicyGroupsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vscpg.Response.Response, err = future.GetResult(sender); err == nil && vscpg.Response.Response.StatusCode != http.StatusNoContent { + vscpg, err = client.CreateOrUpdateResponder(vscpg.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsCreateOrUpdateFuture", "Result", vscpg.Response.Response, "Failure responding to request") + } + } + return +} + +// ConfigurationPolicyGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ConfigurationPolicyGroupsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ConfigurationPolicyGroupsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ConfigurationPolicyGroupsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ConfigurationPolicyGroupsDeleteFuture.Result. +func (future *ConfigurationPolicyGroupsDeleteFuture) result(client ConfigurationPolicyGroupsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.ConfigurationPolicyGroupsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + // ConnectionMonitor parameters that define the operation to create a connection monitor. type ConnectionMonitor struct { // Location - Connection monitor location. @@ -10721,9 +11544,9 @@ type CustomIPPrefixPropertiesFormat struct { // AuthorizationMessage - Authorization message for WAN validation. AuthorizationMessage *string `json:"authorizationMessage,omitempty"` // CustomIPPrefixParent - The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. - CustomIPPrefixParent *CustomIPPrefix `json:"customIpPrefixParent,omitempty"` + CustomIPPrefixParent *SubResource `json:"customIpPrefixParent,omitempty"` // ChildCustomIPPrefixes - READ-ONLY; The list of all Children for IPv6 /48 CustomIpPrefix. - ChildCustomIPPrefixes *[]CustomIPPrefix `json:"childCustomIpPrefixes,omitempty"` + ChildCustomIPPrefixes *[]SubResource `json:"childCustomIpPrefixes,omitempty"` // CommissionedState - The commissioned state of the Custom IP Prefix. Possible values include: 'CommissionedStateProvisioning', 'CommissionedStateProvisioned', 'CommissionedStateCommissioning', 'CommissionedStateCommissioned', 'CommissionedStateDecommissioning', 'CommissionedStateDeprovisioning' CommissionedState CommissionedState `json:"commissionedState,omitempty"` // PublicIPPrefixes - READ-ONLY; The list of all referenced PublicIpPrefixes. @@ -11532,7 +12355,7 @@ type DNSSettings struct { RequireProxyForNetworkRules *bool `json:"requireProxyForNetworkRules,omitempty"` } -// DscpConfiguration DSCP Configuration in a resource group. +// DscpConfiguration differentiated Services Code Point configuration for any given network interface type DscpConfiguration struct { autorest.Response `json:"-"` // DscpConfigurationPropertiesFormat - Properties of the network interface. @@ -11895,7 +12718,7 @@ func NewDscpConfigurationListResultPage(cur DscpConfigurationListResult, getNext } } -// DscpConfigurationPropertiesFormat DSCP Configuration properties. +// DscpConfigurationPropertiesFormat differentiated Services Code Point configuration properties. type DscpConfigurationPropertiesFormat struct { // Markings - List of markings to be used in the configuration. Markings *[]int32 `json:"markings,omitempty"` @@ -11909,6 +12732,8 @@ type DscpConfigurationPropertiesFormat struct { DestinationPortRanges *[]QosPortRange `json:"destinationPortRanges,omitempty"` // Protocol - RNM supported protocol types. Possible values include: 'ProtocolTypeDoNotUse', 'ProtocolTypeIcmp', 'ProtocolTypeTCP', 'ProtocolTypeUDP', 'ProtocolTypeGre', 'ProtocolTypeEsp', 'ProtocolTypeAh', 'ProtocolTypeVxlan', 'ProtocolTypeAll' Protocol ProtocolType `json:"protocol,omitempty"` + // QosDefinitionCollection - QoS object definitions + QosDefinitionCollection *[]QosDefinition `json:"qosDefinitionCollection,omitempty"` // QosCollectionID - READ-ONLY; Qos Collection ID generated by RNM. QosCollectionID *string `json:"qosCollectionId,omitempty"` // AssociatedNetworkInterfaces - READ-ONLY; Associated Network Interfaces to the DSCP Configuration. @@ -11940,6 +12765,9 @@ func (dcpf DscpConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { if dcpf.Protocol != "" { objectMap["protocol"] = dcpf.Protocol } + if dcpf.QosDefinitionCollection != nil { + objectMap["qosDefinitionCollection"] = dcpf.QosDefinitionCollection + } return json.Marshal(objectMap) } @@ -12317,6 +13145,44 @@ func (ensg EvaluatedNetworkSecurityGroup) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// ExclusionManagedRule defines a managed rule to use for exclusion. +type ExclusionManagedRule struct { + // RuleID - Identifier for the managed rule. + RuleID *string `json:"ruleId,omitempty"` +} + +// ExclusionManagedRuleGroup defines a managed rule group to use for exclusion. +type ExclusionManagedRuleGroup struct { + // RuleGroupName - The managed rule group for exclusion. + RuleGroupName *string `json:"ruleGroupName,omitempty"` + // Rules - List of rules that will be excluded. If none specified, all rules in the group will be excluded. + Rules *[]ExclusionManagedRule `json:"rules,omitempty"` +} + +// ExclusionManagedRuleSet defines a managed rule set for Exclusions. +type ExclusionManagedRuleSet struct { + // RuleSetType - Defines the rule set type to use. + RuleSetType *string `json:"ruleSetType,omitempty"` + // RuleSetVersion - Defines the version of the rule set to use. + RuleSetVersion *string `json:"ruleSetVersion,omitempty"` + // RuleGroups - Defines the rule groups to apply to the rule set. + RuleGroups *[]ExclusionManagedRuleGroup `json:"ruleGroups,omitempty"` +} + +// ExplicitProxySettings explicit Proxy Settings in Firewall Policy. +type ExplicitProxySettings struct { + // EnableExplicitProxy - When set to true, explicit proxy mode is enabled. + EnableExplicitProxy *bool `json:"enableExplicitProxy,omitempty"` + // HTTPPort - Port number for explicit proxy http protocol, cannot be greater than 64000. + HTTPPort *int32 `json:"httpPort,omitempty"` + // HTTPSPort - Port number for explicit proxy https protocol, cannot be greater than 64000. + HTTPSPort *int32 `json:"httpsPort,omitempty"` + // PacFilePort - Port number for firewall to serve PAC file. + PacFilePort *int32 `json:"pacFilePort,omitempty"` + // PacFile - SAS URL for PAC file. + PacFile *string `json:"pacFile,omitempty"` +} + // ExpressRouteCircuit expressRouteCircuit resource. type ExpressRouteCircuit struct { autorest.Response `json:"-"` @@ -13667,6 +14533,8 @@ type ExpressRouteCircuitPropertiesFormat struct { GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` // GlobalReachEnabled - Flag denoting global reach status. GlobalReachEnabled *bool `json:"globalReachEnabled,omitempty"` + // AuthorizationKey - The authorizationKey. + AuthorizationKey *string `json:"authorizationKey,omitempty"` } // MarshalJSON is the custom marshaler for ExpressRouteCircuitPropertiesFormat. @@ -13708,6 +14576,9 @@ func (ercpf ExpressRouteCircuitPropertiesFormat) MarshalJSON() ([]byte, error) { if ercpf.GlobalReachEnabled != nil { objectMap["globalReachEnabled"] = ercpf.GlobalReachEnabled } + if ercpf.AuthorizationKey != nil { + objectMap["authorizationKey"] = ercpf.AuthorizationKey + } return json.Marshal(objectMap) } @@ -15281,7 +16152,7 @@ type ExpressRouteGatewayList struct { type ExpressRouteGatewayProperties struct { // AutoScaleConfiguration - Configuration for auto scaling. AutoScaleConfiguration *ExpressRouteGatewayPropertiesAutoScaleConfiguration `json:"autoScaleConfiguration,omitempty"` - // ExpressRouteConnections - READ-ONLY; List of ExpressRoute connections to the ExpressRoute gateway. + // ExpressRouteConnections - List of ExpressRoute connections to the ExpressRoute gateway. ExpressRouteConnections *[]ExpressRouteConnection `json:"expressRouteConnections,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the express route gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` @@ -15295,6 +16166,9 @@ func (ergp ExpressRouteGatewayProperties) MarshalJSON() ([]byte, error) { if ergp.AutoScaleConfiguration != nil { objectMap["autoScaleConfiguration"] = ergp.AutoScaleConfiguration } + if ergp.ExpressRouteConnections != nil { + objectMap["expressRouteConnections"] = ergp.ExpressRouteConnections + } if ergp.VirtualHub != nil { objectMap["virtualHub"] = ergp.VirtualHub } @@ -15850,6 +16724,355 @@ func (erp *ExpressRoutePort) UnmarshalJSON(body []byte) error { return nil } +// ExpressRoutePortAuthorization expressRoutePort Authorization resource definition. +type ExpressRoutePortAuthorization struct { + autorest.Response `json:"-"` + // ExpressRoutePortAuthorizationPropertiesFormat - ExpressRoutePort properties. + *ExpressRoutePortAuthorizationPropertiesFormat `json:"properties,omitempty"` + // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExpressRoutePortAuthorization. +func (erpa ExpressRoutePortAuthorization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erpa.ExpressRoutePortAuthorizationPropertiesFormat != nil { + objectMap["properties"] = erpa.ExpressRoutePortAuthorizationPropertiesFormat + } + if erpa.Name != nil { + objectMap["name"] = erpa.Name + } + if erpa.ID != nil { + objectMap["id"] = erpa.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ExpressRoutePortAuthorization struct. +func (erpa *ExpressRoutePortAuthorization) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var expressRoutePortAuthorizationPropertiesFormat ExpressRoutePortAuthorizationPropertiesFormat + err = json.Unmarshal(*v, &expressRoutePortAuthorizationPropertiesFormat) + if err != nil { + return err + } + erpa.ExpressRoutePortAuthorizationPropertiesFormat = &expressRoutePortAuthorizationPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + erpa.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + erpa.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + erpa.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + erpa.ID = &ID + } + } + } + + return nil +} + +// ExpressRoutePortAuthorizationListResult response for ListExpressRoutePortAuthorizations API service +// call. +type ExpressRoutePortAuthorizationListResult struct { + autorest.Response `json:"-"` + // Value - The authorizations in an ExpressRoute Port. + Value *[]ExpressRoutePortAuthorization `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ExpressRoutePortAuthorizationListResultIterator provides access to a complete listing of +// ExpressRoutePortAuthorization values. +type ExpressRoutePortAuthorizationListResultIterator struct { + i int + page ExpressRoutePortAuthorizationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ExpressRoutePortAuthorizationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortAuthorizationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ExpressRoutePortAuthorizationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExpressRoutePortAuthorizationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ExpressRoutePortAuthorizationListResultIterator) Response() ExpressRoutePortAuthorizationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ExpressRoutePortAuthorizationListResultIterator) Value() ExpressRoutePortAuthorization { + if !iter.page.NotDone() { + return ExpressRoutePortAuthorization{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ExpressRoutePortAuthorizationListResultIterator type. +func NewExpressRoutePortAuthorizationListResultIterator(page ExpressRoutePortAuthorizationListResultPage) ExpressRoutePortAuthorizationListResultIterator { + return ExpressRoutePortAuthorizationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (erpalr ExpressRoutePortAuthorizationListResult) IsEmpty() bool { + return erpalr.Value == nil || len(*erpalr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (erpalr ExpressRoutePortAuthorizationListResult) hasNextLink() bool { + return erpalr.NextLink != nil && len(*erpalr.NextLink) != 0 +} + +// expressRoutePortAuthorizationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (erpalr ExpressRoutePortAuthorizationListResult) expressRoutePortAuthorizationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !erpalr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(erpalr.NextLink))) +} + +// ExpressRoutePortAuthorizationListResultPage contains a page of ExpressRoutePortAuthorization values. +type ExpressRoutePortAuthorizationListResultPage struct { + fn func(context.Context, ExpressRoutePortAuthorizationListResult) (ExpressRoutePortAuthorizationListResult, error) + erpalr ExpressRoutePortAuthorizationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ExpressRoutePortAuthorizationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortAuthorizationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.erpalr) + if err != nil { + return err + } + page.erpalr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ExpressRoutePortAuthorizationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExpressRoutePortAuthorizationListResultPage) NotDone() bool { + return !page.erpalr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExpressRoutePortAuthorizationListResultPage) Response() ExpressRoutePortAuthorizationListResult { + return page.erpalr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExpressRoutePortAuthorizationListResultPage) Values() []ExpressRoutePortAuthorization { + if page.erpalr.IsEmpty() { + return nil + } + return *page.erpalr.Value +} + +// Creates a new instance of the ExpressRoutePortAuthorizationListResultPage type. +func NewExpressRoutePortAuthorizationListResultPage(cur ExpressRoutePortAuthorizationListResult, getNextPage func(context.Context, ExpressRoutePortAuthorizationListResult) (ExpressRoutePortAuthorizationListResult, error)) ExpressRoutePortAuthorizationListResultPage { + return ExpressRoutePortAuthorizationListResultPage{ + fn: getNextPage, + erpalr: cur, + } +} + +// ExpressRoutePortAuthorizationPropertiesFormat properties of ExpressRoutePort Authorization. +type ExpressRoutePortAuthorizationPropertiesFormat struct { + // AuthorizationKey - READ-ONLY; The authorization key. + AuthorizationKey *string `json:"authorizationKey,omitempty"` + // AuthorizationUseStatus - READ-ONLY; The authorization use status. Possible values include: 'ExpressRoutePortAuthorizationUseStatusAvailable', 'ExpressRoutePortAuthorizationUseStatusInUse' + AuthorizationUseStatus ExpressRoutePortAuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` + // CircuitResourceURI - READ-ONLY; The reference to the ExpressRoute circuit resource using the authorization. + CircuitResourceURI *string `json:"circuitResourceUri,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the authorization resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExpressRoutePortAuthorizationPropertiesFormat. +func (erpapf ExpressRoutePortAuthorizationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ExpressRoutePortAuthorizationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ExpressRoutePortAuthorizationsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRoutePortAuthorizationsClient) (ExpressRoutePortAuthorization, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRoutePortAuthorizationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ExpressRoutePortAuthorizationsCreateOrUpdateFuture.Result. +func (future *ExpressRoutePortAuthorizationsCreateOrUpdateFuture) result(client ExpressRoutePortAuthorizationsClient) (erpa ExpressRoutePortAuthorization, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + erpa.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.ExpressRoutePortAuthorizationsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if erpa.Response.Response, err = future.GetResult(sender); err == nil && erpa.Response.Response.StatusCode != http.StatusNoContent { + erpa, err = client.CreateOrUpdateResponder(erpa.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsCreateOrUpdateFuture", "Result", erpa.Response.Response, "Failure responding to request") + } + } + return +} + +// ExpressRoutePortAuthorizationsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ExpressRoutePortAuthorizationsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRoutePortAuthorizationsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRoutePortAuthorizationsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ExpressRoutePortAuthorizationsDeleteFuture.Result. +func (future *ExpressRoutePortAuthorizationsDeleteFuture) result(client ExpressRoutePortAuthorizationsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.ExpressRoutePortAuthorizationsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + // ExpressRoutePortListResult response for ListExpressRoutePorts API service call. type ExpressRoutePortListResult struct { autorest.Response `json:"-"` @@ -16735,6 +17958,14 @@ type ExtendedLocation struct { Type ExtendedLocationTypes `json:"type,omitempty"` } +// FilterItems will contain the filter name and values to operate on +type FilterItems struct { + // Field - The name of the field we would like to filter + Field *string `json:"field,omitempty"` + // Values - List of values to filter the current field by + Values *[]string `json:"values,omitempty"` +} + // FirewallPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type FirewallPoliciesCreateOrUpdateFuture struct { @@ -17118,6 +18349,8 @@ type FirewallPolicyIntrusionDetectionConfiguration struct { SignatureOverrides *[]FirewallPolicyIntrusionDetectionSignatureSpecification `json:"signatureOverrides,omitempty"` // BypassTrafficSettings - List of rules for traffic to bypass. BypassTrafficSettings *[]FirewallPolicyIntrusionDetectionBypassTrafficSpecifications `json:"bypassTrafficSettings,omitempty"` + // PrivateRanges - IDPS Private IP address ranges are used to identify traffic direction (i.e. inbound, outbound, etc.). By default, only ranges defined by IANA RFC 1918 are considered private IP addresses. To modify default ranges, specify your Private IP address ranges with this property + PrivateRanges *[]string `json:"privateRanges,omitempty"` } // FirewallPolicyIntrusionDetectionSignatureSpecification intrusion detection signatures specification @@ -17445,8 +18678,12 @@ type FirewallPolicyPropertiesFormat struct { Insights *FirewallPolicyInsights `json:"insights,omitempty"` // Snat - The private IP addresses/IP ranges to which traffic will not be SNAT. Snat *FirewallPolicySNAT `json:"snat,omitempty"` + // SQL - SQL Settings definition. + SQL *FirewallPolicySQL `json:"sql,omitempty"` // DNSSettings - DNS Proxy Settings definition. DNSSettings *DNSSettings `json:"dnsSettings,omitempty"` + // ExplicitProxySettings - Explicit Proxy Settings definition. + ExplicitProxySettings *ExplicitProxySettings `json:"explicitProxySettings,omitempty"` // IntrusionDetection - The configuration for Intrusion detection. IntrusionDetection *FirewallPolicyIntrusionDetection `json:"intrusionDetection,omitempty"` // TransportSecurity - TLS Configuration definition. @@ -17473,9 +18710,15 @@ func (fppf FirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { if fppf.Snat != nil { objectMap["snat"] = fppf.Snat } + if fppf.SQL != nil { + objectMap["sql"] = fppf.SQL + } if fppf.DNSSettings != nil { objectMap["dnsSettings"] = fppf.DNSSettings } + if fppf.ExplicitProxySettings != nil { + objectMap["explicitProxySettings"] = fppf.ExplicitProxySettings + } if fppf.IntrusionDetection != nil { objectMap["intrusionDetection"] = fppf.IntrusionDetection } @@ -18091,7 +19334,7 @@ func (future *FirewallPolicyRuleCollectionGroupsDeleteFuture) result(client Fire // FirewallPolicySku SKU of Firewall policy. type FirewallPolicySku struct { - // Tier - Tier of Firewall Policy. Possible values include: 'FirewallPolicySkuTierStandard', 'FirewallPolicySkuTierPremium' + // Tier - Tier of Firewall Policy. Possible values include: 'FirewallPolicySkuTierStandard', 'FirewallPolicySkuTierPremium', 'FirewallPolicySkuTierBasic' Tier FirewallPolicySkuTier `json:"tier,omitempty"` } @@ -18101,6 +19344,12 @@ type FirewallPolicySNAT struct { PrivateRanges *[]string `json:"privateRanges,omitempty"` } +// FirewallPolicySQL SQL Settings in Firewall Policy. +type FirewallPolicySQL struct { + // AllowSQLRedirect - A flag to indicate if SQL Redirect traffic filtering is enabled. Turning on the flag requires no rule using port 11000-11999. + AllowSQLRedirect *bool `json:"allowSqlRedirect,omitempty"` +} + // FirewallPolicyThreatIntelWhitelist threatIntel Whitelist for Firewall Policy. type FirewallPolicyThreatIntelWhitelist struct { // IPAddresses - List of IP addresses for the ThreatIntel Whitelist. @@ -18776,6 +20025,15 @@ func (ficpf FrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, erro return json.Marshal(objectMap) } +// GatewayCustomBgpIPAddressIPConfiguration gatewayCustomBgpIpAddressIpConfiguration for a virtual network +// gateway connection. +type GatewayCustomBgpIPAddressIPConfiguration struct { + // IPConfigurationID - The IpconfigurationId of ipconfiguration which belongs to gateway. + IPConfigurationID *string `json:"ipConfigurationId,omitempty"` + // CustomBgpIPAddress - The custom BgpPeeringAddress which belongs to IpconfigurationId. + CustomBgpIPAddress *string `json:"customBgpIpAddress,omitempty"` +} + // GatewayLoadBalancerTunnelInterface gateway load balancer tunnel interface of a load balancer backend // address pool. type GatewayLoadBalancerTunnelInterface struct { @@ -19642,6 +20900,20 @@ func (future *HubVirtualNetworkConnectionsDeleteFuture) result(client HubVirtual return } +// IDPSQueryObject will describe the query to run against the IDPS signatures DB +type IDPSQueryObject struct { + // Filters - Contain all filters names and values + Filters *[]FilterItems `json:"filters,omitempty"` + // Search - Search term in all columns + Search *string `json:"search,omitempty"` + // OrderBy - Column to sort response by + OrderBy *OrderBy `json:"orderBy,omitempty"` + // ResultsPerPage - The number of the results to return in each page + ResultsPerPage *int32 `json:"resultsPerPage,omitempty"` + // Skip - The number of records matching the filter to skip + Skip *int32 `json:"skip,omitempty"` +} + // InboundNatPool inbound NAT pool of the load balancer. type InboundNatPool struct { // InboundNatPoolPropertiesFormat - Properties of load balancer inbound nat pool. @@ -19786,7 +21058,7 @@ func (inppf InboundNatPoolPropertiesFormat) MarshalJSON() ([]byte, error) { // InboundNatRule inbound NAT rule of the load balancer. type InboundNatRule struct { autorest.Response `json:"-"` - // InboundNatRulePropertiesFormat - Properties of load balancer inbound nat rule. + // InboundNatRulePropertiesFormat - Properties of load balancer inbound NAT rule. *InboundNatRulePropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource. Name *string `json:"name,omitempty"` @@ -19876,7 +21148,7 @@ func (inr *InboundNatRule) UnmarshalJSON(body []byte) error { // InboundNatRuleListResult response for ListInboundNatRule API service call. type InboundNatRuleListResult struct { autorest.Response `json:"-"` - // Value - A list of inbound nat rules in a load balancer. + // Value - A list of inbound NAT rules in a load balancer. Value *[]InboundNatRule `json:"value,omitempty"` // NextLink - READ-ONLY; The URL to get the next set of results. NextLink *string `json:"nextLink,omitempty"` @@ -20041,6 +21313,24 @@ func NewInboundNatRuleListResultPage(cur InboundNatRuleListResult, getNextPage f } } +// InboundNatRulePortMapping individual port mappings for inbound NAT rule created for backend pool. +type InboundNatRulePortMapping struct { + // InboundNatRuleName - READ-ONLY; Name of inbound NAT rule. + InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` + // Protocol - READ-ONLY; The reference to the transport protocol used by the inbound NAT rule. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP', 'TransportProtocolAll' + Protocol TransportProtocol `json:"protocol,omitempty"` + // FrontendPort - READ-ONLY; Frontend port. + FrontendPort *int32 `json:"frontendPort,omitempty"` + // BackendPort - READ-ONLY; Backend port. + BackendPort *int32 `json:"backendPort,omitempty"` +} + +// MarshalJSON is the custom marshaler for InboundNatRulePortMapping. +func (inrpm InboundNatRulePortMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // InboundNatRulePropertiesFormat properties of the inbound NAT rule. type InboundNatRulePropertiesFormat struct { // FrontendIPConfiguration - A reference to frontend IP addresses. @@ -20059,6 +21349,12 @@ type InboundNatRulePropertiesFormat struct { EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` // EnableTCPReset - Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. EnableTCPReset *bool `json:"enableTcpReset,omitempty"` + // FrontendPortRangeStart - The port range start for the external endpoint. This property is used together with BackendAddressPool and FrontendPortRangeEnd. Individual inbound NAT rule port mappings will be created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"` + // FrontendPortRangeEnd - The port range end for the external endpoint. This property is used together with BackendAddressPool and FrontendPortRangeStart. Individual inbound NAT rule port mappings will be created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"` + // BackendAddressPool - A reference to backendAddressPool resource. + BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the inbound NAT rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -20087,6 +21383,15 @@ func (inrpf InboundNatRulePropertiesFormat) MarshalJSON() ([]byte, error) { if inrpf.EnableTCPReset != nil { objectMap["enableTcpReset"] = inrpf.EnableTCPReset } + if inrpf.FrontendPortRangeStart != nil { + objectMap["frontendPortRangeStart"] = inrpf.FrontendPortRangeStart + } + if inrpf.FrontendPortRangeEnd != nil { + objectMap["frontendPortRangeEnd"] = inrpf.FrontendPortRangeEnd + } + if inrpf.BackendAddressPool != nil { + objectMap["backendAddressPool"] = inrpf.BackendAddressPool + } return json.Marshal(objectMap) } @@ -21248,6 +22553,8 @@ type InterfacePropertiesFormat struct { MacAddress *string `json:"macAddress,omitempty"` // Primary - READ-ONLY; Whether this is a primary network interface on a virtual machine. Primary *bool `json:"primary,omitempty"` + // VnetEncryptionSupported - READ-ONLY; Whether the virtual machine this nic is attached to supports encryption. + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` // EnableAcceleratedNetworking - If the network interface is accelerated networking enabled. EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` // EnableIPForwarding - Indicates whether IP forwarding is enabled on this network interface. @@ -21268,6 +22575,8 @@ type InterfacePropertiesFormat struct { PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` // MigrationPhase - Migration phase of Network Interface resource. Possible values include: 'InterfaceMigrationPhaseNone', 'InterfaceMigrationPhasePrepare', 'InterfaceMigrationPhaseCommit', 'InterfaceMigrationPhaseAbort', 'InterfaceMigrationPhaseCommitted' MigrationPhase InterfaceMigrationPhase `json:"migrationPhase,omitempty"` + // AuxiliaryMode - Auxiliary mode of Network Interface resource. Possible values include: 'InterfaceAuxiliaryModeNone', 'InterfaceAuxiliaryModeMaxConnections', 'InterfaceAuxiliaryModeFloating' + AuxiliaryMode InterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` } // MarshalJSON is the custom marshaler for InterfacePropertiesFormat. @@ -21300,6 +22609,9 @@ func (ipf InterfacePropertiesFormat) MarshalJSON() ([]byte, error) { if ipf.MigrationPhase != "" { objectMap["migrationPhase"] = ipf.MigrationPhase } + if ipf.AuxiliaryMode != "" { + objectMap["auxiliaryMode"] = ipf.AuxiliaryMode + } return json.Marshal(objectMap) } @@ -23388,6 +24700,166 @@ func NewListP2SVpnGatewaysResultPage(cur ListP2SVpnGatewaysResult, getNextPage f } } +// ListRoutingIntentResult list of the routing intent result and a URL nextLink to get the next set of +// results. +type ListRoutingIntentResult struct { + autorest.Response `json:"-"` + // Value - List of RoutingIntent resource. + Value *[]RoutingIntent `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListRoutingIntentResultIterator provides access to a complete listing of RoutingIntent values. +type ListRoutingIntentResultIterator struct { + i int + page ListRoutingIntentResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListRoutingIntentResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListRoutingIntentResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListRoutingIntentResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListRoutingIntentResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListRoutingIntentResultIterator) Response() ListRoutingIntentResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListRoutingIntentResultIterator) Value() RoutingIntent { + if !iter.page.NotDone() { + return RoutingIntent{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListRoutingIntentResultIterator type. +func NewListRoutingIntentResultIterator(page ListRoutingIntentResultPage) ListRoutingIntentResultIterator { + return ListRoutingIntentResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lrir ListRoutingIntentResult) IsEmpty() bool { + return lrir.Value == nil || len(*lrir.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lrir ListRoutingIntentResult) hasNextLink() bool { + return lrir.NextLink != nil && len(*lrir.NextLink) != 0 +} + +// listRoutingIntentResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lrir ListRoutingIntentResult) listRoutingIntentResultPreparer(ctx context.Context) (*http.Request, error) { + if !lrir.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lrir.NextLink))) +} + +// ListRoutingIntentResultPage contains a page of RoutingIntent values. +type ListRoutingIntentResultPage struct { + fn func(context.Context, ListRoutingIntentResult) (ListRoutingIntentResult, error) + lrir ListRoutingIntentResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListRoutingIntentResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListRoutingIntentResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lrir) + if err != nil { + return err + } + page.lrir = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListRoutingIntentResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListRoutingIntentResultPage) NotDone() bool { + return !page.lrir.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListRoutingIntentResultPage) Response() ListRoutingIntentResult { + return page.lrir +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListRoutingIntentResultPage) Values() []RoutingIntent { + if page.lrir.IsEmpty() { + return nil + } + return *page.lrir.Value +} + +// Creates a new instance of the ListRoutingIntentResultPage type. +func NewListRoutingIntentResultPage(cur ListRoutingIntentResult, getNextPage func(context.Context, ListRoutingIntentResult) (ListRoutingIntentResult, error)) ListRoutingIntentResultPage { + return ListRoutingIntentResultPage{ + fn: getNextPage, + lrir: cur, + } +} + // ListString ... type ListString struct { autorest.Response `json:"-"` @@ -24836,6 +26308,169 @@ func NewListVpnGatewaysResultPage(cur ListVpnGatewaysResult, getNextPage func(co } } +// ListVpnServerConfigurationPolicyGroupsResult result of the request to list +// VpnServerConfigurationPolicyGroups. It contains a list of VpnServerConfigurationPolicyGroups and a URL +// nextLink to get the next set of results. +type ListVpnServerConfigurationPolicyGroupsResult struct { + autorest.Response `json:"-"` + // Value - List of VpnServerConfigurationPolicyGroups. + Value *[]VpnServerConfigurationPolicyGroup `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListVpnServerConfigurationPolicyGroupsResultIterator provides access to a complete listing of +// VpnServerConfigurationPolicyGroup values. +type ListVpnServerConfigurationPolicyGroupsResultIterator struct { + i int + page ListVpnServerConfigurationPolicyGroupsResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListVpnServerConfigurationPolicyGroupsResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnServerConfigurationPolicyGroupsResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListVpnServerConfigurationPolicyGroupsResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListVpnServerConfigurationPolicyGroupsResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListVpnServerConfigurationPolicyGroupsResultIterator) Response() ListVpnServerConfigurationPolicyGroupsResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListVpnServerConfigurationPolicyGroupsResultIterator) Value() VpnServerConfigurationPolicyGroup { + if !iter.page.NotDone() { + return VpnServerConfigurationPolicyGroup{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListVpnServerConfigurationPolicyGroupsResultIterator type. +func NewListVpnServerConfigurationPolicyGroupsResultIterator(page ListVpnServerConfigurationPolicyGroupsResultPage) ListVpnServerConfigurationPolicyGroupsResultIterator { + return ListVpnServerConfigurationPolicyGroupsResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lvscpgr ListVpnServerConfigurationPolicyGroupsResult) IsEmpty() bool { + return lvscpgr.Value == nil || len(*lvscpgr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lvscpgr ListVpnServerConfigurationPolicyGroupsResult) hasNextLink() bool { + return lvscpgr.NextLink != nil && len(*lvscpgr.NextLink) != 0 +} + +// listVpnServerConfigurationPolicyGroupsResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lvscpgr ListVpnServerConfigurationPolicyGroupsResult) listVpnServerConfigurationPolicyGroupsResultPreparer(ctx context.Context) (*http.Request, error) { + if !lvscpgr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lvscpgr.NextLink))) +} + +// ListVpnServerConfigurationPolicyGroupsResultPage contains a page of VpnServerConfigurationPolicyGroup +// values. +type ListVpnServerConfigurationPolicyGroupsResultPage struct { + fn func(context.Context, ListVpnServerConfigurationPolicyGroupsResult) (ListVpnServerConfigurationPolicyGroupsResult, error) + lvscpgr ListVpnServerConfigurationPolicyGroupsResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListVpnServerConfigurationPolicyGroupsResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnServerConfigurationPolicyGroupsResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lvscpgr) + if err != nil { + return err + } + page.lvscpgr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListVpnServerConfigurationPolicyGroupsResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListVpnServerConfigurationPolicyGroupsResultPage) NotDone() bool { + return !page.lvscpgr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListVpnServerConfigurationPolicyGroupsResultPage) Response() ListVpnServerConfigurationPolicyGroupsResult { + return page.lvscpgr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListVpnServerConfigurationPolicyGroupsResultPage) Values() []VpnServerConfigurationPolicyGroup { + if page.lvscpgr.IsEmpty() { + return nil + } + return *page.lvscpgr.Value +} + +// Creates a new instance of the ListVpnServerConfigurationPolicyGroupsResultPage type. +func NewListVpnServerConfigurationPolicyGroupsResultPage(cur ListVpnServerConfigurationPolicyGroupsResult, getNextPage func(context.Context, ListVpnServerConfigurationPolicyGroupsResult) (ListVpnServerConfigurationPolicyGroupsResult, error)) ListVpnServerConfigurationPolicyGroupsResultPage { + return ListVpnServerConfigurationPolicyGroupsResultPage{ + fn: getNextPage, + lvscpgr: cur, + } +} + // ListVpnServerConfigurationsResult result of the request to list all VpnServerConfigurations. It contains // a list of VpnServerConfigurations and a URL nextLink to get the next set of results. type ListVpnServerConfigurationsResult struct { @@ -25935,6 +27570,10 @@ type LoadBalancerBackendAddressPropertiesFormat struct { NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` // LoadBalancerFrontendIPConfiguration - Reference to the frontend ip address configuration defined in regional loadbalancer. LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` + // InboundNatRulesPortMapping - READ-ONLY; Collection of inbound NAT rule port mappings. + InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` + // AdminState - A list of administrative states which once set can override health probe so that Load Balancer will always forward new connections to backend, or deny new connections and reset existing connections. Possible values include: 'LoadBalancerBackendAddressAdminStateNone', 'LoadBalancerBackendAddressAdminStateUp', 'LoadBalancerBackendAddressAdminStateDown', 'LoadBalancerBackendAddressAdminStateDrain' + AdminState LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` } // MarshalJSON is the custom marshaler for LoadBalancerBackendAddressPropertiesFormat. @@ -25952,6 +27591,9 @@ func (lbbapf LoadBalancerBackendAddressPropertiesFormat) MarshalJSON() ([]byte, if lbbapf.LoadBalancerFrontendIPConfiguration != nil { objectMap["loadBalancerFrontendIPConfiguration"] = lbbapf.LoadBalancerFrontendIPConfiguration } + if lbbapf.AdminState != "" { + objectMap["adminState"] = lbbapf.AdminState + } return json.Marshal(objectMap) } @@ -26809,7 +28451,7 @@ type LoadBalancerPropertiesFormat struct { Probes *[]Probe `json:"probes,omitempty"` // InboundNatRules - Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"` - // InboundNatPools - Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. + // InboundNatPools - Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound NAT rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"` // OutboundRules - The outbound rules. OutboundRules *[]OutboundRule `json:"outboundRules,omitempty"` @@ -26934,6 +28576,49 @@ type LoadBalancerSku struct { Tier LoadBalancerSkuTier `json:"tier,omitempty"` } +// LoadBalancersListInboundNatRulePortMappingsFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type LoadBalancersListInboundNatRulePortMappingsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LoadBalancersClient) (BackendAddressInboundNatRulePortMappings, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LoadBalancersListInboundNatRulePortMappingsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LoadBalancersListInboundNatRulePortMappingsFuture.Result. +func (future *LoadBalancersListInboundNatRulePortMappingsFuture) result(client LoadBalancersClient) (bainrpm BackendAddressInboundNatRulePortMappings, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersListInboundNatRulePortMappingsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + bainrpm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.LoadBalancersListInboundNatRulePortMappingsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if bainrpm.Response.Response, err = future.GetResult(sender); err == nil && bainrpm.Response.Response.StatusCode != http.StatusNoContent { + bainrpm, err = client.ListInboundNatRulePortMappingsResponder(bainrpm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersListInboundNatRulePortMappingsFuture", "Result", bainrpm.Response.Response, "Failure responding to request") + } + } + return +} + // LoadBalancersSwapPublicIPAddressesFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type LoadBalancersSwapPublicIPAddressesFuture struct { @@ -28251,6 +29936,16 @@ func (nr NatRule) AsBasicFirewallPolicyRule() (BasicFirewallPolicyRule, bool) { return &nr, true } +// NatRulePortMapping individual port mappings for inbound NAT rule created for backend pool. +type NatRulePortMapping struct { + // InboundNatRuleName - Name of inbound NAT rule. + InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` + // FrontendPort - Frontend port. + FrontendPort *int32 `json:"frontendPort,omitempty"` + // BackendPort - Backend port. + BackendPort *int32 `json:"backendPort,omitempty"` +} + // NatRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type NatRulesCreateOrUpdateFuture struct { @@ -28643,6 +30338,14 @@ type OperationPropertiesFormatServiceSpecification struct { LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` } +// OrderBy describes a column to sort +type OrderBy struct { + // Field - Describes the actual column name to sort by + Field *string `json:"field,omitempty"` + // Order - Describes if results should be in ascending/descending order. Possible values include: 'FirewallPolicyIDPSQuerySortOrderAscending', 'FirewallPolicyIDPSQuerySortOrderDescending' + Order FirewallPolicyIDPSQuerySortOrder `json:"order,omitempty"` +} + // OutboundRule outbound rule of the load balancer. type OutboundRule struct { autorest.Response `json:"-"` @@ -28777,12 +30480,14 @@ func (orpf OutboundRulePropertiesFormat) MarshalJSON() ([]byte, error) { // OwaspCrsExclusionEntry allow to exclude some variable satisfy the condition for the WAF check. type OwaspCrsExclusionEntry struct { - // MatchVariable - The variable to be excluded. Possible values include: 'OwaspCrsExclusionEntryMatchVariableRequestHeaderNames', 'OwaspCrsExclusionEntryMatchVariableRequestCookieNames', 'OwaspCrsExclusionEntryMatchVariableRequestArgNames' + // MatchVariable - The variable to be excluded. Possible values include: 'OwaspCrsExclusionEntryMatchVariableRequestHeaderNames', 'OwaspCrsExclusionEntryMatchVariableRequestCookieNames', 'OwaspCrsExclusionEntryMatchVariableRequestArgNames', 'OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys', 'OwaspCrsExclusionEntryMatchVariableRequestHeaderValues', 'OwaspCrsExclusionEntryMatchVariableRequestCookieKeys', 'OwaspCrsExclusionEntryMatchVariableRequestCookieValues', 'OwaspCrsExclusionEntryMatchVariableRequestArgKeys', 'OwaspCrsExclusionEntryMatchVariableRequestArgValues' MatchVariable OwaspCrsExclusionEntryMatchVariable `json:"matchVariable,omitempty"` // SelectorMatchOperator - When matchVariable is a collection, operate on the selector to specify which elements in the collection this exclusion applies to. Possible values include: 'OwaspCrsExclusionEntrySelectorMatchOperatorEquals', 'OwaspCrsExclusionEntrySelectorMatchOperatorContains', 'OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith', 'OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith', 'OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny' SelectorMatchOperator OwaspCrsExclusionEntrySelectorMatchOperator `json:"selectorMatchOperator,omitempty"` // Selector - When matchVariable is a collection, operator used to specify which elements in the collection this exclusion applies to. Selector *string `json:"selector,omitempty"` + // ExclusionManagedRuleSets - The managed rule sets that are associated with the exclusion. + ExclusionManagedRuleSets *[]ExclusionManagedRuleSet `json:"exclusionManagedRuleSets,omitempty"` } // P2SConnectionConfiguration p2SConnectionConfiguration Resource. @@ -28871,6 +30576,10 @@ type P2SConnectionConfigurationProperties struct { RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` // EnableInternetSecurity - Flag indicating whether the enable internet security flag is turned on for the P2S Connections or not. EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` + // ConfigurationPolicyGroupAssociations - READ-ONLY; List of Configuration Policy Groups that this P2SConnectionConfiguration is attached to. + ConfigurationPolicyGroupAssociations *[]SubResource `json:"configurationPolicyGroupAssociations,omitempty"` + // PreviousConfigurationPolicyGroupAssociations - READ-ONLY; List of previous Configuration Policy Groups that this P2SConnectionConfiguration was attached to. + PreviousConfigurationPolicyGroupAssociations *[]VpnServerConfigurationPolicyGroup `json:"previousConfigurationPolicyGroupAssociations,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the P2SConnectionConfiguration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -31135,6 +32844,91 @@ func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// PrivateEndpointIPConfiguration an IP Configuration of the private endpoint. +type PrivateEndpointIPConfiguration struct { + // PrivateEndpointIPConfigurationProperties - Properties of private endpoint IP configurations. + *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` + // Name - The name of the resource that is unique within a resource group. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointIPConfiguration. +func (peic PrivateEndpointIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if peic.PrivateEndpointIPConfigurationProperties != nil { + objectMap["properties"] = peic.PrivateEndpointIPConfigurationProperties + } + if peic.Name != nil { + objectMap["name"] = peic.Name + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointIPConfiguration struct. +func (peic *PrivateEndpointIPConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateEndpointIPConfigurationProperties PrivateEndpointIPConfigurationProperties + err = json.Unmarshal(*v, &privateEndpointIPConfigurationProperties) + if err != nil { + return err + } + peic.PrivateEndpointIPConfigurationProperties = &privateEndpointIPConfigurationProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + peic.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + peic.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + peic.Etag = &etag + } + } + } + + return nil +} + +// PrivateEndpointIPConfigurationProperties properties of an IP Configuration of the private endpoint. +type PrivateEndpointIPConfigurationProperties struct { + // GroupID - The ID of a group obtained from the remote resource that this private endpoint should connect to. + GroupID *string `json:"groupId,omitempty"` + // MemberName - The member name of a group obtained from the remote resource that this private endpoint should connect to. + MemberName *string `json:"memberName,omitempty"` + // PrivateIPAddress - A private ip address obtained from the private endpoint's subnet. + PrivateIPAddress *string `json:"privateIPAddress,omitempty"` +} + // PrivateEndpointListResult response for the ListPrivateEndpoints API service call. type PrivateEndpointListResult struct { autorest.Response `json:"-"` @@ -31317,6 +33111,12 @@ type PrivateEndpointProperties struct { ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` // CustomDNSConfigs - An array of custom dns configurations. CustomDNSConfigs *[]CustomDNSConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` + // ApplicationSecurityGroups - Application security groups in which the private endpoint IP configuration is included. + ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` + // IPConfigurations - A list of IP configurations of the private endpoint. This will be used to map to the First Party Service's endpoints. + IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` + // CustomNetworkInterfaceName - The custom name of the network interface attached to the private endpoint. + CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` } // MarshalJSON is the custom marshaler for PrivateEndpointProperties. @@ -31334,6 +33134,15 @@ func (pep PrivateEndpointProperties) MarshalJSON() ([]byte, error) { if pep.CustomDNSConfigs != nil { objectMap["customDnsConfigs"] = pep.CustomDNSConfigs } + if pep.ApplicationSecurityGroups != nil { + objectMap["applicationSecurityGroups"] = pep.ApplicationSecurityGroups + } + if pep.IPConfigurations != nil { + objectMap["ipConfigurations"] = pep.IPConfigurations + } + if pep.CustomNetworkInterfaceName != nil { + objectMap["customNetworkInterfaceName"] = pep.CustomNetworkInterfaceName + } return json.Marshal(objectMap) } @@ -33759,6 +35568,23 @@ func (future *PutBastionShareableLinkFuture) result(client BaseClient) (bsllrp B return } +// QosDefinition quality of Service defines the traffic configuration between endpoints. Mandatory to have +// one marking. +type QosDefinition struct { + // Markings - List of markings to be used in the configuration. + Markings *[]int32 `json:"markings,omitempty"` + // SourceIPRanges - Source IP ranges. + SourceIPRanges *[]QosIPRange `json:"sourceIpRanges,omitempty"` + // DestinationIPRanges - Destination IP ranges. + DestinationIPRanges *[]QosIPRange `json:"destinationIpRanges,omitempty"` + // SourcePortRanges - Sources port ranges. + SourcePortRanges *[]QosPortRange `json:"sourcePortRanges,omitempty"` + // DestinationPortRanges - Destination port ranges. + DestinationPortRanges *[]QosPortRange `json:"destinationPortRanges,omitempty"` + // Protocol - RNM supported protocol types. Possible values include: 'ProtocolTypeDoNotUse', 'ProtocolTypeIcmp', 'ProtocolTypeTCP', 'ProtocolTypeUDP', 'ProtocolTypeGre', 'ProtocolTypeEsp', 'ProtocolTypeAh', 'ProtocolTypeVxlan', 'ProtocolTypeAll' + Protocol ProtocolType `json:"protocol,omitempty"` +} + // QosIPRange qos Traffic Profiler IP Range properties. type QosIPRange struct { // StartIP - Start IP Address. @@ -33775,6 +35601,24 @@ type QosPortRange struct { End *int32 `json:"end,omitempty"` } +// QueryInboundNatRulePortMappingRequest the request for a QueryInboundNatRulePortMapping API. Either +// IpConfiguration or IpAddress should be set +type QueryInboundNatRulePortMappingRequest struct { + // IPConfiguration - NetworkInterfaceIPConfiguration set in load balancer backend address. + IPConfiguration *SubResource `json:"ipConfiguration,omitempty"` + // IPAddress - IP address set in load balancer backend address. + IPAddress *string `json:"ipAddress,omitempty"` +} + +// QueryResults query result +type QueryResults struct { + autorest.Response `json:"-"` + // MatchingRecordsCount - Number of total records matching the query. + MatchingRecordsCount *int64 `json:"matchingRecordsCount,omitempty"` + // Signatures - Array containing the results of the query + Signatures *[]SingleQueryResult `json:"signatures,omitempty"` +} + // QueryTroubleshootingParameters parameters that define the resource to query the troubleshooting result. type QueryTroubleshootingParameters struct { // TargetResourceID - The target resource ID to query the troubleshooting result. @@ -35494,6 +37338,203 @@ type RoutingConfiguration struct { VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` } +// RoutingIntent the routing intent child resource of a Virtual hub. +type RoutingIntent struct { + autorest.Response `json:"-"` + // RoutingIntentProperties - Properties of the RoutingIntent resource. + *RoutingIntentProperties `json:"properties,omitempty"` + // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for RoutingIntent. +func (ri RoutingIntent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ri.RoutingIntentProperties != nil { + objectMap["properties"] = ri.RoutingIntentProperties + } + if ri.Name != nil { + objectMap["name"] = ri.Name + } + if ri.ID != nil { + objectMap["id"] = ri.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RoutingIntent struct. +func (ri *RoutingIntent) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var routingIntentProperties RoutingIntentProperties + err = json.Unmarshal(*v, &routingIntentProperties) + if err != nil { + return err + } + ri.RoutingIntentProperties = &routingIntentProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ri.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + ri.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ri.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ri.ID = &ID + } + } + } + + return nil +} + +// RoutingIntentCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type RoutingIntentCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RoutingIntentClient) (RoutingIntent, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RoutingIntentCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RoutingIntentCreateOrUpdateFuture.Result. +func (future *RoutingIntentCreateOrUpdateFuture) result(client RoutingIntentClient) (ri RoutingIntent, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutingIntentCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ri.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.RoutingIntentCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ri.Response.Response, err = future.GetResult(sender); err == nil && ri.Response.Response.StatusCode != http.StatusNoContent { + ri, err = client.CreateOrUpdateResponder(ri.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutingIntentCreateOrUpdateFuture", "Result", ri.Response.Response, "Failure responding to request") + } + } + return +} + +// RoutingIntentDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RoutingIntentDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RoutingIntentClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RoutingIntentDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RoutingIntentDeleteFuture.Result. +func (future *RoutingIntentDeleteFuture) result(client RoutingIntentClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutingIntentDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.RoutingIntentDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// RoutingIntentProperties the properties of a RoutingIntent resource. +type RoutingIntentProperties struct { + // RoutingPolicies - List of routing policies. + RoutingPolicies *[]RoutingPolicy `json:"routingPolicies,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the RoutingIntent resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for RoutingIntentProperties. +func (rip RoutingIntentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rip.RoutingPolicies != nil { + objectMap["routingPolicies"] = rip.RoutingPolicies + } + return json.Marshal(objectMap) +} + +// RoutingPolicy the routing policy object used in a RoutingIntent resource. +type RoutingPolicy struct { + // Name - The unique name for the routing policy. + Name *string `json:"name,omitempty"` + // Destinations - List of all destinations which this routing policy is applicable to (for example: Internet, PrivateTraffic). + Destinations *[]string `json:"destinations,omitempty"` + // NextHop - The next hop resource id on which this routing policy is applicable to. + NextHop *string `json:"nextHop,omitempty"` +} + // Rule rule of type network. type Rule struct { // IPProtocols - Array of FirewallPolicyRuleNetworkProtocols. @@ -37199,6 +39240,8 @@ type ServiceEndpointPolicyDefinition struct { Name *string `json:"name,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` } @@ -37212,6 +39255,9 @@ func (sepd ServiceEndpointPolicyDefinition) MarshalJSON() ([]byte, error) { if sepd.Name != nil { objectMap["name"] = sepd.Name } + if sepd.Type != nil { + objectMap["type"] = sepd.Type + } if sepd.ID != nil { objectMap["id"] = sepd.ID } @@ -37254,6 +39300,15 @@ func (sepd *ServiceEndpointPolicyDefinition) UnmarshalJSON(body []byte) error { } sepd.Etag = &etag } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sepd.Type = &typeVar + } case "id": if v != nil { var ID string @@ -37716,6 +39771,10 @@ type ServiceEndpointPolicyPropertiesFormat struct { ResourceGUID *string `json:"resourceGuid,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the service endpoint policy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ServiceAlias - The alias indicating if the policy belongs to a service + ServiceAlias *string `json:"serviceAlias,omitempty"` + // ContextualServiceEndpointPolicies - A collection of contextual service endpoint policy. + ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` } // MarshalJSON is the custom marshaler for ServiceEndpointPolicyPropertiesFormat. @@ -37724,6 +39783,12 @@ func (seppf ServiceEndpointPolicyPropertiesFormat) MarshalJSON() ([]byte, error) if seppf.ServiceEndpointPolicyDefinitions != nil { objectMap["serviceEndpointPolicyDefinitions"] = seppf.ServiceEndpointPolicyDefinitions } + if seppf.ServiceAlias != nil { + objectMap["serviceAlias"] = seppf.ServiceAlias + } + if seppf.ContextualServiceEndpointPolicies != nil { + objectMap["contextualServiceEndpointPolicies"] = seppf.ContextualServiceEndpointPolicies + } return json.Marshal(objectMap) } @@ -37757,6 +39822,8 @@ type ServiceTagInformation struct { Name *string `json:"name,omitempty"` // ID - READ-ONLY; The ID of service tag. ID *string `json:"id,omitempty"` + // ServiceTagChangeNumber - READ-ONLY; The iteration number of service tag object for region. + ServiceTagChangeNumber *string `json:"serviceTagChangeNumber,omitempty"` } // MarshalJSON is the custom marshaler for ServiceTagInformation. @@ -37765,6 +39832,176 @@ func (sti ServiceTagInformation) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// ServiceTagInformationListResult response for Get ServiceTagInformation API service call. Retrieves the +// list of service tag information resources. +type ServiceTagInformationListResult struct { + autorest.Response `json:"-"` + // Value - The list of service tag information resources. + Value *[]ServiceTagInformation `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceTagInformationListResult. +func (stilr ServiceTagInformationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if stilr.Value != nil { + objectMap["value"] = stilr.Value + } + return json.Marshal(objectMap) +} + +// ServiceTagInformationListResultIterator provides access to a complete listing of ServiceTagInformation +// values. +type ServiceTagInformationListResultIterator struct { + i int + page ServiceTagInformationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ServiceTagInformationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceTagInformationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ServiceTagInformationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServiceTagInformationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ServiceTagInformationListResultIterator) Response() ServiceTagInformationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ServiceTagInformationListResultIterator) Value() ServiceTagInformation { + if !iter.page.NotDone() { + return ServiceTagInformation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServiceTagInformationListResultIterator type. +func NewServiceTagInformationListResultIterator(page ServiceTagInformationListResultPage) ServiceTagInformationListResultIterator { + return ServiceTagInformationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (stilr ServiceTagInformationListResult) IsEmpty() bool { + return stilr.Value == nil || len(*stilr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (stilr ServiceTagInformationListResult) hasNextLink() bool { + return stilr.NextLink != nil && len(*stilr.NextLink) != 0 +} + +// serviceTagInformationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (stilr ServiceTagInformationListResult) serviceTagInformationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !stilr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(stilr.NextLink))) +} + +// ServiceTagInformationListResultPage contains a page of ServiceTagInformation values. +type ServiceTagInformationListResultPage struct { + fn func(context.Context, ServiceTagInformationListResult) (ServiceTagInformationListResult, error) + stilr ServiceTagInformationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ServiceTagInformationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceTagInformationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.stilr) + if err != nil { + return err + } + page.stilr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ServiceTagInformationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServiceTagInformationListResultPage) NotDone() bool { + return !page.stilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServiceTagInformationListResultPage) Response() ServiceTagInformationListResult { + return page.stilr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServiceTagInformationListResultPage) Values() []ServiceTagInformation { + if page.stilr.IsEmpty() { + return nil + } + return *page.stilr.Value +} + +// Creates a new instance of the ServiceTagInformationListResultPage type. +func NewServiceTagInformationListResultPage(cur ServiceTagInformationListResult, getNextPage func(context.Context, ServiceTagInformationListResult) (ServiceTagInformationListResult, error)) ServiceTagInformationListResultPage { + return ServiceTagInformationListResultPage{ + fn: getNextPage, + stilr: cur, + } +} + // ServiceTagInformationPropertiesFormat properties of the service tag information. type ServiceTagInformationPropertiesFormat struct { // ChangeNumber - READ-ONLY; The iteration number of service tag. @@ -37816,6 +40053,81 @@ type SessionIds struct { SessionIds *[]string `json:"sessionIds,omitempty"` } +// SignatureOverridesFilterValuesQuery describes the filter values possibles for a given column +type SignatureOverridesFilterValuesQuery struct { + // FilterName - Describes the name of the column which values will be returned + FilterName *string `json:"filterName,omitempty"` +} + +// SignatureOverridesFilterValuesResponse describes the list of all possible values for a specific filter +// value +type SignatureOverridesFilterValuesResponse struct { + autorest.Response `json:"-"` + // FilterValues - Describes the possible values + FilterValues *[]string `json:"filterValues,omitempty"` +} + +// SignaturesOverrides contains all specific policy signatures overrides for the IDPS +type SignaturesOverrides struct { + autorest.Response `json:"-"` + // Name - Contains the name of the resource (default) + Name *string `json:"name,omitempty"` + // ID - Will contain the resource id of the signature override resource + ID *string `json:"id,omitempty"` + // Type - Will contain the type of the resource: Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides + Type *string `json:"type,omitempty"` + // Properties - Will contain the properties of the resource (the actual signature overrides) + Properties *SignaturesOverridesProperties `json:"properties,omitempty"` +} + +// SignaturesOverridesList describes an object containing an array with a single item +type SignaturesOverridesList struct { + autorest.Response `json:"-"` + // Value - Describes a list consisting exactly one item describing the policy's signature override status + Value *[]SignaturesOverrides `json:"value,omitempty"` +} + +// SignaturesOverridesProperties will contain the properties of the resource (the actual signature +// overrides) +type SignaturesOverridesProperties struct { + Signatures map[string]*string `json:"signatures"` +} + +// MarshalJSON is the custom marshaler for SignaturesOverridesProperties. +func (so SignaturesOverridesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if so.Signatures != nil { + objectMap["signatures"] = so.Signatures + } + return json.Marshal(objectMap) +} + +// SingleQueryResult ... +type SingleQueryResult struct { + // SignatureID - The ID of the signature + SignatureID *int32 `json:"signatureId,omitempty"` + // Mode - The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny + Mode *int32 `json:"mode,omitempty"` + // Severity - Describes the severity of signature: 1 - Low, 2 - Medium, 3 - High + Severity *int32 `json:"severity,omitempty"` + // Direction - Describes in which direction signature is being enforced: 0 - Inbound, 1 - OutBound, 2 - Bidirectional + Direction *int32 `json:"direction,omitempty"` + // Group - Describes the groups the signature belongs to + Group *string `json:"group,omitempty"` + // Description - Describes what is the signature enforces + Description *string `json:"description,omitempty"` + // Protocol - Describes the protocol the signatures is being enforced in + Protocol *string `json:"protocol,omitempty"` + // SourcePorts - Describes the list of source ports related to this signature + SourcePorts *[]string `json:"sourcePorts,omitempty"` + // DestinationPorts - Describes the list of destination ports related to this signature + DestinationPorts *[]string `json:"destinationPorts,omitempty"` + // LastUpdated - Describes the last updated time of the signature (provided from 3rd party vendor) + LastUpdated *string `json:"lastUpdated,omitempty"` + // InheritedFromParentPolicy - Describes if this override is inherited from base policy or not + InheritedFromParentPolicy *bool `json:"inheritedFromParentPolicy,omitempty"` +} + // Sku the sku of this Bastion Host. type Sku struct { // Name - The name of this Bastion Host. Possible values include: 'BastionHostSkuNameBasic', 'BastionHostSkuNameStandard' @@ -39123,6 +41435,8 @@ type VirtualAppliancePropertiesFormat struct { CloudInitConfiguration *string `json:"cloudInitConfiguration,omitempty"` // VirtualApplianceAsn - VirtualAppliance ASN. VirtualApplianceAsn *int64 `json:"virtualApplianceAsn,omitempty"` + // SSHPublicKey - Public key for SSH login. + SSHPublicKey *string `json:"sshPublicKey,omitempty"` // VirtualApplianceNics - READ-ONLY; List of Virtual Appliance Network Interfaces. VirtualApplianceNics *[]VirtualApplianceNicProperties `json:"virtualApplianceNics,omitempty"` // VirtualApplianceSites - READ-ONLY; List of references to VirtualApplianceSite. @@ -39154,6 +41468,9 @@ func (vapf VirtualAppliancePropertiesFormat) MarshalJSON() ([]byte, error) { if vapf.VirtualApplianceAsn != nil { objectMap["virtualApplianceAsn"] = vapf.VirtualApplianceAsn } + if vapf.SSHPublicKey != nil { + objectMap["sshPublicKey"] = vapf.SSHPublicKey + } return json.Marshal(objectMap) } @@ -39914,6 +42231,8 @@ type VirtualHub struct { *VirtualHubProperties `json:"properties,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // Kind - READ-ONLY; Kind of service virtual hub. This is metadata used for the Azure portal experience for Route Server. + Kind *string `json:"kind,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -39971,6 +42290,15 @@ func (vh *VirtualHub) UnmarshalJSON(body []byte) error { } vh.Etag = &etag } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + vh.Kind = &kind + } case "id": if v != nil { var ID string @@ -40334,6 +42662,8 @@ type VirtualHubProperties struct { AllowBranchToBranchTraffic *bool `json:"allowBranchToBranchTraffic,omitempty"` // PreferredRoutingGateway - The preferred gateway to route on-prem traffic. Possible values include: 'PreferredRoutingGatewayExpressRoute', 'PreferredRoutingGatewayVpnGateway', 'PreferredRoutingGatewayNone' PreferredRoutingGateway PreferredRoutingGateway `json:"preferredRoutingGateway,omitempty"` + // HubRoutingPreference - The hubRoutingPreference of this VirtualHub. Possible values include: 'HubRoutingPreferenceExpressRoute', 'HubRoutingPreferenceVpnGateway', 'HubRoutingPreferenceASPath' + HubRoutingPreference HubRoutingPreference `json:"hubRoutingPreference,omitempty"` } // MarshalJSON is the custom marshaler for VirtualHubProperties. @@ -40387,6 +42717,9 @@ func (vhp VirtualHubProperties) MarshalJSON() ([]byte, error) { if vhp.PreferredRoutingGateway != "" { objectMap["preferredRoutingGateway"] = vhp.PreferredRoutingGateway } + if vhp.HubRoutingPreference != "" { + objectMap["hubRoutingPreference"] = vhp.HubRoutingPreference + } return json.Marshal(objectMap) } @@ -40868,6 +43201,15 @@ type VirtualNetworkConnectionGatewayReference struct { ID *string `json:"id,omitempty"` } +// VirtualNetworkEncryption indicates if encryption is enabled on virtual network and if VM without +// encryption is allowed in encrypted VNet. +type VirtualNetworkEncryption struct { + // Enabled - Indicates if encryption is enabled on the virtual network. + Enabled *bool `json:"enabled,omitempty"` + // Enforcement - If the encrypted VNet allows VM that does not support encryption. Possible values include: 'VirtualNetworkEncryptionEnforcementDropUnencrypted', 'VirtualNetworkEncryptionEnforcementAllowUnencrypted' + Enforcement VirtualNetworkEncryptionEnforcement `json:"enforcement,omitempty"` +} + // VirtualNetworkGateway a common class for general resource information. type VirtualNetworkGateway struct { autorest.Response `json:"-"` @@ -41258,6 +43600,8 @@ type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { Peer *SubResource `json:"peer,omitempty"` // EnableBgp - EnableBgp flag. EnableBgp *bool `json:"enableBgp,omitempty"` + // GatewayCustomBgpIPAddresses - GatewayCustomBgpIpAddresses to be used for virtual network gateway Connection. + GatewayCustomBgpIPAddresses *[]GatewayCustomBgpIPAddressIPConfiguration `json:"gatewayCustomBgpIpAddresses,omitempty"` // UsePolicyBasedTrafficSelectors - Enable policy-based traffic selectors. UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` // IpsecPolicies - The IPSec Policies to be considered by this connection. @@ -41308,6 +43652,9 @@ func (vngclepf VirtualNetworkGatewayConnectionListEntityPropertiesFormat) Marsha if vngclepf.EnableBgp != nil { objectMap["enableBgp"] = vngclepf.EnableBgp } + if vngclepf.GatewayCustomBgpIPAddresses != nil { + objectMap["gatewayCustomBgpIpAddresses"] = vngclepf.GatewayCustomBgpIPAddresses + } if vngclepf.UsePolicyBasedTrafficSelectors != nil { objectMap["usePolicyBasedTrafficSelectors"] = vngclepf.UsePolicyBasedTrafficSelectors } @@ -41531,6 +43878,8 @@ type VirtualNetworkGatewayConnectionPropertiesFormat struct { Peer *SubResource `json:"peer,omitempty"` // EnableBgp - EnableBgp flag. EnableBgp *bool `json:"enableBgp,omitempty"` + // GatewayCustomBgpIPAddresses - GatewayCustomBgpIpAddresses to be used for virtual network gateway Connection. + GatewayCustomBgpIPAddresses *[]GatewayCustomBgpIPAddressIPConfiguration `json:"gatewayCustomBgpIpAddresses,omitempty"` // UseLocalAzureIPAddress - Use private local Azure IP for the connection. UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` // UsePolicyBasedTrafficSelectors - Enable policy-based traffic selectors. @@ -41592,6 +43941,9 @@ func (vngcpf VirtualNetworkGatewayConnectionPropertiesFormat) MarshalJSON() ([]b if vngcpf.EnableBgp != nil { objectMap["enableBgp"] = vngcpf.EnableBgp } + if vngcpf.GatewayCustomBgpIPAddresses != nil { + objectMap["gatewayCustomBgpIpAddresses"] = vngcpf.GatewayCustomBgpIPAddresses + } if vngcpf.UseLocalAzureIPAddress != nil { objectMap["useLocalAzureIpAddress"] = vngcpf.UseLocalAzureIPAddress } @@ -42655,6 +45007,8 @@ type VirtualNetworkGatewayPropertiesFormat struct { EnablePrivateIPAddress *bool `json:"enablePrivateIpAddress,omitempty"` // ActiveActive - ActiveActive flag. ActiveActive *bool `json:"activeActive,omitempty"` + // DisableIPSecReplayProtection - disableIPSecReplayProtection flag. + DisableIPSecReplayProtection *bool `json:"disableIPSecReplayProtection,omitempty"` // GatewayDefaultSite - The reference to the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting. GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` // Sku - The reference to the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. @@ -42705,6 +45059,9 @@ func (vngpf VirtualNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) if vngpf.ActiveActive != nil { objectMap["activeActive"] = vngpf.ActiveActive } + if vngpf.DisableIPSecReplayProtection != nil { + objectMap["disableIPSecReplayProtection"] = vngpf.DisableIPSecReplayProtection + } if vngpf.GatewayDefaultSite != nil { objectMap["gatewayDefaultSite"] = vngpf.GatewayDefaultSite } @@ -44070,6 +46427,8 @@ type VirtualNetworkPeeringPropertiesFormat struct { RemoteVirtualNetworkAddressSpace *AddressSpace `json:"remoteVirtualNetworkAddressSpace,omitempty"` // RemoteBgpCommunities - The reference to the remote virtual network's Bgp Communities. RemoteBgpCommunities *VirtualNetworkBgpCommunities `json:"remoteBgpCommunities,omitempty"` + // RemoteVirtualNetworkEncryption - READ-ONLY; The reference to the remote virtual network's encryption + RemoteVirtualNetworkEncryption *VirtualNetworkEncryption `json:"remoteVirtualNetworkEncryption,omitempty"` // PeeringState - The status of the virtual network peering. Possible values include: 'VirtualNetworkPeeringStateInitiated', 'VirtualNetworkPeeringStateConnected', 'VirtualNetworkPeeringStateDisconnected' PeeringState VirtualNetworkPeeringState `json:"peeringState,omitempty"` // PeeringSyncLevel - The peering sync status of the virtual network peering. Possible values include: 'VirtualNetworkPeeringLevelFullyInSync', 'VirtualNetworkPeeringLevelRemoteNotInSync', 'VirtualNetworkPeeringLevelLocalNotInSync', 'VirtualNetworkPeeringLevelLocalAndRemoteNotInSync' @@ -44225,6 +46584,8 @@ type VirtualNetworkPropertiesFormat struct { DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` // BgpCommunities - Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET. BgpCommunities *VirtualNetworkBgpCommunities `json:"bgpCommunities,omitempty"` + // Encryption - Indicates if encryption is enabled on virtual network and if VM without encryption is allowed in encrypted VNet. + Encryption *VirtualNetworkEncryption `json:"encryption,omitempty"` // IPAllocations - Array of IpAllocation which reference this VNET. IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` } @@ -44259,6 +46620,9 @@ func (vnpf VirtualNetworkPropertiesFormat) MarshalJSON() ([]byte, error) { if vnpf.BgpCommunities != nil { objectMap["bgpCommunities"] = vnpf.BgpCommunities } + if vnpf.Encryption != nil { + objectMap["encryption"] = vnpf.Encryption + } if vnpf.IPAllocations != nil { objectMap["ipAllocations"] = vnpf.IPAllocations } @@ -45798,6 +48162,17 @@ func (vVar VM) MarshalJSON() ([]byte, error) { type VnetRoute struct { // StaticRoutes - List of all Static Routes. StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"` + // BgpConnections - READ-ONLY; The list of references to HubBgpConnection objects. + BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` +} + +// MarshalJSON is the custom marshaler for VnetRoute. +func (vr VnetRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vr.StaticRoutes != nil { + objectMap["staticRoutes"] = vr.StaticRoutes + } + return json.Marshal(objectMap) } // VpnClientConfiguration vpnClientConfiguration for P2S client. @@ -46768,6 +49143,8 @@ type VpnGatewayProperties struct { VpnGatewayScaleUnit *int32 `json:"vpnGatewayScaleUnit,omitempty"` // IPConfigurations - READ-ONLY; List of all IPs configured on the gateway. IPConfigurations *[]VpnGatewayIPConfiguration `json:"ipConfigurations,omitempty"` + // EnableBgpRouteTranslationForNat - Enable BGP routes translation for NAT on this VpnGateway. + EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` // IsRoutingPreferenceInternet - Enable Routing Preference property for the Public IP Interface of the VpnGateway. IsRoutingPreferenceInternet *bool `json:"isRoutingPreferenceInternet,omitempty"` // NatRules - List of all the nat Rules associated with the gateway. @@ -46789,6 +49166,9 @@ func (vgp VpnGatewayProperties) MarshalJSON() ([]byte, error) { if vgp.VpnGatewayScaleUnit != nil { objectMap["vpnGatewayScaleUnit"] = vgp.VpnGatewayScaleUnit } + if vgp.EnableBgpRouteTranslationForNat != nil { + objectMap["enableBgpRouteTranslationForNat"] = vgp.EnableBgpRouteTranslationForNat + } if vgp.IsRoutingPreferenceInternet != nil { objectMap["isRoutingPreferenceInternet"] = vgp.IsRoutingPreferenceInternet } @@ -47150,6 +49530,8 @@ type VpnLinkProviderProperties struct { type VpnNatRuleMapping struct { // AddressSpace - Address space for Vpn NatRule mapping. AddressSpace *string `json:"addressSpace,omitempty"` + // PortRange - Port range for Vpn NatRule mapping. + PortRange *string `json:"portRange,omitempty"` } // VpnPacketCaptureStartParameters start packet capture parameters on virtual network gateway. @@ -47304,6 +49686,135 @@ func (vsc *VpnServerConfiguration) UnmarshalJSON(body []byte) error { return nil } +// VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroup Resource. +type VpnServerConfigurationPolicyGroup struct { + autorest.Response `json:"-"` + // VpnServerConfigurationPolicyGroupProperties - Properties of the VpnServerConfigurationPolicyGroup. + *VpnServerConfigurationPolicyGroupProperties `json:"properties,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VpnServerConfigurationPolicyGroup. +func (vscpg VpnServerConfigurationPolicyGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vscpg.VpnServerConfigurationPolicyGroupProperties != nil { + objectMap["properties"] = vscpg.VpnServerConfigurationPolicyGroupProperties + } + if vscpg.Name != nil { + objectMap["name"] = vscpg.Name + } + if vscpg.ID != nil { + objectMap["id"] = vscpg.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VpnServerConfigurationPolicyGroup struct. +func (vscpg *VpnServerConfigurationPolicyGroup) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vpnServerConfigurationPolicyGroupProperties VpnServerConfigurationPolicyGroupProperties + err = json.Unmarshal(*v, &vpnServerConfigurationPolicyGroupProperties) + if err != nil { + return err + } + vscpg.VpnServerConfigurationPolicyGroupProperties = &vpnServerConfigurationPolicyGroupProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vscpg.Etag = &etag + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vscpg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vscpg.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vscpg.ID = &ID + } + } + } + + return nil +} + +// VpnServerConfigurationPolicyGroupMember vpnServerConfiguration PolicyGroup member +type VpnServerConfigurationPolicyGroupMember struct { + // Name - Name of the VpnServerConfigurationPolicyGroupMember. + Name *string `json:"name,omitempty"` + // AttributeType - The Vpn Policy member attribute type. Possible values include: 'VpnPolicyMemberAttributeTypeCertificateGroupID', 'VpnPolicyMemberAttributeTypeAADGroupID', 'VpnPolicyMemberAttributeTypeRadiusAzureGroupID' + AttributeType VpnPolicyMemberAttributeType `json:"attributeType,omitempty"` + // AttributeValue - The value of Attribute used for this VpnServerConfigurationPolicyGroupMember. + AttributeValue *string `json:"attributeValue,omitempty"` +} + +// VpnServerConfigurationPolicyGroupProperties parameters for VpnServerConfigurationPolicyGroup. +type VpnServerConfigurationPolicyGroupProperties struct { + // IsDefault - Shows if this is a Default VpnServerConfigurationPolicyGroup or not. + IsDefault *bool `json:"isDefault,omitempty"` + // Priority - Priority for VpnServerConfigurationPolicyGroup. + Priority *int32 `json:"priority,omitempty"` + // PolicyMembers - Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. + PolicyMembers *[]VpnServerConfigurationPolicyGroupMember `json:"policyMembers,omitempty"` + // P2SConnectionConfigurations - READ-ONLY; List of references to P2SConnectionConfigurations. + P2SConnectionConfigurations *[]SubResource `json:"p2SConnectionConfigurations,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the VpnServerConfigurationPolicyGroup resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for VpnServerConfigurationPolicyGroupProperties. +func (vscpgp VpnServerConfigurationPolicyGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vscpgp.IsDefault != nil { + objectMap["isDefault"] = vscpgp.IsDefault + } + if vscpgp.Priority != nil { + objectMap["priority"] = vscpgp.Priority + } + if vscpgp.PolicyMembers != nil { + objectMap["policyMembers"] = vscpgp.PolicyMembers + } + return json.Marshal(objectMap) +} + // VpnServerConfigurationProperties parameters for VpnServerConfiguration. type VpnServerConfigurationProperties struct { // Name - The name of the VpnServerConfiguration that is unique within a resource group. @@ -47334,6 +49845,8 @@ type VpnServerConfigurationProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` // P2SVpnGateways - READ-ONLY; List of references to P2SVpnGateways. P2SVpnGateways *[]P2SVpnGateway `json:"p2SVpnGateways,omitempty"` + // ConfigurationPolicyGroups - List of all VpnServerConfigurationPolicyGroups. + ConfigurationPolicyGroups *[]VpnServerConfigurationPolicyGroup `json:"configurationPolicyGroups,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` } @@ -47377,6 +49890,9 @@ func (vscp VpnServerConfigurationProperties) MarshalJSON() ([]byte, error) { if vscp.AadAuthenticationParameters != nil { objectMap["aadAuthenticationParameters"] = vscp.AadAuthenticationParameters } + if vscp.ConfigurationPolicyGroups != nil { + objectMap["configurationPolicyGroups"] = vscp.ConfigurationPolicyGroups + } return json.Marshal(objectMap) } @@ -47857,6 +50373,8 @@ type VpnSiteLinkConnectionProperties struct { SharedKey *string `json:"sharedKey,omitempty"` // EnableBgp - EnableBgp flag. EnableBgp *bool `json:"enableBgp,omitempty"` + // VpnGatewayCustomBgpAddresses - vpnGatewayCustomBgpAddresses used by this connection. + VpnGatewayCustomBgpAddresses *[]GatewayCustomBgpIPAddressIPConfiguration `json:"vpnGatewayCustomBgpAddresses,omitempty"` // UsePolicyBasedTrafficSelectors - Enable policy-based traffic selectors. UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` // IpsecPolicies - The IPSec Policies to be considered by this connection. @@ -47900,6 +50418,9 @@ func (vslcp VpnSiteLinkConnectionProperties) MarshalJSON() ([]byte, error) { if vslcp.EnableBgp != nil { objectMap["enableBgp"] = vslcp.EnableBgp } + if vslcp.VpnGatewayCustomBgpAddresses != nil { + objectMap["vpnGatewayCustomBgpAddresses"] = vslcp.VpnGatewayCustomBgpAddresses + } if vslcp.UsePolicyBasedTrafficSelectors != nil { objectMap["usePolicyBasedTrafficSelectors"] = vslcp.UsePolicyBasedTrafficSelectors } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/natgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/natgateways.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/natgateways.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/natgateways.go index 86f1705cc808..83c7d146cab1 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/natgateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/natgateways.go @@ -69,7 +69,7 @@ func (client NatGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client NatGatewaysClient) DeletePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client NatGatewaysClient) GetPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -319,7 +319,7 @@ func (client NatGatewaysClient) ListPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client NatGatewaysClient) ListAllPreparer(ctx context.Context) (*http.Requ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -546,7 +546,7 @@ func (client NatGatewaysClient) UpdateTagsPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/natrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/natrules.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/natrules.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/natrules.go index e7fbe5c3c6d6..cff3437cc005 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/natrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/natrules.go @@ -71,7 +71,7 @@ func (client NatRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -156,7 +156,7 @@ func (client NatRulesClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -243,7 +243,7 @@ func (client NatRulesClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -324,7 +324,7 @@ func (client NatRulesClient) ListByVpnGatewayPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/operations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/operations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/operations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/operations.go index 52514b8c45cd..675cac56998a 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/operations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/operations.go @@ -71,7 +71,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/p2svpngateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/p2svpngateways.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/p2svpngateways.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/p2svpngateways.go index 2e7187fff23e..8c8e673466a1 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/p2svpngateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/p2svpngateways.go @@ -69,7 +69,7 @@ func (client P2sVpnGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client P2sVpnGatewaysClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -231,7 +231,7 @@ func (client P2sVpnGatewaysClient) DisconnectP2sVpnConnectionsPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -312,7 +312,7 @@ func (client P2sVpnGatewaysClient) GenerateVpnProfilePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -400,7 +400,7 @@ func (client P2sVpnGatewaysClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -470,7 +470,7 @@ func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -551,7 +551,7 @@ func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthDetailedPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -639,7 +639,7 @@ func (client P2sVpnGatewaysClient) ListPreparer(ctx context.Context) (*http.Requ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -755,7 +755,7 @@ func (client P2sVpnGatewaysClient) ListByResourceGroupPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -861,7 +861,7 @@ func (client P2sVpnGatewaysClient) ResetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -941,7 +941,7 @@ func (client P2sVpnGatewaysClient) UpdateTagsPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/packetcaptures.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/packetcaptures.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/packetcaptures.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/packetcaptures.go index ab2096e4e614..3e74bd4af098 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/packetcaptures.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/packetcaptures.go @@ -93,7 +93,7 @@ func (client PacketCapturesClient) CreatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -176,7 +176,7 @@ func (client PacketCapturesClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -263,7 +263,7 @@ func (client PacketCapturesClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -334,7 +334,7 @@ func (client PacketCapturesClient) GetStatusPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -420,7 +420,7 @@ func (client PacketCapturesClient) ListPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -491,7 +491,7 @@ func (client PacketCapturesClient) StopPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/peerexpressroutecircuitconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/peerexpressroutecircuitconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/peerexpressroutecircuitconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/peerexpressroutecircuitconnections.go index 0cc5f86ad1d0..09c06f561610 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/peerexpressroutecircuitconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/peerexpressroutecircuitconnections.go @@ -81,7 +81,7 @@ func (client PeerExpressRouteCircuitConnectionsClient) GetPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +164,7 @@ func (client PeerExpressRouteCircuitConnectionsClient) ListPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/privatednszonegroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privatednszonegroups.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/privatednszonegroups.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privatednszonegroups.go index 6a190ee64e1d..b0baed9f4b84 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/privatednszonegroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privatednszonegroups.go @@ -72,7 +72,7 @@ func (client PrivateDNSZoneGroupsClient) CreateOrUpdatePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -156,7 +156,7 @@ func (client PrivateDNSZoneGroupsClient) DeletePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -243,7 +243,7 @@ func (client PrivateDNSZoneGroupsClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -324,7 +324,7 @@ func (client PrivateDNSZoneGroupsClient) ListPreparer(ctx context.Context, priva "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/privateendpoints.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privateendpoints.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/privateendpoints.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privateendpoints.go index 0f33921d6e42..d42061efab6f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/privateendpoints.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privateendpoints.go @@ -70,7 +70,7 @@ func (client PrivateEndpointsClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client PrivateEndpointsClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -238,7 +238,7 @@ func (client PrivateEndpointsClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -320,7 +320,7 @@ func (client PrivateEndpointsClient) ListPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -433,7 +433,7 @@ func (client PrivateEndpointsClient) ListBySubscriptionPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/privatelinkservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privatelinkservices.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/privatelinkservices.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privatelinkservices.go index a99587d3416a..a7610b5b9eb3 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/privatelinkservices.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privatelinkservices.go @@ -68,7 +68,7 @@ func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityPrepare "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -233,7 +233,7 @@ func (client PrivateLinkServicesClient) CreateOrUpdatePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -315,7 +315,7 @@ func (client PrivateLinkServicesClient) DeletePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -395,7 +395,7 @@ func (client PrivateLinkServicesClient) DeletePrivateEndpointConnectionPreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -481,7 +481,7 @@ func (client PrivateLinkServicesClient) GetPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -564,7 +564,7 @@ func (client PrivateLinkServicesClient) GetPrivateEndpointConnectionPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -646,7 +646,7 @@ func (client PrivateLinkServicesClient) ListPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -763,7 +763,7 @@ func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesPrepa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -882,7 +882,7 @@ func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByRes "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -995,7 +995,7 @@ func (client PrivateLinkServicesClient) ListBySubscriptionPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1113,7 +1113,7 @@ func (client PrivateLinkServicesClient) ListPrivateEndpointConnectionsPreparer(c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1230,7 +1230,7 @@ func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnectionPreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/profiles.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/profiles.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/profiles.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/profiles.go index ca0bc2b3143b..b8b34572aced 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/profiles.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/profiles.go @@ -76,7 +76,7 @@ func (client ProfilesClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -148,7 +148,7 @@ func (client ProfilesClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -234,7 +234,7 @@ func (client ProfilesClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -316,7 +316,7 @@ func (client ProfilesClient) ListPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -429,7 +429,7 @@ func (client ProfilesClient) ListAllPreparer(ctx context.Context) (*http.Request "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -543,7 +543,7 @@ func (client ProfilesClient) UpdateTagsPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/publicipaddresses.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/publicipaddresses.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/publicipaddresses.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/publicipaddresses.go index 1416bb9f9dc9..6056b28902b1 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/publicipaddresses.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/publicipaddresses.go @@ -84,7 +84,7 @@ func (client PublicIPAddressesClient) CreateOrUpdatePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -166,7 +166,7 @@ func (client PublicIPAddressesClient) DeletePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -252,7 +252,7 @@ func (client PublicIPAddressesClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -340,7 +340,7 @@ func (client PublicIPAddressesClient) GetCloudServicePublicIPAddressPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -428,7 +428,7 @@ func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddressPr "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -510,7 +510,7 @@ func (client PublicIPAddressesClient) ListPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -623,7 +623,7 @@ func (client PublicIPAddressesClient) ListAllPreparer(ctx context.Context) (*htt "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -741,7 +741,7 @@ func (client PublicIPAddressesClient) ListCloudServicePublicIPAddressesPreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -866,7 +866,7 @@ func (client PublicIPAddressesClient) ListCloudServiceRoleInstancePublicIPAddres "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -985,7 +985,7 @@ func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddresse "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1110,7 +1110,7 @@ func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddres "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1224,7 +1224,7 @@ func (client PublicIPAddressesClient) UpdateTagsPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/publicipprefixes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/publicipprefixes.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/publicipprefixes.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/publicipprefixes.go index 63280a7baa28..5d7a29762114 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/publicipprefixes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/publicipprefixes.go @@ -70,7 +70,7 @@ func (client PublicIPPrefixesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client PublicIPPrefixesClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -238,7 +238,7 @@ func (client PublicIPPrefixesClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -320,7 +320,7 @@ func (client PublicIPPrefixesClient) ListPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -433,7 +433,7 @@ func (client PublicIPPrefixesClient) ListAllPreparer(ctx context.Context) (*http "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -547,7 +547,7 @@ func (client PublicIPPrefixesClient) UpdateTagsPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/resourcenavigationlinks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/resourcenavigationlinks.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/resourcenavigationlinks.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/resourcenavigationlinks.go index a4d52328e9f9..ea9b569fd717 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/resourcenavigationlinks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/resourcenavigationlinks.go @@ -78,7 +78,7 @@ func (client ResourceNavigationLinksClient) ListPreparer(ctx context.Context, re "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/routefilterrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routefilterrules.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/routefilterrules.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routefilterrules.go index 36f2d3e4e432..2f76f810a30f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/routefilterrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routefilterrules.go @@ -82,7 +82,7 @@ func (client RouteFilterRulesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -166,7 +166,7 @@ func (client RouteFilterRulesClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -253,7 +253,7 @@ func (client RouteFilterRulesClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -334,7 +334,7 @@ func (client RouteFilterRulesClient) ListByRouteFilterPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/routefilters.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routefilters.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/routefilters.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routefilters.go index 35fb5bae0b78..b809ebd7944c 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/routefilters.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routefilters.go @@ -69,7 +69,7 @@ func (client RouteFiltersClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client RouteFiltersClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client RouteFiltersClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -316,7 +316,7 @@ func (client RouteFiltersClient) ListPreparer(ctx context.Context) (*http.Reques "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client RouteFiltersClient) ListByResourceGroupPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -546,7 +546,7 @@ func (client RouteFiltersClient) UpdateTagsPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/routes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routes.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/routes.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routes.go index 4ff180534ff3..f189aeebf85c 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/routes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routes.go @@ -71,7 +71,7 @@ func (client RoutesClient) CreateOrUpdatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -155,7 +155,7 @@ func (client RoutesClient) DeletePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -242,7 +242,7 @@ func (client RoutesClient) GetPreparer(ctx context.Context, resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -323,7 +323,7 @@ func (client RoutesClient) ListPreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/routetables.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routetables.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/routetables.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routetables.go index c61fddb9b131..f946c9041b03 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/routetables.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routetables.go @@ -69,7 +69,7 @@ func (client RouteTablesClient) CreateOrUpdatePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client RouteTablesClient) DeletePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client RouteTablesClient) GetPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -319,7 +319,7 @@ func (client RouteTablesClient) ListPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client RouteTablesClient) ListAllPreparer(ctx context.Context) (*http.Requ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -546,7 +546,7 @@ func (client RouteTablesClient) UpdateTagsPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routingintent.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routingintent.go new file mode 100644 index 000000000000..2a3d7fdb8f73 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routingintent.go @@ -0,0 +1,393 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RoutingIntentClient is the network Client +type RoutingIntentClient struct { + BaseClient +} + +// NewRoutingIntentClient creates an instance of the RoutingIntentClient client. +func NewRoutingIntentClient(subscriptionID string) RoutingIntentClient { + return NewRoutingIntentClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRoutingIntentClientWithBaseURI creates an instance of the RoutingIntentClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRoutingIntentClientWithBaseURI(baseURI string, subscriptionID string) RoutingIntentClient { + return RoutingIntentClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. +// Parameters: +// resourceGroupName - the resource group name of the RoutingIntent. +// virtualHubName - the name of the VirtualHub. +// routingIntentName - the name of the per VirtualHub singleton Routing Intent resource. +// routingIntentParameters - parameters supplied to create or update RoutingIntent. +func (client RoutingIntentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, routingIntentParameters RoutingIntent) (result RoutingIntentCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoutingIntentClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client RoutingIntentClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, routingIntentParameters RoutingIntent) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "routingIntentName": autorest.Encode("path", routingIntentName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualHubName": autorest.Encode("path", virtualHubName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + routingIntentParameters.Etag = nil + routingIntentParameters.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}", pathParameters), + autorest.WithJSON(routingIntentParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client RoutingIntentClient) CreateOrUpdateSender(req *http.Request) (future RoutingIntentCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client RoutingIntentClient) CreateOrUpdateResponder(resp *http.Response) (result RoutingIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a RoutingIntent. +// Parameters: +// resourceGroupName - the resource group name of the RoutingIntent. +// virtualHubName - the name of the VirtualHub. +// routingIntentName - the name of the RoutingIntent. +func (client RoutingIntentClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string) (result RoutingIntentDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoutingIntentClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName, routingIntentName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RoutingIntentClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "routingIntentName": autorest.Encode("path", routingIntentName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualHubName": autorest.Encode("path", virtualHubName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client RoutingIntentClient) DeleteSender(req *http.Request) (future RoutingIntentDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client RoutingIntentClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves the details of a RoutingIntent. +// Parameters: +// resourceGroupName - the resource group name of the RoutingIntent. +// virtualHubName - the name of the VirtualHub. +// routingIntentName - the name of the RoutingIntent. +func (client RoutingIntentClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string) (result RoutingIntent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoutingIntentClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName, routingIntentName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RoutingIntentClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "routingIntentName": autorest.Encode("path", routingIntentName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualHubName": autorest.Encode("path", virtualHubName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RoutingIntentClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RoutingIntentClient) GetResponder(resp *http.Response) (result RoutingIntent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List retrieves the details of all RoutingIntent child resources of the VirtualHub. +// Parameters: +// resourceGroupName - the resource group name of the VirtualHub. +// virtualHubName - the name of the VirtualHub. +func (client RoutingIntentClient) List(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListRoutingIntentResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoutingIntentClient.List") + defer func() { + sc := -1 + if result.lrir.Response.Response != nil { + sc = result.lrir.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, virtualHubName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lrir.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "List", resp, "Failure sending request") + return + } + + result.lrir, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "List", resp, "Failure responding to request") + return + } + if result.lrir.hasNextLink() && result.lrir.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client RoutingIntentClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualHubName": autorest.Encode("path", virtualHubName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client RoutingIntentClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client RoutingIntentClient) ListResponder(resp *http.Response) (result ListRoutingIntentResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client RoutingIntentClient) listNextResults(ctx context.Context, lastResults ListRoutingIntentResult) (result ListRoutingIntentResult, err error) { + req, err := lastResults.listRoutingIntentResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.RoutingIntentClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.RoutingIntentClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client RoutingIntentClient) ListComplete(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListRoutingIntentResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoutingIntentClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, virtualHubName) + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/securitygroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securitygroups.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/securitygroups.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securitygroups.go index 5fa8b0db3f55..fc059a966b0e 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/securitygroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securitygroups.go @@ -69,7 +69,7 @@ func (client SecurityGroupsClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client SecurityGroupsClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client SecurityGroupsClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -319,7 +319,7 @@ func (client SecurityGroupsClient) ListPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client SecurityGroupsClient) ListAllPreparer(ctx context.Context) (*http.R "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -546,7 +546,7 @@ func (client SecurityGroupsClient) UpdateTagsPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/securitypartnerproviders.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securitypartnerproviders.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/securitypartnerproviders.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securitypartnerproviders.go index b844ef9e3fbe..dd7f1dd0f17f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/securitypartnerproviders.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securitypartnerproviders.go @@ -70,7 +70,7 @@ func (client SecurityPartnerProvidersClient) CreateOrUpdatePreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client SecurityPartnerProvidersClient) DeletePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client SecurityPartnerProvidersClient) GetPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -313,7 +313,7 @@ func (client SecurityPartnerProvidersClient) ListPreparer(ctx context.Context) ( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -429,7 +429,7 @@ func (client SecurityPartnerProvidersClient) ListByResourceGroupPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -543,7 +543,7 @@ func (client SecurityPartnerProvidersClient) UpdateTagsPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/securityrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securityrules.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/securityrules.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securityrules.go index 6a3ea28f44a9..6e75a8eefb3e 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/securityrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securityrules.go @@ -71,7 +71,7 @@ func (client SecurityRulesClient) CreateOrUpdatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -155,7 +155,7 @@ func (client SecurityRulesClient) DeletePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -242,7 +242,7 @@ func (client SecurityRulesClient) GetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -323,7 +323,7 @@ func (client SecurityRulesClient) ListPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/serviceassociationlinks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceassociationlinks.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/serviceassociationlinks.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceassociationlinks.go index 54d5cb3e8c6b..097a5f0e76d0 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/serviceassociationlinks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceassociationlinks.go @@ -78,7 +78,7 @@ func (client ServiceAssociationLinksClient) ListPreparer(ctx context.Context, re "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/serviceendpointpolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceendpointpolicies.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/serviceendpointpolicies.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceendpointpolicies.go index 6db4106c0dd0..f894adbca990 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/serviceendpointpolicies.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceendpointpolicies.go @@ -70,7 +70,7 @@ func (client ServiceEndpointPoliciesClient) CreateOrUpdatePreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -153,7 +153,7 @@ func (client ServiceEndpointPoliciesClient) DeletePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -239,7 +239,7 @@ func (client ServiceEndpointPoliciesClient) GetPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -318,7 +318,7 @@ func (client ServiceEndpointPoliciesClient) ListPreparer(ctx context.Context) (* "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -434,7 +434,7 @@ func (client ServiceEndpointPoliciesClient) ListByResourceGroupPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -548,7 +548,7 @@ func (client ServiceEndpointPoliciesClient) UpdateTagsPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/serviceendpointpolicydefinitions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceendpointpolicydefinitions.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/serviceendpointpolicydefinitions.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceendpointpolicydefinitions.go index dfe855ec3a92..89eaa8bb537e 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/serviceendpointpolicydefinitions.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceendpointpolicydefinitions.go @@ -73,7 +73,7 @@ func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdatePreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -157,7 +157,7 @@ func (client ServiceEndpointPolicyDefinitionsClient) DeletePreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +244,7 @@ func (client ServiceEndpointPolicyDefinitionsClient) GetPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -325,7 +325,7 @@ func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupPreparer "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/servicetaginformation.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/servicetaginformation.go new file mode 100644 index 000000000000..43306797828f --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/servicetaginformation.go @@ -0,0 +1,158 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ServiceTagInformationClient is the network Client +type ServiceTagInformationClient struct { + BaseClient +} + +// NewServiceTagInformationClient creates an instance of the ServiceTagInformationClient client. +func NewServiceTagInformationClient(subscriptionID string) ServiceTagInformationClient { + return NewServiceTagInformationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServiceTagInformationClientWithBaseURI creates an instance of the ServiceTagInformationClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewServiceTagInformationClientWithBaseURI(baseURI string, subscriptionID string) ServiceTagInformationClient { + return ServiceTagInformationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets a list of service tag information resources with pagination. +// Parameters: +// location - the location that will be used as a reference for cloud (not as a filter based on location, you +// will get the list of service tags with prefix details across all regions but limited to the cloud that your +// subscription belongs to). +// noAddressPrefixes - do not return address prefixes for the tag(s). +// tagName - return tag information for a particular tag. +func (client ServiceTagInformationClient) List(ctx context.Context, location string, noAddressPrefixes *bool, tagName string) (result ServiceTagInformationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceTagInformationClient.List") + defer func() { + sc := -1 + if result.stilr.Response.Response != nil { + sc = result.stilr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, location, noAddressPrefixes, tagName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ServiceTagInformationClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.stilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ServiceTagInformationClient", "List", resp, "Failure sending request") + return + } + + result.stilr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ServiceTagInformationClient", "List", resp, "Failure responding to request") + return + } + if result.stilr.hasNextLink() && result.stilr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ServiceTagInformationClient) ListPreparer(ctx context.Context, location string, noAddressPrefixes *bool, tagName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if noAddressPrefixes != nil { + queryParameters["noAddressPrefixes"] = autorest.Encode("query", *noAddressPrefixes) + } + if len(tagName) > 0 { + queryParameters["tagName"] = autorest.Encode("query", tagName) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTagDetails", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceTagInformationClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ServiceTagInformationClient) ListResponder(resp *http.Response) (result ServiceTagInformationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ServiceTagInformationClient) listNextResults(ctx context.Context, lastResults ServiceTagInformationListResult) (result ServiceTagInformationListResult, err error) { + req, err := lastResults.serviceTagInformationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.ServiceTagInformationClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.ServiceTagInformationClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ServiceTagInformationClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServiceTagInformationClient) ListComplete(ctx context.Context, location string, noAddressPrefixes *bool, tagName string) (result ServiceTagInformationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceTagInformationClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, location, noAddressPrefixes, tagName) + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/servicetags.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/servicetags.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/servicetags.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/servicetags.go index 0701964691e6..7f04ce556e1b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/servicetags.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/servicetags.go @@ -75,7 +75,7 @@ func (client ServiceTagsClient) ListPreparer(ctx context.Context, location strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/subnets.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/subnets.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/subnets.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/subnets.go index 5721e13d2a9e..fa4f18c83c7b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/subnets.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/subnets.go @@ -71,7 +71,7 @@ func (client SubnetsClient) CreateOrUpdatePreparer(ctx context.Context, resource "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -155,7 +155,7 @@ func (client SubnetsClient) DeletePreparer(ctx context.Context, resourceGroupNam "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -243,7 +243,7 @@ func (client SubnetsClient) GetPreparer(ctx context.Context, resourceGroupName s "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -327,7 +327,7 @@ func (client SubnetsClient) ListPreparer(ctx context.Context, resourceGroupName "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -437,7 +437,7 @@ func (client SubnetsClient) PrepareNetworkPoliciesPreparer(ctx context.Context, "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -521,7 +521,7 @@ func (client SubnetsClient) UnprepareNetworkPoliciesPreparer(ctx context.Context "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/usages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/usages.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/usages.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/usages.go index 18857fc9a733..f3a9b82cc598 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/usages.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/usages.go @@ -85,7 +85,7 @@ func (client UsagesClient) ListPreparer(ctx context.Context, location string) (* "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/version.go similarity index 90% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/version.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/version.go index 6a7a32807549..5f7329994a00 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/version.go @@ -10,7 +10,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " network/2021-02-01" + return "Azure-SDK-For-Go/" + Version() + " network/2021-08-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualappliances.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualappliances.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualappliances.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualappliances.go index e55e359ab7d2..fd8e6a55a7a2 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualappliances.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualappliances.go @@ -82,7 +82,7 @@ func (client VirtualAppliancesClient) CreateOrUpdatePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +164,7 @@ func (client VirtualAppliancesClient) DeletePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -250,7 +250,7 @@ func (client VirtualAppliancesClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -329,7 +329,7 @@ func (client VirtualAppliancesClient) ListPreparer(ctx context.Context) (*http.R "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -445,7 +445,7 @@ func (client VirtualAppliancesClient) ListByResourceGroupPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -559,7 +559,7 @@ func (client VirtualAppliancesClient) UpdateTagsPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualappliancesites.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualappliancesites.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualappliancesites.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualappliancesites.go index 223264551d9f..932a0a5f7fe3 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualappliancesites.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualappliancesites.go @@ -72,7 +72,7 @@ func (client VirtualApplianceSitesClient) CreateOrUpdatePreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -157,7 +157,7 @@ func (client VirtualApplianceSitesClient) DeletePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +244,7 @@ func (client VirtualApplianceSitesClient) GetPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -325,7 +325,7 @@ func (client VirtualApplianceSitesClient) ListPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualapplianceskus.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualapplianceskus.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualapplianceskus.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualapplianceskus.go index 7215a06aafb0..7cb46dfa72b2 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualapplianceskus.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualapplianceskus.go @@ -74,7 +74,7 @@ func (client VirtualApplianceSkusClient) GetPreparer(ctx context.Context, skuNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -150,7 +150,7 @@ func (client VirtualApplianceSkusClient) ListPreparer(ctx context.Context) (*htt "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualhubbgpconnection.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubbgpconnection.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualhubbgpconnection.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubbgpconnection.go index ecec2ce600e5..f46aaa5c60bc 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualhubbgpconnection.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubbgpconnection.go @@ -85,7 +85,7 @@ func (client VirtualHubBgpConnectionClient) CreateOrUpdatePreparer(ctx context.C "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -170,7 +170,7 @@ func (client VirtualHubBgpConnectionClient) DeletePreparer(ctx context.Context, "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -257,7 +257,7 @@ func (client VirtualHubBgpConnectionClient) GetPreparer(ctx context.Context, res "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualhubbgpconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubbgpconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualhubbgpconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubbgpconnections.go index 305fdd1c87bc..b6aae280990d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualhubbgpconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubbgpconnections.go @@ -81,7 +81,7 @@ func (client VirtualHubBgpConnectionsClient) ListPreparer(ctx context.Context, r "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -189,7 +189,7 @@ func (client VirtualHubBgpConnectionsClient) ListAdvertisedRoutesPreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -270,7 +270,7 @@ func (client VirtualHubBgpConnectionsClient) ListLearnedRoutesPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualhubipconfiguration.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubipconfiguration.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualhubipconfiguration.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubipconfiguration.go index 1de52f0aab04..9d283a6e4fe9 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualhubipconfiguration.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubipconfiguration.go @@ -91,7 +91,7 @@ func (client VirtualHubIPConfigurationClient) CreateOrUpdatePreparer(ctx context "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -176,7 +176,7 @@ func (client VirtualHubIPConfigurationClient) DeletePreparer(ctx context.Context "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -263,7 +263,7 @@ func (client VirtualHubIPConfigurationClient) GetPreparer(ctx context.Context, r "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -344,7 +344,7 @@ func (client VirtualHubIPConfigurationClient) ListPreparer(ctx context.Context, "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualhubroutetablev2s.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubroutetablev2s.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualhubroutetablev2s.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubroutetablev2s.go index 2309aea9ba85..85d1612d3dda 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualhubroutetablev2s.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubroutetablev2s.go @@ -73,7 +73,7 @@ func (client VirtualHubRouteTableV2sClient) CreateOrUpdatePreparer(ctx context.C "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -157,7 +157,7 @@ func (client VirtualHubRouteTableV2sClient) DeletePreparer(ctx context.Context, "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +244,7 @@ func (client VirtualHubRouteTableV2sClient) GetPreparer(ctx context.Context, res "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -325,7 +325,7 @@ func (client VirtualHubRouteTableV2sClient) ListPreparer(ctx context.Context, re "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualhubs.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubs.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualhubs.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubs.go index 152b6a6f8dcc..8bae5f0ca7c5 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualhubs.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubs.go @@ -81,12 +81,13 @@ func (client VirtualHubsClient) CreateOrUpdatePreparer(ctx context.Context, reso "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } virtualHubParameters.Etag = nil + virtualHubParameters.Kind = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), @@ -163,7 +164,7 @@ func (client VirtualHubsClient) DeletePreparer(ctx context.Context, resourceGrou "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -248,7 +249,7 @@ func (client VirtualHubsClient) GetPreparer(ctx context.Context, resourceGroupNa "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -319,7 +320,7 @@ func (client VirtualHubsClient) GetEffectiveVirtualHubRoutesPreparer(ctx context "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -409,7 +410,7 @@ func (client VirtualHubsClient) ListPreparer(ctx context.Context) (*http.Request "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -525,7 +526,7 @@ func (client VirtualHubsClient) ListByResourceGroupPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -639,7 +640,7 @@ func (client VirtualHubsClient) UpdateTagsPreparer(ctx context.Context, resource "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworkgatewayconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgatewayconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworkgatewayconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgatewayconnections.go index 41714b8f7d08..578c03827347 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworkgatewayconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgatewayconnections.go @@ -108,7 +108,7 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdatePreparer(ctx "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -190,7 +190,7 @@ func (client VirtualNetworkGatewayConnectionsClient) DeletePreparer(ctx context. "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -275,7 +275,7 @@ func (client VirtualNetworkGatewayConnectionsClient) GetPreparer(ctx context.Con "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -345,7 +345,7 @@ func (client VirtualNetworkGatewayConnectionsClient) GetIkeSasPreparer(ctx conte "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyPreparer(ctx co "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -512,7 +512,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ListPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -618,7 +618,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetConnectionPreparer(ctx "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -709,7 +709,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyPreparer(ctx "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -800,7 +800,7 @@ func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyPreparer(ctx co "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -883,7 +883,7 @@ func (client VirtualNetworkGatewayConnectionsClient) StartPacketCapturePreparer( "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -969,7 +969,7 @@ func (client VirtualNetworkGatewayConnectionsClient) StopPacketCapturePreparer(c "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1051,7 +1051,7 @@ func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsPreparer(ctx cont "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworkgatewaynatrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgatewaynatrules.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworkgatewaynatrules.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgatewaynatrules.go index f9d9aa4b9092..fd083dab12fe 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworkgatewaynatrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgatewaynatrules.go @@ -73,7 +73,7 @@ func (client VirtualNetworkGatewayNatRulesClient) CreateOrUpdatePreparer(ctx con "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -158,7 +158,7 @@ func (client VirtualNetworkGatewayNatRulesClient) DeletePreparer(ctx context.Con "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -245,7 +245,7 @@ func (client VirtualNetworkGatewayNatRulesClient) GetPreparer(ctx context.Contex "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -326,7 +326,7 @@ func (client VirtualNetworkGatewayNatRulesClient) ListByVirtualNetworkGatewayPre "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworkgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgateways.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworkgateways.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgateways.go index 3e58c2ea302c..2943d5e9a6f6 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworkgateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgateways.go @@ -84,7 +84,7 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Co "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -166,7 +166,7 @@ func (client VirtualNetworkGatewaysClient) DeletePreparer(ctx context.Context, r "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -246,7 +246,7 @@ func (client VirtualNetworkGatewaysClient) DisconnectVirtualNetworkGatewayVpnCon "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -328,7 +328,7 @@ func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackagePreparer(ctx "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -411,7 +411,7 @@ func (client VirtualNetworkGatewaysClient) GenerateVpnProfilePreparer(ctx contex "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -499,7 +499,7 @@ func (client VirtualNetworkGatewaysClient) GetPreparer(ctx context.Context, reso "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -570,7 +570,7 @@ func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesPreparer(ctx conte "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "peer": autorest.Encode("query", peer), @@ -651,7 +651,7 @@ func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusPreparer(ctx context. "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -734,7 +734,7 @@ func (client VirtualNetworkGatewaysClient) GetLearnedRoutesPreparer(ctx context. "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -814,7 +814,7 @@ func (client VirtualNetworkGatewaysClient) GetVpnclientConnectionHealthPreparer( "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -895,7 +895,7 @@ func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParametersPreparer(c "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -975,7 +975,7 @@ func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLPreparer(ctx c "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1064,7 +1064,7 @@ func (client VirtualNetworkGatewaysClient) ListPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1182,7 +1182,7 @@ func (client VirtualNetworkGatewaysClient) ListConnectionsPreparer(ctx context.C "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1290,7 +1290,7 @@ func (client VirtualNetworkGatewaysClient) ResetPreparer(ctx context.Context, re "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1373,7 +1373,7 @@ func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKeyPreparer(ctx c "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1461,7 +1461,7 @@ func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParametersPreparer(c "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1543,7 +1543,7 @@ func (client VirtualNetworkGatewaysClient) StartPacketCapturePreparer(ctx contex "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1628,7 +1628,7 @@ func (client VirtualNetworkGatewaysClient) StopPacketCapturePreparer(ctx context "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1716,7 +1716,7 @@ func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesPreparer(ctx conte "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1786,7 +1786,7 @@ func (client VirtualNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Contex "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1876,7 +1876,7 @@ func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptPreparer( "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworkpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkpeerings.go similarity index 97% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworkpeerings.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkpeerings.go index 42b188bc2078..f556b1fd8234 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworkpeerings.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkpeerings.go @@ -57,6 +57,8 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdate(ctx context.Context, r Constraints: []validation.Constraint{{Target: "virtualNetworkPeeringParameters.VirtualNetworkPeeringPropertiesFormat", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "virtualNetworkPeeringParameters.VirtualNetworkPeeringPropertiesFormat.RemoteBgpCommunities", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "virtualNetworkPeeringParameters.VirtualNetworkPeeringPropertiesFormat.RemoteBgpCommunities.VirtualNetworkCommunity", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "virtualNetworkPeeringParameters.VirtualNetworkPeeringPropertiesFormat.RemoteVirtualNetworkEncryption", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "virtualNetworkPeeringParameters.VirtualNetworkPeeringPropertiesFormat.RemoteVirtualNetworkEncryption.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { return result, validation.NewError("network.VirtualNetworkPeeringsClient", "CreateOrUpdate", err.Error()) } @@ -85,7 +87,7 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdatePreparer(ctx context.Co "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -172,7 +174,7 @@ func (client VirtualNetworkPeeringsClient) DeletePreparer(ctx context.Context, r "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -259,7 +261,7 @@ func (client VirtualNetworkPeeringsClient) GetPreparer(ctx context.Context, reso "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -340,7 +342,7 @@ func (client VirtualNetworkPeeringsClient) ListPreparer(ctx context.Context, res "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworks.go similarity index 98% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworks.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworks.go index 52e1bf422061..9febb3dec5d5 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworks.go @@ -77,7 +77,7 @@ func (client VirtualNetworksClient) CheckIPAddressAvailabilityPreparer(ctx conte "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "ipAddress": autorest.Encode("query", IPAddress), @@ -130,6 +130,8 @@ func (client VirtualNetworksClient) CreateOrUpdate(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkPropertiesFormat", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkPropertiesFormat.BgpCommunities", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkPropertiesFormat.BgpCommunities.VirtualNetworkCommunity", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.VirtualNetworkPropertiesFormat.Encryption", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkPropertiesFormat.Encryption.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { return result, validation.NewError("network.VirtualNetworksClient", "CreateOrUpdate", err.Error()) } @@ -157,7 +159,7 @@ func (client VirtualNetworksClient) CreateOrUpdatePreparer(ctx context.Context, "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -239,7 +241,7 @@ func (client VirtualNetworksClient) DeletePreparer(ctx context.Context, resource "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -325,7 +327,7 @@ func (client VirtualNetworksClient) GetPreparer(ctx context.Context, resourceGro "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -407,7 +409,7 @@ func (client VirtualNetworksClient) ListPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -520,7 +522,7 @@ func (client VirtualNetworksClient) ListAllPreparer(ctx context.Context) (*http. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -638,7 +640,7 @@ func (client VirtualNetworksClient) ListUsagePreparer(ctx context.Context, resou "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -752,7 +754,7 @@ func (client VirtualNetworksClient) UpdateTagsPreparer(ctx context.Context, reso "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworktaps.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworktaps.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworktaps.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworktaps.go index b43eca5b1f02..7d6bc121f9e8 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualnetworktaps.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworktaps.go @@ -106,7 +106,7 @@ func (client VirtualNetworkTapsClient) CreateOrUpdatePreparer(ctx context.Contex "tapName": autorest.Encode("path", tapName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -188,7 +188,7 @@ func (client VirtualNetworkTapsClient) DeletePreparer(ctx context.Context, resou "tapName": autorest.Encode("path", tapName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -273,7 +273,7 @@ func (client VirtualNetworkTapsClient) GetPreparer(ctx context.Context, resource "tapName": autorest.Encode("path", tapName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -349,7 +349,7 @@ func (client VirtualNetworkTapsClient) ListAllPreparer(ctx context.Context) (*ht "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -465,7 +465,7 @@ func (client VirtualNetworkTapsClient) ListByResourceGroupPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -579,7 +579,7 @@ func (client VirtualNetworkTapsClient) UpdateTagsPreparer(ctx context.Context, r "tapName": autorest.Encode("path", tapName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualrouterpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualrouterpeerings.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualrouterpeerings.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualrouterpeerings.go index 065719b08f0b..4ed695c16f96 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualrouterpeerings.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualrouterpeerings.go @@ -84,7 +84,7 @@ func (client VirtualRouterPeeringsClient) CreateOrUpdatePreparer(ctx context.Con "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -169,7 +169,7 @@ func (client VirtualRouterPeeringsClient) DeletePreparer(ctx context.Context, re "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -256,7 +256,7 @@ func (client VirtualRouterPeeringsClient) GetPreparer(ctx context.Context, resou "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -337,7 +337,7 @@ func (client VirtualRouterPeeringsClient) ListPreparer(ctx context.Context, reso "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualrouters.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualrouters.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualrouters.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualrouters.go index aecbb89552b7..a4da32dbc582 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualrouters.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualrouters.go @@ -81,7 +81,7 @@ func (client VirtualRoutersClient) CreateOrUpdatePreparer(ctx context.Context, r "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -163,7 +163,7 @@ func (client VirtualRoutersClient) DeletePreparer(ctx context.Context, resourceG "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -249,7 +249,7 @@ func (client VirtualRoutersClient) GetPreparer(ctx context.Context, resourceGrou "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -328,7 +328,7 @@ func (client VirtualRoutersClient) ListPreparer(ctx context.Context) (*http.Requ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -444,7 +444,7 @@ func (client VirtualRoutersClient) ListByResourceGroupPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualwans.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualwans.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualwans.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualwans.go index 7ac1a3f0d3b8..cf2385c7948f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/virtualwans.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualwans.go @@ -69,7 +69,7 @@ func (client VirtualWansClient) CreateOrUpdatePreparer(ctx context.Context, reso "VirtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client VirtualWansClient) DeletePreparer(ctx context.Context, resourceGrou "VirtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -236,7 +236,7 @@ func (client VirtualWansClient) GetPreparer(ctx context.Context, resourceGroupNa "VirtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -312,7 +312,7 @@ func (client VirtualWansClient) ListPreparer(ctx context.Context) (*http.Request "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -428,7 +428,7 @@ func (client VirtualWansClient) ListByResourceGroupPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -542,7 +542,7 @@ func (client VirtualWansClient) UpdateTagsPreparer(ctx context.Context, resource "VirtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnconnections.go index ec6e71cd5894..bfa051bca448 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnconnections.go @@ -72,7 +72,7 @@ func (client VpnConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -156,7 +156,7 @@ func (client VpnConnectionsClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -243,7 +243,7 @@ func (client VpnConnectionsClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -324,7 +324,7 @@ func (client VpnConnectionsClient) ListByVpnGatewayPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -434,7 +434,7 @@ func (client VpnConnectionsClient) StartPacketCapturePreparer(ctx context.Contex "vpnConnectionName": autorest.Encode("path", vpnConnectionName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -521,7 +521,7 @@ func (client VpnConnectionsClient) StopPacketCapturePreparer(ctx context.Context "vpnConnectionName": autorest.Encode("path", vpnConnectionName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpngateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpngateways.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpngateways.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpngateways.go index a62d2be0d947..ea9d2837eccb 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpngateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpngateways.go @@ -83,7 +83,7 @@ func (client VpnGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,7 +165,7 @@ func (client VpnGatewaysClient) DeletePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -250,7 +250,7 @@ func (client VpnGatewaysClient) GetPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -326,7 +326,7 @@ func (client VpnGatewaysClient) ListPreparer(ctx context.Context) (*http.Request "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -442,7 +442,7 @@ func (client VpnGatewaysClient) ListByResourceGroupPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -548,7 +548,7 @@ func (client VpnGatewaysClient) ResetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -628,7 +628,7 @@ func (client VpnGatewaysClient) StartPacketCapturePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -713,7 +713,7 @@ func (client VpnGatewaysClient) StopPacketCapturePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -798,7 +798,7 @@ func (client VpnGatewaysClient) UpdateTagsPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnlinkconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnlinkconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnlinkconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnlinkconnections.go index 85fb84bddb64..f84a1b158e0e 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnlinkconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnlinkconnections.go @@ -73,7 +73,7 @@ func (client VpnLinkConnectionsClient) GetIkeSasPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -166,7 +166,7 @@ func (client VpnLinkConnectionsClient) ListByVpnConnectionPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -276,7 +276,7 @@ func (client VpnLinkConnectionsClient) ResetConnectionPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnserverconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnserverconfigurations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnserverconfigurations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnserverconfigurations.go index a55252fe0e96..14784a641112 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnserverconfigurations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnserverconfigurations.go @@ -71,7 +71,7 @@ func (client VpnServerConfigurationsClient) CreateOrUpdatePreparer(ctx context.C "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -153,7 +153,7 @@ func (client VpnServerConfigurationsClient) DeletePreparer(ctx context.Context, "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -238,7 +238,7 @@ func (client VpnServerConfigurationsClient) GetPreparer(ctx context.Context, res "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -314,7 +314,7 @@ func (client VpnServerConfigurationsClient) ListPreparer(ctx context.Context) (* "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -430,7 +430,7 @@ func (client VpnServerConfigurationsClient) ListByResourceGroupPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -544,7 +544,7 @@ func (client VpnServerConfigurationsClient) UpdateTagsPreparer(ctx context.Conte "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go index 76b8b7b364fd..21176b057549 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go @@ -70,7 +70,7 @@ func (client VpnServerConfigurationsAssociatedWithVirtualWanClient) ListPreparer "virtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnsitelinkconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitelinkconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnsitelinkconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitelinkconnections.go index 5665c5fe0099..b4b1695a678b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnsitelinkconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitelinkconnections.go @@ -80,7 +80,7 @@ func (client VpnSiteLinkConnectionsClient) GetPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnsitelinks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitelinks.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnsitelinks.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitelinks.go index d36385e9047a..284ac1665d37 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnsitelinks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitelinks.go @@ -77,7 +77,7 @@ func (client VpnSiteLinksClient) GetPreparer(ctx context.Context, resourceGroupN "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -158,7 +158,7 @@ func (client VpnSiteLinksClient) ListByVpnSitePreparer(ctx context.Context, reso "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnsites.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsites.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnsites.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsites.go index 2632c4bff8d7..4524ca65ab0c 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnsites.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsites.go @@ -83,7 +83,7 @@ func (client VpnSitesClient) CreateOrUpdatePreparer(ctx context.Context, resourc "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,7 +165,7 @@ func (client VpnSitesClient) DeletePreparer(ctx context.Context, resourceGroupNa "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -250,7 +250,7 @@ func (client VpnSitesClient) GetPreparer(ctx context.Context, resourceGroupName "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -326,7 +326,7 @@ func (client VpnSitesClient) ListPreparer(ctx context.Context) (*http.Request, e "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -442,7 +442,7 @@ func (client VpnSitesClient) ListByResourceGroupPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -556,7 +556,7 @@ func (client VpnSitesClient) UpdateTagsPreparer(ctx context.Context, resourceGro "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnsitesconfiguration.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitesconfiguration.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnsitesconfiguration.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitesconfiguration.go index cfd2eae785a3..1cc56fb2eccf 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/vpnsitesconfiguration.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitesconfiguration.go @@ -77,7 +77,7 @@ func (client VpnSitesConfigurationClient) DownloadPreparer(ctx context.Context, "virtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/watchers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/watchers.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/watchers.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/watchers.go index 189775c79ce4..abdca8fdd90b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/watchers.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/watchers.go @@ -89,7 +89,7 @@ func (client WatchersClient) CheckConnectivityPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -178,7 +178,7 @@ func (client WatchersClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -250,7 +250,7 @@ func (client WatchersClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -335,7 +335,7 @@ func (client WatchersClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -415,7 +415,7 @@ func (client WatchersClient) GetAzureReachabilityReportPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -503,7 +503,7 @@ func (client WatchersClient) GetFlowLogStatusPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -596,7 +596,7 @@ func (client WatchersClient) GetNetworkConfigurationDiagnosticPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -686,7 +686,7 @@ func (client WatchersClient) GetNextHopPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -775,7 +775,7 @@ func (client WatchersClient) GetTopologyPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -857,7 +857,7 @@ func (client WatchersClient) GetTroubleshootingPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -945,7 +945,7 @@ func (client WatchersClient) GetTroubleshootingResultPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1033,7 +1033,7 @@ func (client WatchersClient) GetVMSecurityRulesPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1119,7 +1119,7 @@ func (client WatchersClient) ListPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1190,7 +1190,7 @@ func (client WatchersClient) ListAllPreparer(ctx context.Context) (*http.Request "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1261,7 +1261,7 @@ func (client WatchersClient) ListAvailableProvidersPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1353,7 +1353,7 @@ func (client WatchersClient) SetFlowLogConfigurationPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1442,7 +1442,7 @@ func (client WatchersClient) UpdateTagsPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1524,7 +1524,7 @@ func (client WatchersClient) VerifyIPFlowPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/webapplicationfirewallpolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/webapplicationfirewallpolicies.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/webapplicationfirewallpolicies.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/webapplicationfirewallpolicies.go index d8dd1208b546..5a0a6a2b315e 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/webapplicationfirewallpolicies.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/webapplicationfirewallpolicies.go @@ -95,7 +95,7 @@ func (client WebApplicationFirewallPoliciesClient) CreateOrUpdatePreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -173,7 +173,7 @@ func (client WebApplicationFirewallPoliciesClient) DeletePreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -264,7 +264,7 @@ func (client WebApplicationFirewallPoliciesClient) GetPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -343,7 +343,7 @@ func (client WebApplicationFirewallPoliciesClient) ListPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -456,7 +456,7 @@ func (client WebApplicationFirewallPoliciesClient) ListAllPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/webcategories.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/webcategories.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/webcategories.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/webcategories.go index c854328709dd..13fb4c1fb72e 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network/webcategories.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/webcategories.go @@ -74,7 +74,7 @@ func (client WebCategoriesClient) GetPreparer(ctx context.Context, name string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -153,7 +153,7 @@ func (client WebCategoriesClient) ListBySubscriptionPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-02-01" + const APIVersion = "2021-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/version/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/version/version.go index 2c4bd1693b51..c4aee486fa06 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/version/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/version/version.go @@ -4,4 +4,4 @@ package version // Licensed under the MIT License. See License.txt in the project root for license information. // Number contains the semantic version of this SDK. -const Number = "v63.4.0" +const Number = "v65.0.0" diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/README.md b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/README.md index fec416a9c415..b11eb07884b0 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/README.md +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/README.md @@ -1,3 +1,5 @@ +# NOTE: This module will go out of support by March 31, 2023. For authenticating with Azure AD, use module [azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity) instead. For help migrating from `adal` to `azidentiy` please consult the [migration guide](https://aka.ms/azsdk/go/identity/migration). General information about the retirement of this and other legacy modules can be found [here](https://azure.microsoft.com/updates/support-for-azure-sdk-libraries-that-do-not-conform-to-our-current-azure-sdk-guidelines-will-be-retired-as-of-31-march-2023/). + # Azure Active Directory authentication for Go This is a standalone package for authenticating with Azure Active @@ -18,7 +20,7 @@ go get -u github.com/Azure/go-autorest/autorest/adal ## Usage -An Active Directory application is required in order to use this library. An application can be registered in the [Azure Portal](https://portal.azure.com/) by following these [guidelines](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applications) or using the [Azure CLI](https://github.com/Azure/azure-cli). +An Active Directory application is required in order to use this library. An application can be registered in the [Azure Portal](https://portal.azure.com/) by following these [guidelines](https://docs.microsoft.com/azure/active-directory/develop/active-directory-integrating-applications) or using the [Azure CLI](https://github.com/Azure/azure-cli). ### Register an Azure AD Application with secret @@ -88,7 +90,7 @@ An Active Directory application is required in order to use this library. An app ### Grant the necessary permissions Azure relies on a Role-Based Access Control (RBAC) model to manage the access to resources at a fine-grained -level. There is a set of [pre-defined roles](https://docs.microsoft.com/en-us/azure/active-directory/role-based-access-built-in-roles) +level. There is a set of [pre-defined roles](https://docs.microsoft.com/azure/active-directory/role-based-access-built-in-roles) which can be assigned to a service principal of an Azure AD application depending of your needs. ``` @@ -104,7 +106,7 @@ It is also possible to define custom role definitions. az role definition create --role-definition role-definition.json ``` -* Check [custom roles](https://docs.microsoft.com/en-us/azure/active-directory/role-based-access-control-custom-roles) for more details regarding the content of `role-definition.json` file. +* Check [custom roles](https://docs.microsoft.com/azure/active-directory/role-based-access-control-custom-roles) for more details regarding the content of `role-definition.json` file. ### Acquire Access Token diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token.go index 07efaa402d68..1a9c8ab537f0 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token.go @@ -1104,8 +1104,8 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource // AAD returns expires_in as a string, ADFS returns it as an int ExpiresIn json.Number `json:"expires_in"` - // expires_on can be in two formats, a UTC time stamp or the number of seconds. - ExpiresOn string `json:"expires_on"` + // expires_on can be in three formats, a UTC time stamp, or the number of seconds as a string *or* int. + ExpiresOn interface{} `json:"expires_on"` NotBefore json.Number `json:"not_before"` Resource string `json:"resource"` @@ -1118,7 +1118,7 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource } expiresOn := json.Number("") // ADFS doesn't include the expires_on field - if token.ExpiresOn != "" { + if token.ExpiresOn != nil { if expiresOn, err = parseExpiresOn(token.ExpiresOn); err != nil { return newTokenRefreshError(fmt.Sprintf("adal: failed to parse expires_on: %v value '%s'", err, token.ExpiresOn), resp) } @@ -1135,18 +1135,27 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource } // converts expires_on to the number of seconds -func parseExpiresOn(s string) (json.Number, error) { - // convert the expiration date to the number of seconds from now +func parseExpiresOn(s interface{}) (json.Number, error) { + // the JSON unmarshaler treats JSON numbers unmarshaled into an interface{} as float64 + asFloat64, ok := s.(float64) + if ok { + // this is the number of seconds as int case + return json.Number(strconv.FormatInt(int64(asFloat64), 10)), nil + } + asStr, ok := s.(string) + if !ok { + return "", fmt.Errorf("unexpected expires_on type %T", s) + } + // convert the expiration date to the number of seconds from the unix epoch timeToDuration := func(t time.Time) json.Number { - dur := t.Sub(time.Now().UTC()) - return json.Number(strconv.FormatInt(int64(dur.Round(time.Second).Seconds()), 10)) + return json.Number(strconv.FormatInt(t.UTC().Unix(), 10)) } - if _, err := strconv.ParseInt(s, 10, 64); err == nil { + if _, err := json.Number(asStr).Int64(); err == nil { // this is the number of seconds case, no conversion required - return json.Number(s), nil - } else if eo, err := time.Parse(expiresOnDateFormatPM, s); err == nil { + return json.Number(asStr), nil + } else if eo, err := time.Parse(expiresOnDateFormatPM, asStr); err == nil { return timeToDuration(eo), nil - } else if eo, err := time.Parse(expiresOnDateFormat, s); err == nil { + } else if eo, err := time.Parse(expiresOnDateFormat, asStr); err == nil { return timeToDuration(eo), nil } else { // unknown format diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_compare_can_convert.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_compare_can_convert.go index df22c47fc50a..da867903e2fa 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_compare_can_convert.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_compare_can_convert.go @@ -9,7 +9,7 @@ package assert import "reflect" -// Wrapper around reflect.Value.CanConvert, for compatability +// Wrapper around reflect.Value.CanConvert, for compatibility // reasons. func canConvert(value reflect.Value, to reflect.Type) bool { return value.CanConvert(to) diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/suite/suite.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/suite/suite.go index b9b5d1c56cf0..1c402e8dfae5 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/suite/suite.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/suite/suite.go @@ -7,6 +7,7 @@ import ( "reflect" "regexp" "runtime/debug" + "sync" "testing" "time" @@ -21,17 +22,22 @@ var matchMethod = flag.String("testify.m", "", "regular expression to select tes // retrieving the current *testing.T context. type Suite struct { *assert.Assertions + mu sync.RWMutex require *require.Assertions t *testing.T } // T retrieves the current *testing.T context. func (suite *Suite) T() *testing.T { + suite.mu.RLock() + defer suite.mu.RUnlock() return suite.t } // SetT sets the current *testing.T context. func (suite *Suite) SetT(t *testing.T) { + suite.mu.Lock() + defer suite.mu.Unlock() suite.t = t suite.Assertions = assert.New(t) suite.require = require.New(t) @@ -39,6 +45,8 @@ func (suite *Suite) SetT(t *testing.T) { // Require returns a require context for suite. func (suite *Suite) Require() *require.Assertions { + suite.mu.Lock() + defer suite.mu.Unlock() if suite.require == nil { suite.require = require.New(suite.T()) } @@ -51,6 +59,8 @@ func (suite *Suite) Require() *require.Assertions { // assert.Assertions with require.Assertions), this method is provided so you // can call `suite.Assert().NoError()`. func (suite *Suite) Assert() *assert.Assertions { + suite.mu.Lock() + defer suite.mu.Unlock() if suite.Assertions == nil { suite.Assertions = assert.New(suite.T()) } diff --git a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/decode.go b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/decode.go index df36e3a30f55..0173b6982e84 100644 --- a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/decode.go +++ b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/decode.go @@ -100,7 +100,10 @@ func (p *parser) peek() yaml_event_type_t { if p.event.typ != yaml_NO_EVENT { return p.event.typ } - if !yaml_parser_parse(&p.parser, &p.event) { + // It's curious choice from the underlying API to generally return a + // positive result on success, but on this case return true in an error + // scenario. This was the source of bugs in the past (issue #666). + if !yaml_parser_parse(&p.parser, &p.event) || p.parser.error != yaml_NO_ERROR { p.fail() } return p.event.typ @@ -320,6 +323,8 @@ type decoder struct { decodeCount int aliasCount int aliasDepth int + + mergedFields map[interface{}]bool } var ( @@ -808,6 +813,11 @@ func (d *decoder) mapping(n *Node, out reflect.Value) (good bool) { } } + mergedFields := d.mergedFields + d.mergedFields = nil + + var mergeNode *Node + mapIsNew := false if out.IsNil() { out.Set(reflect.MakeMap(outt)) @@ -815,11 +825,18 @@ func (d *decoder) mapping(n *Node, out reflect.Value) (good bool) { } for i := 0; i < l; i += 2 { if isMerge(n.Content[i]) { - d.merge(n.Content[i+1], out) + mergeNode = n.Content[i+1] continue } k := reflect.New(kt).Elem() if d.unmarshal(n.Content[i], k) { + if mergedFields != nil { + ki := k.Interface() + if mergedFields[ki] { + continue + } + mergedFields[ki] = true + } kkind := k.Kind() if kkind == reflect.Interface { kkind = k.Elem().Kind() @@ -833,6 +850,12 @@ func (d *decoder) mapping(n *Node, out reflect.Value) (good bool) { } } } + + d.mergedFields = mergedFields + if mergeNode != nil { + d.merge(n, mergeNode, out) + } + d.stringMapType = stringMapType d.generalMapType = generalMapType return true @@ -844,7 +867,8 @@ func isStringMap(n *Node) bool { } l := len(n.Content) for i := 0; i < l; i += 2 { - if n.Content[i].ShortTag() != strTag { + shortTag := n.Content[i].ShortTag() + if shortTag != strTag && shortTag != mergeTag { return false } } @@ -861,7 +885,6 @@ func (d *decoder) mappingStruct(n *Node, out reflect.Value) (good bool) { var elemType reflect.Type if sinfo.InlineMap != -1 { inlineMap = out.Field(sinfo.InlineMap) - inlineMap.Set(reflect.New(inlineMap.Type()).Elem()) elemType = inlineMap.Type().Elem() } @@ -870,6 +893,9 @@ func (d *decoder) mappingStruct(n *Node, out reflect.Value) (good bool) { d.prepare(n, field) } + mergedFields := d.mergedFields + d.mergedFields = nil + var mergeNode *Node var doneFields []bool if d.uniqueKeys { doneFields = make([]bool, len(sinfo.FieldsList)) @@ -879,13 +905,20 @@ func (d *decoder) mappingStruct(n *Node, out reflect.Value) (good bool) { for i := 0; i < l; i += 2 { ni := n.Content[i] if isMerge(ni) { - d.merge(n.Content[i+1], out) + mergeNode = n.Content[i+1] continue } if !d.unmarshal(ni, name) { continue } - if info, ok := sinfo.FieldsMap[name.String()]; ok { + sname := name.String() + if mergedFields != nil { + if mergedFields[sname] { + continue + } + mergedFields[sname] = true + } + if info, ok := sinfo.FieldsMap[sname]; ok { if d.uniqueKeys { if doneFields[info.Id] { d.terrors = append(d.terrors, fmt.Sprintf("line %d: field %s already set in type %s", ni.Line, name.String(), out.Type())) @@ -911,6 +944,11 @@ func (d *decoder) mappingStruct(n *Node, out reflect.Value) (good bool) { d.terrors = append(d.terrors, fmt.Sprintf("line %d: field %s not found in type %s", ni.Line, name.String(), out.Type())) } } + + d.mergedFields = mergedFields + if mergeNode != nil { + d.merge(n, mergeNode, out) + } return true } @@ -918,19 +956,29 @@ func failWantMap() { failf("map merge requires map or sequence of maps as the value") } -func (d *decoder) merge(n *Node, out reflect.Value) { - switch n.Kind { +func (d *decoder) merge(parent *Node, merge *Node, out reflect.Value) { + mergedFields := d.mergedFields + if mergedFields == nil { + d.mergedFields = make(map[interface{}]bool) + for i := 0; i < len(parent.Content); i += 2 { + k := reflect.New(ifaceType).Elem() + if d.unmarshal(parent.Content[i], k) { + d.mergedFields[k.Interface()] = true + } + } + } + + switch merge.Kind { case MappingNode: - d.unmarshal(n, out) + d.unmarshal(merge, out) case AliasNode: - if n.Alias != nil && n.Alias.Kind != MappingNode { + if merge.Alias != nil && merge.Alias.Kind != MappingNode { failWantMap() } - d.unmarshal(n, out) + d.unmarshal(merge, out) case SequenceNode: - // Step backwards as earlier nodes take precedence. - for i := len(n.Content) - 1; i >= 0; i-- { - ni := n.Content[i] + for i := 0; i < len(merge.Content); i++ { + ni := merge.Content[i] if ni.Kind == AliasNode { if ni.Alias != nil && ni.Alias.Kind != MappingNode { failWantMap() @@ -943,6 +991,8 @@ func (d *decoder) merge(n *Node, out reflect.Value) { default: failWantMap() } + + d.mergedFields = mergedFields } func isMerge(n *Node) bool { diff --git a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/parserc.go b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/parserc.go index ac66fccc059e..268558a0d632 100644 --- a/cluster-autoscaler/vendor/gopkg.in/yaml.v3/parserc.go +++ b/cluster-autoscaler/vendor/gopkg.in/yaml.v3/parserc.go @@ -687,6 +687,9 @@ func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, i func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) + if token == nil { + return false + } parser.marks = append(parser.marks, token.start_mark) skip_token(parser) } @@ -786,7 +789,7 @@ func yaml_parser_split_stem_comment(parser *yaml_parser_t, stem_len int) { } token := peek_token(parser) - if token.typ != yaml_BLOCK_SEQUENCE_START_TOKEN && token.typ != yaml_BLOCK_MAPPING_START_TOKEN { + if token == nil || token.typ != yaml_BLOCK_SEQUENCE_START_TOKEN && token.typ != yaml_BLOCK_MAPPING_START_TOKEN { return } @@ -813,6 +816,9 @@ func yaml_parser_split_stem_comment(parser *yaml_parser_t, stem_len int) { func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) + if token == nil { + return false + } parser.marks = append(parser.marks, token.start_mark) skip_token(parser) } @@ -922,6 +928,9 @@ func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_ev func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) + if token == nil { + return false + } parser.marks = append(parser.marks, token.start_mark) skip_token(parser) } diff --git a/cluster-autoscaler/vendor/modules.txt b/cluster-autoscaler/vendor/modules.txt index fe0a10608f9b..f2f602ec8bf8 100644 --- a/cluster-autoscaler/vendor/modules.txt +++ b/cluster-autoscaler/vendor/modules.txt @@ -1,7 +1,7 @@ # cloud.google.com/go v0.81.0 ## explicit cloud.google.com/go/compute/metadata -# github.com/Azure/azure-sdk-for-go v63.4.0+incompatible +# github.com/Azure/azure-sdk-for-go v65.0.0+incompatible ## explicit github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute @@ -10,7 +10,7 @@ github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/con github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network -github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network +github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage @@ -23,7 +23,7 @@ github.com/Azure/go-autorest ## explicit github.com/Azure/go-autorest/autorest github.com/Azure/go-autorest/autorest/azure -# github.com/Azure/go-autorest/autorest/adal v0.9.19 +# github.com/Azure/go-autorest/autorest/adal v0.9.20 ## explicit github.com/Azure/go-autorest/autorest/adal # github.com/Azure/go-autorest/autorest/azure/auth v0.5.8 @@ -501,7 +501,7 @@ github.com/storageos/go-api/serror github.com/storageos/go-api/types # github.com/stretchr/objx v0.2.0 github.com/stretchr/objx -# github.com/stretchr/testify v1.7.1 +# github.com/stretchr/testify v1.7.2 ## explicit github.com/stretchr/testify/assert github.com/stretchr/testify/mock @@ -847,7 +847,7 @@ gopkg.in/warnings.v0 # gopkg.in/yaml.v2 v2.4.0 ## explicit gopkg.in/yaml.v2 -# gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b +# gopkg.in/yaml.v3 v3.0.1 gopkg.in/yaml.v3 # k8s.io/api v0.25.0-alpha.0 => k8s.io/api v0.25.0-alpha.0 ## explicit @@ -1464,7 +1464,7 @@ k8s.io/kube-scheduler/config/v1beta3 k8s.io/kube-scheduler/extender/v1 # k8s.io/kubectl v0.0.0 => k8s.io/kubectl v0.25.0-alpha.0 k8s.io/kubectl/pkg/scale -# k8s.io/kubelet v0.24.0 => k8s.io/kubelet v0.25.0-alpha.0 +# k8s.io/kubelet v0.24.1 => k8s.io/kubelet v0.25.0-alpha.0 ## explicit k8s.io/kubelet/config/v1alpha1 k8s.io/kubelet/config/v1beta1 @@ -1822,7 +1822,7 @@ k8s.io/utils/trace # sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30 sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client -# sigs.k8s.io/cloud-provider-azure v1.23.11 +# sigs.k8s.io/cloud-provider-azure v1.24.2 ## explicit sigs.k8s.io/cloud-provider-azure/pkg/auth sigs.k8s.io/cloud-provider-azure/pkg/azureclients @@ -1840,6 +1840,8 @@ sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/mockloadbal sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednsclient sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient +sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient +sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/mockprivatelinkserviceclient sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/mockpublicipclient sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient @@ -1869,6 +1871,7 @@ sigs.k8s.io/cloud-provider-azure/pkg/consts sigs.k8s.io/cloud-provider-azure/pkg/metrics sigs.k8s.io/cloud-provider-azure/pkg/nodemanager sigs.k8s.io/cloud-provider-azure/pkg/provider +sigs.k8s.io/cloud-provider-azure/pkg/provider/virtualmachine sigs.k8s.io/cloud-provider-azure/pkg/retry sigs.k8s.io/cloud-provider-azure/pkg/version # sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/auth/azure_auth.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/auth/azure_auth.go index 730a0a2c5b33..c641f5cd03e3 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/auth/azure_auth.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/auth/azure_auth.go @@ -100,6 +100,17 @@ func GetServicePrincipalToken(config *AzureAuthConfig, env *azure.Environment, r } if len(config.UserAssignedIdentityID) > 0 { klog.V(4).Info("azure: using User Assigned MSI ID to retrieve access token") + resourceID, err := azure.ParseResourceID(config.UserAssignedIdentityID) + if err == nil && + strings.EqualFold(resourceID.Provider, "Microsoft.ManagedIdentity") && + strings.EqualFold(resourceID.ResourceType, "userAssignedIdentities") { + klog.V(4).Info("azure: User Assigned MSI ID is resource ID") + return adal.NewServicePrincipalTokenFromMSIWithIdentityResourceID(msiEndpoint, + resource, + config.UserAssignedIdentityID) + } + + klog.V(4).Info("azure: User Assigned MSI ID is client ID. Resource ID parsing error: %+v", err) return adal.NewServicePrincipalTokenFromMSIWithUserAssignedID(msiEndpoint, resource, config.UserAssignedIdentityID) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/azure_armclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/azure_armclient.go index fe10dd466dd2..ce3ae2374fa0 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/azure_armclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/azure_armclient.go @@ -17,14 +17,10 @@ limitations under the License. package armclient import ( - "bytes" "context" - "encoding/json" "fmt" "html" - "io/ioutil" "net/http" - "net/http/httputil" "net/url" "strings" "sync" @@ -99,6 +95,7 @@ func New(authorizer autorest.Authorizer, clientConfig azureclients.ClientConfig, autorest.DoCloseIfError(), retry.DoExponentialBackoffRetry(backoff), DoHackRegionalRetryDecorator(client), + DoDumpRequest(10), ) client.client.Sender = autorest.DecorateSender(client.client.Sender, sendDecoraters...) @@ -126,71 +123,6 @@ func NormalizeAzureRegion(name string) string { return strings.ToLower(region) } -// DoExponentialBackoffRetry returns an autorest.SendDecorator which performs retry with customizable backoff policy. -func DoHackRegionalRetryDecorator(c *Client) autorest.SendDecorator { - return func(s autorest.Sender) autorest.Sender { - return autorest.SenderFunc(func(request *http.Request) (*http.Response, error) { - response, rerr := s.Do(request) - if response == nil { - klog.V(2).Infof("response is empty") - return response, rerr - } - if rerr == nil || response.StatusCode == http.StatusNotFound || c.regionalEndpoint == "" { - return response, rerr - } - // Hack: retry the regional ARM endpoint in case of ARM traffic split and arm resource group replication is too slow - bodyBytes, _ := ioutil.ReadAll(response.Body) - defer func() { - response.Body = ioutil.NopCloser(bytes.NewBuffer(bodyBytes)) - }() - - bodyString := string(bodyBytes) - var body map[string]interface{} - if e := json.Unmarshal(bodyBytes, &body); e != nil { - klog.Errorf("Send.sendRequest: error in parsing response body string: %s, Skip retrying regional host", e.Error()) - return response, rerr - } - klog.V(5).Infof("Send.sendRequest original response: %s", bodyString) - - if err, ok := body["error"].(map[string]interface{}); !ok || - err["code"] == nil || - !strings.EqualFold(err["code"].(string), "ResourceGroupNotFound") { - klog.V(5).Infof("Send.sendRequest: response body does not contain ResourceGroupNotFound error code. Skip retrying regional host") - return response, rerr - } - - currentHost := request.URL.Host - if request.Host != "" { - currentHost = request.Host - } - - if strings.HasPrefix(strings.ToLower(currentHost), c.regionalEndpoint) { - klog.V(5).Infof("Send.sendRequest: current host %s is regional host. Skip retrying regional host.", html.EscapeString(currentHost)) - return response, rerr - } - - request.Host = c.regionalEndpoint - request.URL.Host = c.regionalEndpoint - klog.V(5).Infof("Send.sendRegionalRequest on ResourceGroupNotFound error. Retrying regional host: %s", html.EscapeString(request.Host)) - - regionalResponse, regionalError := s.Do(request) - // only use the result if the regional request actually goes through and returns 2xx status code, for two reasons: - // 1. the retry on regional ARM host approach is a hack. - // 2. the concatenated regional uri could be wrong as the rule is not officially declared by ARM. - if regionalResponse == nil || regionalResponse.StatusCode > 299 { - regionalErrStr := "" - if regionalError != nil { - regionalErrStr = regionalError.Error() - } - - klog.V(5).Infof("Send.sendRegionalRequest failed to get response from regional host, error: '%s'. Ignoring the result.", regionalErrStr) - return response, rerr - } - return regionalResponse, regionalError - }) - } -} - // Send sends a http request to ARM service with possible retry to regional ARM endpoint. func (c *Client) Send(ctx context.Context, request *http.Request, decorators ...autorest.SendDecorator) (*http.Response, *retry.Error) { response, err := autorest.SendWithSender( @@ -206,19 +138,6 @@ func (c *Client) Send(ctx context.Context, request *http.Request, decorators ... return response, retry.GetError(response, err) } -func dumpRequest(req *http.Request, v klog.Level) { - if req == nil { - return - } - - requestDump, err := httputil.DumpRequest(req, true) - if err != nil { - klog.Errorf("Failed to dump request: %v", err) - } else { - klog.V(v).Infof("Dumping request: %s", string(requestDump)) - } -} - // PreparePutRequest prepares put request func (c *Client) PreparePutRequest(ctx context.Context, decorators ...autorest.PrepareDecorator) (*http.Request, error) { decorators = append( @@ -305,8 +224,7 @@ func (c *Client) WaitForAsyncOperationCompletion(ctx context.Context, future *az // WaitForAsyncOperationResult waits for an operation result. func (c *Client) WaitForAsyncOperationResult(ctx context.Context, future *azure.Future, asyncOperationName string) (*http.Response, error) { - err := c.WaitForAsyncOperationCompletion(ctx, future, asyncOperationName) - if err != nil { + if err := future.WaitForCompletionRef(ctx, c.client); err != nil { klog.V(5).Infof("Received error in WaitForAsyncOperationCompletion: '%v'", err) return nil, err } @@ -317,13 +235,13 @@ func (c *Client) WaitForAsyncOperationResult(ctx context.Context, future *azure. func (c *Client) SendAsync(ctx context.Context, request *http.Request) (*azure.Future, *http.Response, *retry.Error) { asyncResponse, rerr := c.Send(ctx, request) if rerr != nil { - klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "sendAsync.send", request.URL.String(), rerr.Error()) + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "sendAsync.send", html.EscapeString(request.URL.String()), rerr.Error()) return nil, nil, rerr } future, err := azure.NewFutureFromResponse(asyncResponse) if err != nil { - klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "sendAsync.respond", request.URL.String(), err) + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "sendAsync.respond", html.EscapeString(request.URL.String()), err) return nil, asyncResponse, retry.GetError(asyncResponse, err) } @@ -357,73 +275,30 @@ func (c *Client) GetResource(ctx context.Context, resourceID string, decorators } // PutResource puts a resource by resource ID -func (c *Client) PutResource(ctx context.Context, resourceID string, parameters interface{}) (*http.Response, *retry.Error) { - putDecorators := []autorest.PrepareDecorator{ - autorest.WithPathParameters("{resourceID}", map[string]interface{}{"resourceID": resourceID}), - autorest.WithJSON(parameters), - } - return c.PutResourceWithDecorators(ctx, resourceID, parameters, putDecorators) -} - -func (c *Client) waitAsync(ctx context.Context, futures map[string]*azure.Future, previousResponses map[string]*PutResourcesResponse) { - wg := sync.WaitGroup{} - var responseLock sync.Mutex - for resourceID, future := range futures { - wg.Add(1) - go func(resourceID string, future *azure.Future) { - defer wg.Done() - response, err := c.WaitForAsyncOperationResult(ctx, future, "armclient.PutResource") - if err != nil { - if response != nil { - klog.V(5).Infof("Received error in WaitForAsyncOperationResult: '%s', response code %d", err.Error(), response.StatusCode) - } else { - klog.V(5).Infof("Received error in WaitForAsyncOperationResult: '%s', no response", err.Error()) - } - - retriableErr := retry.GetError(response, err) - if !retriableErr.Retriable && - strings.Contains(strings.ToUpper(err.Error()), strings.ToUpper("InternalServerError")) { - klog.V(5).Infof("Received InternalServerError in WaitForAsyncOperationResult: '%s', setting error retriable", err.Error()) - retriableErr.Retriable = true - } - - responseLock.Lock() - previousResponses[resourceID] = &PutResourcesResponse{ - Error: retriableErr, - } - responseLock.Unlock() - return - } - }(resourceID, future) +func (c *Client) PutResource(ctx context.Context, resourceID string, parameters interface{}, decorators ...autorest.PrepareDecorator) (*http.Response, *retry.Error) { + future, rerr := c.PutResourceAsync(ctx, resourceID, parameters, decorators...) + if rerr != nil { + return nil, rerr } - wg.Wait() -} -// PutResources puts a list of resources from resources map[resourceID]parameters. -// Those resources sync requests are sequential while async requests are concurrent. It's especially -// useful when the ARM API doesn't support concurrent requests. -func (c *Client) PutResources(ctx context.Context, resources map[string]interface{}) map[string]*PutResourcesResponse { - if len(resources) == 0 { - return nil - } + response, err := c.WaitForAsyncOperationResult(ctx, future, "armclient.PutResource") + if err != nil { + if response != nil { + klog.V(5).Infof("Received error in WaitForAsyncOperationResult: '%s', response code %d", err.Error(), response.StatusCode) + } else { + klog.V(5).Infof("Received error in WaitForAsyncOperationResult: '%s', no response", err.Error()) + } - // Sequential sync requests. - futures := make(map[string]*azure.Future) - responses := make(map[string]*PutResourcesResponse) - for resourceID, parameters := range resources { - future, rerr := c.PutResourceAsync(ctx, resourceID, parameters) - if rerr != nil { - responses[resourceID] = &PutResourcesResponse{ - Error: rerr, - } - continue + retriableErr := retry.GetError(response, err) + if !retriableErr.Retriable && + strings.Contains(strings.ToUpper(err.Error()), strings.ToUpper("InternalServerError")) { + klog.V(5).Infof("Received InternalServerError in WaitForAsyncOperationResult: '%s', setting error retriable", err.Error()) + retriableErr.Retriable = true } - futures[resourceID] = future + return nil, retriableErr } - c.waitAsync(ctx, futures, responses) - - return responses + return response, nil } // PutResourcesInBatches is similar with PutResources, but it sends sync request concurrently in batches. @@ -434,7 +309,7 @@ func (c *Client) PutResourcesInBatches(ctx context.Context, resources map[string if batchSize <= 0 { klog.V(4).Infof("PutResourcesInBatches: batch size %d, put resources in sequence", batchSize) - return c.PutResources(ctx, resources) + batchSize = 1 } if batchSize > len(resources) { @@ -443,115 +318,39 @@ func (c *Client) PutResourcesInBatches(ctx context.Context, resources map[string } klog.V(4).Infof("PutResourcesInBatches: send sync requests in parallel with the batch size %d", batchSize) - // Convert map to slice because it is more straightforward to - // loop over slice in batches than map. - type resourcesMeta struct { - resourceID string - parameters interface{} - } - resourcesList := make([]resourcesMeta, 0) - for resourceID, parameters := range resources { - resourcesList = append(resourcesList, resourcesMeta{ - resourceID: resourceID, - parameters: parameters, - }) - } + rateLimiter := make(chan struct{}, batchSize) // Concurrent sync requests in batches. - futures := make(map[string]*azure.Future) responses := make(map[string]*PutResourcesResponse) wg := sync.WaitGroup{} - var responseLock, futuresLock sync.Mutex - for i := 0; i < len(resourcesList); i += batchSize { - j := i + batchSize - if j > len(resourcesList) { - j = len(resourcesList) - } - - for k := i; k < j; k++ { - wg.Add(1) - go func(resourceID string, parameters interface{}) { - defer wg.Done() - future, rerr := c.PutResourceAsync(ctx, resourceID, parameters) - if rerr != nil { - responseLock.Lock() - responses[resourceID] = &PutResourcesResponse{ - Error: rerr, - } - responseLock.Unlock() - return - } - - futuresLock.Lock() - futures[resourceID] = future - futuresLock.Unlock() - }(resourcesList[k].resourceID, resourcesList[k].parameters) - } - wg.Wait() + var responseLock sync.Mutex + for resourceID, parameters := range resources { + rateLimiter <- struct{}{} + wg.Add(1) + go func(resourceID string, parameters interface{}) { + defer wg.Done() + defer func() { <-rateLimiter }() + resp, rerr := c.PutResource(ctx, resourceID, parameters) + responseLock.Lock() + defer responseLock.Unlock() + responses[resourceID] = &PutResourcesResponse{ + Error: rerr, + Response: resp, + } + }(resourceID, parameters) } - - // Concurrent async requests. - c.waitAsync(ctx, futures, responses) + wg.Wait() + close(rateLimiter) return responses } -// PutResourceWithDecorators puts a resource by resource ID -func (c *Client) PutResourceWithDecorators(ctx context.Context, resourceID string, parameters interface{}, decorators []autorest.PrepareDecorator) (*http.Response, *retry.Error) { - request, err := c.PreparePutRequest(ctx, decorators...) - dumpRequest(request, 10) - if err != nil { - klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "put.prepare", resourceID, err) - return nil, retry.NewError(false, err) - } - - future, resp, clientErr := c.SendAsync(ctx, request) - defer c.CloseResponse(ctx, resp) - if clientErr != nil { - klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "put.send", resourceID, clientErr.Error()) - return nil, clientErr - } - - response, err := c.WaitForAsyncOperationResult(ctx, future, "armclient.PutResource") - if err != nil { - if response != nil { - klog.V(5).Infof("Received error in WaitForAsyncOperationResult: '%s', response code %d", err.Error(), response.StatusCode) - } else { - klog.V(5).Infof("Received error in WaitForAsyncOperationResult: '%s', no response", err.Error()) - } - - retriableErr := retry.GetError(response, err) - if !retriableErr.Retriable && - strings.Contains(strings.ToUpper(err.Error()), strings.ToUpper("InternalServerError")) { - klog.V(5).Infof("Received InternalServerError in WaitForAsyncOperationResult: '%s', setting error retriable", err.Error()) - retriableErr.Retriable = true - } - return nil, retriableErr - } - - return response, nil -} - // PatchResource patches a resource by resource ID -func (c *Client) PatchResource(ctx context.Context, resourceID string, parameters interface{}) (*http.Response, *retry.Error) { - decorators := []autorest.PrepareDecorator{ - autorest.WithPathParameters("{resourceID}", map[string]interface{}{"resourceID": resourceID}), - autorest.WithJSON(parameters), - } - - request, err := c.PreparePatchRequest(ctx, decorators...) - if err != nil { - klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "patch.prepare", resourceID, err) - return nil, retry.NewError(false, err) - } - - future, resp, clientErr := c.SendAsync(ctx, request) - defer c.CloseResponse(ctx, resp) - if clientErr != nil { - klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "patch.send", resourceID, clientErr.Error()) - return nil, clientErr +func (c *Client) PatchResource(ctx context.Context, resourceID string, parameters interface{}, decorators ...autorest.PrepareDecorator) (*http.Response, *retry.Error) { + future, rerr := c.PatchResourceAsync(ctx, resourceID, parameters, decorators...) + if rerr != nil { + return nil, rerr } - response, err := c.WaitForAsyncOperationResult(ctx, future, "armclient.PatchResource") if err != nil { if response != nil { @@ -573,11 +372,11 @@ func (c *Client) PatchResource(ctx context.Context, resourceID string, parameter } // PatchResourceAsync patches a resource by resource ID asynchronously -func (c *Client) PatchResourceAsync(ctx context.Context, resourceID string, parameters interface{}) (*azure.Future, *retry.Error) { - decorators := []autorest.PrepareDecorator{ +func (c *Client) PatchResourceAsync(ctx context.Context, resourceID string, parameters interface{}, decorators ...autorest.PrepareDecorator) (*azure.Future, *retry.Error) { + decorators = append(decorators, autorest.WithPathParameters("{resourceID}", map[string]interface{}{"resourceID": resourceID}), autorest.WithJSON(parameters), - } + ) request, err := c.PreparePatchRequest(ctx, decorators...) if err != nil { @@ -595,14 +394,13 @@ func (c *Client) PatchResourceAsync(ctx context.Context, resourceID string, para } // PutResourceAsync puts a resource by resource ID in async mode -func (c *Client) PutResourceAsync(ctx context.Context, resourceID string, parameters interface{}) (*azure.Future, *retry.Error) { - decorators := []autorest.PrepareDecorator{ +func (c *Client) PutResourceAsync(ctx context.Context, resourceID string, parameters interface{}, decorators ...autorest.PrepareDecorator) (*azure.Future, *retry.Error) { + decorators = append(decorators, autorest.WithPathParameters("{resourceID}", map[string]interface{}{"resourceID": resourceID}), autorest.WithJSON(parameters), - } + ) request, err := c.PreparePutRequest(ctx, decorators...) - dumpRequest(request, 10) if err != nil { klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "put.prepare", resourceID, err) return nil, retry.NewError(false, err) @@ -643,8 +441,8 @@ func (c *Client) PostResource(ctx context.Context, resourceID, action string, pa } // DeleteResource deletes a resource by resource ID -func (c *Client) DeleteResource(ctx context.Context, resourceID, ifMatch string) *retry.Error { - future, clientErr := c.DeleteResourceAsync(ctx, resourceID, ifMatch) +func (c *Client) DeleteResource(ctx context.Context, resourceID string, decorators ...autorest.PrepareDecorator) *retry.Error { + future, clientErr := c.DeleteResourceAsync(ctx, resourceID) if clientErr != nil { klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "delete.request", resourceID, clientErr.Error()) return clientErr @@ -653,8 +451,7 @@ func (c *Client) DeleteResource(ctx context.Context, resourceID, ifMatch string) if future == nil { return nil } - - if err := c.WaitForAsyncOperationCompletion(ctx, future, "armclient.DeleteResource"); err != nil { + if err := future.WaitForCompletionRef(ctx, c.client); err != nil { klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "delete.wait", resourceID, clientErr.Error()) return retry.NewError(true, err) } @@ -677,13 +474,10 @@ func (c *Client) HeadResource(ctx context.Context, resourceID string) (*http.Res } // DeleteResourceAsync delete a resource by resource ID and returns a future representing the async result -func (c *Client) DeleteResourceAsync(ctx context.Context, resourceID, ifMatch string) (*azure.Future, *retry.Error) { - decorators := []autorest.PrepareDecorator{ +func (c *Client) DeleteResourceAsync(ctx context.Context, resourceID string, decorators ...autorest.PrepareDecorator) (*azure.Future, *retry.Error) { + decorators = append(decorators, autorest.WithPathParameters("{resourceID}", map[string]interface{}{"resourceID": resourceID}), - } - if len(ifMatch) > 0 { - decorators = append(decorators, autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } + ) deleteRequest, err := c.PrepareDeleteRequest(ctx, decorators...) if err != nil { @@ -768,6 +562,14 @@ func GetResourceID(subscriptionID, resourceGroupName, resourceType, resourceName autorest.Encode("path", resourceName)) } +// GetResourceListID gets Azure resource list ID +func GetResourceListID(subscriptionID, resourceGroupName, resourceType string) string { + return fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/%s", + autorest.Encode("path", subscriptionID), + autorest.Encode("path", resourceGroupName), + resourceType) +} + // GetChildResourceID gets Azure child resource ID func GetChildResourceID(subscriptionID, resourceGroupName, resourceType, resourceName, childResourceType, childResourceName string) string { return fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/%s/%s/%s/%s", diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/interface.go index 4ce0ab0858e1..ae8cbb4d2cee 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/interface.go @@ -63,27 +63,19 @@ type Interface interface { SendAsync(ctx context.Context, request *http.Request) (*azure.Future, *http.Response, *retry.Error) // PutResource puts a resource by resource ID - PutResource(ctx context.Context, resourceID string, parameters interface{}) (*http.Response, *retry.Error) + PutResource(ctx context.Context, resourceID string, parameters interface{}, decorators ...autorest.PrepareDecorator) (*http.Response, *retry.Error) - // PutResources puts a list of resources from resources map[resourceID]parameters. - // Those resources sync requests are sequential while async requests are concurrent. It 's especially - // useful when the ARM API doesn't support concurrent requests. - PutResources(ctx context.Context, resources map[string]interface{}) map[string]*PutResourcesResponse + // PutResourceAsync puts a resource by resource ID in async mode + PutResourceAsync(ctx context.Context, resourceID string, parameters interface{}, decorators ...autorest.PrepareDecorator) (*azure.Future, *retry.Error) // PutResourcesInBatches is similar with PutResources, but it sends sync request concurrently in batches. PutResourcesInBatches(ctx context.Context, resources map[string]interface{}, batchSize int) map[string]*PutResourcesResponse - // PutResourceWithDecorators puts a resource with decorators by resource ID - PutResourceWithDecorators(ctx context.Context, resourceID string, parameters interface{}, decorators []autorest.PrepareDecorator) (*http.Response, *retry.Error) - // PatchResource patches a resource by resource ID - PatchResource(ctx context.Context, resourceID string, parameters interface{}) (*http.Response, *retry.Error) + PatchResource(ctx context.Context, resourceID string, parameters interface{}, decorators ...autorest.PrepareDecorator) (*http.Response, *retry.Error) // PatchResourceAsync patches a resource by resource ID asynchronously - PatchResourceAsync(ctx context.Context, resourceID string, parameters interface{}) (*azure.Future, *retry.Error) - - // PutResourceAsync puts a resource by resource ID in async mode - PutResourceAsync(ctx context.Context, resourceID string, parameters interface{}) (*azure.Future, *retry.Error) + PatchResourceAsync(ctx context.Context, resourceID string, parameters interface{}, decorators ...autorest.PrepareDecorator) (*azure.Future, *retry.Error) // HeadResource heads a resource by resource ID HeadResource(ctx context.Context, resourceID string) (*http.Response, *retry.Error) @@ -98,10 +90,10 @@ type Interface interface { PostResource(ctx context.Context, resourceID, action string, parameters interface{}, queryParameters map[string]interface{}) (*http.Response, *retry.Error) // DeleteResource deletes a resource by resource ID - DeleteResource(ctx context.Context, resourceID, ifMatch string) *retry.Error + DeleteResource(ctx context.Context, resourceID string, decorators ...autorest.PrepareDecorator) *retry.Error // DeleteResourceAsync delete a resource by resource ID and returns a future representing the async result - DeleteResourceAsync(ctx context.Context, resourceID, ifMatch string) (*azure.Future, *retry.Error) + DeleteResourceAsync(ctx context.Context, resourceID string, decorators ...autorest.PrepareDecorator) (*azure.Future, *retry.Error) // CloseResponse closes a response CloseResponse(ctx context.Context, response *http.Response) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/util.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/util.go new file mode 100644 index 000000000000..582a235f9f38 --- /dev/null +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/util.go @@ -0,0 +1,169 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package armclient + +import ( + "bytes" + "encoding/json" + "fmt" + "html" + "io/ioutil" + "net/http" + "net/http/httputil" + "strings" + "time" + + "github.com/Azure/go-autorest/autorest" + "k8s.io/client-go/util/flowcontrol" + "k8s.io/klog/v2" + "sigs.k8s.io/cloud-provider-azure/pkg/metrics" + "sigs.k8s.io/cloud-provider-azure/pkg/retry" +) + +func NewRateLimitSendDecorater(ratelimiter flowcontrol.RateLimiter, mc *metrics.MetricContext) autorest.SendDecorator { + return func(s autorest.Sender) autorest.Sender { + return autorest.SenderFunc(func(r *http.Request) (*http.Response, error) { + if !ratelimiter.TryAccept() { + mc.RateLimitedCount() + return nil, fmt.Errorf("rate limit reached") + } + return s.Do(r) + }) + } +} + +func NewThrottledSendDecorater(mc *metrics.MetricContext) autorest.SendDecorator { + var retryTimer time.Time + return func(s autorest.Sender) autorest.Sender { + return autorest.SenderFunc(func(r *http.Request) (*http.Response, error) { + if retryTimer.After(time.Now()) { + mc.ThrottledCount() + return nil, fmt.Errorf("request is throttled") + } + resp, err := s.Do(r) + rerr := retry.GetError(resp, err) + if rerr.IsThrottled() { + // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. + retryTimer = rerr.RetryAfter + } + return resp, err + }) + } +} + +func NewErrorCounterSendDecorator(mc *metrics.MetricContext) autorest.SendDecorator { + return func(s autorest.Sender) autorest.Sender { + return autorest.SenderFunc(func(r *http.Request) (*http.Response, error) { + resp, err := s.Do(r) + rerr := retry.GetError(resp, err) + mc.Observe(rerr) + return resp, err + }) + } +} + +func DoDumpRequest(v klog.Level) autorest.SendDecorator { + return func(s autorest.Sender) autorest.Sender { + + return autorest.SenderFunc(func(request *http.Request) (*http.Response, error) { + if request != nil { + requestDump, err := httputil.DumpRequest(request, true) + if err != nil { + klog.Errorf("Failed to dump request: %v", err) + } else { + klog.V(v).Infof("Dumping request: %s", string(requestDump)) + } + } + return s.Do(request) + }) + } +} + +func WithMetricsSendDecoratorWrapper(prefix, request, resourceGroup, subscriptionID, source string, factory func(mc *metrics.MetricContext) []autorest.SendDecorator) autorest.SendDecorator { + mc := metrics.NewMetricContext(prefix, request, resourceGroup, subscriptionID, source) + if factory != nil { + return func(s autorest.Sender) autorest.Sender { + return autorest.DecorateSender(s, factory(mc)...) + } + } + return nil +} + +// DoExponentialBackoffRetry returns an autorest.SendDecorator which performs retry with customizable backoff policy. +func DoHackRegionalRetryDecorator(c *Client) autorest.SendDecorator { + return func(s autorest.Sender) autorest.Sender { + return autorest.SenderFunc(func(request *http.Request) (*http.Response, error) { + response, rerr := s.Do(request) + if response == nil { + klog.V(2).Infof("response is empty") + return response, rerr + } + if rerr == nil || response.StatusCode == http.StatusNotFound || c.regionalEndpoint == "" { + return response, rerr + } + // Hack: retry the regional ARM endpoint in case of ARM traffic split and arm resource group replication is too slow + bodyBytes, _ := ioutil.ReadAll(response.Body) + defer func() { + response.Body = ioutil.NopCloser(bytes.NewBuffer(bodyBytes)) + }() + + bodyString := string(bodyBytes) + var body map[string]interface{} + if e := json.Unmarshal(bodyBytes, &body); e != nil { + klog.Errorf("Send.sendRequest: error in parsing response body string: %s, Skip retrying regional host", e.Error()) + return response, rerr + } + klog.V(5).Infof("Send.sendRequest original response: %s", bodyString) + + if err, ok := body["error"].(map[string]interface{}); !ok || + err["code"] == nil || + !strings.EqualFold(err["code"].(string), "ResourceGroupNotFound") { + klog.V(5).Infof("Send.sendRequest: response body does not contain ResourceGroupNotFound error code. Skip retrying regional host") + return response, rerr + } + + currentHost := request.URL.Host + if request.Host != "" { + currentHost = request.Host + } + + if strings.HasPrefix(strings.ToLower(currentHost), c.regionalEndpoint) { + klog.V(5).Infof("Send.sendRequest: current host %s is regional host. Skip retrying regional host.", html.EscapeString(currentHost)) + return response, rerr + } + + request.Host = c.regionalEndpoint + request.URL.Host = c.regionalEndpoint + klog.V(5).Infof("Send.sendRegionalRequest on ResourceGroupNotFound error. Retrying regional host: %s", html.EscapeString(request.Host)) + + regionalResponse, regionalError := s.Do(request) + // only use the result if the regional request actually goes through and returns 2xx status code, for two reasons: + // 1. the retry on regional ARM host approach is a hack. + // 2. the concatenated regional uri could be wrong as the rule is not officially declared by ARM. + if regionalResponse == nil || regionalResponse.StatusCode > 299 { + regionalErrStr := "" + if regionalError != nil { + regionalErrStr = regionalError.Error() + } + + klog.V(5).Infof("Send.sendRegionalRequest failed to get response from regional host, error: '%s'. Ignoring the result.", regionalErrStr) + return response, rerr + } + return regionalResponse, regionalError + }) + } +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/containerserviceclient/azure_containerserviceclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/containerserviceclient/azure_containerserviceclient.go index 22f9a45e4f9a..c5ded7221de0 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/containerserviceclient/azure_containerserviceclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/containerserviceclient/azure_containerserviceclient.go @@ -18,7 +18,6 @@ package containerserviceclient import ( "context" - "fmt" "net/http" "time" @@ -38,6 +37,8 @@ import ( var _ Interface = &Client{} +const managedClusterResourceType = "Microsoft.ContainerService/managedClusters" + // Client implements ContainerService client Interface. type Client struct { armClient armclient.Interface @@ -121,7 +122,7 @@ func (c *Client) getManagedCluster(ctx context.Context, resourceGroupName string resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.ContainerService/managedClusters", + managedClusterResourceType, managedClusterName, ) result := containerservice.ManagedCluster{} @@ -179,9 +180,7 @@ func (c *Client) List(ctx context.Context, resourceGroupName string) ([]containe // listManagedCluster gets a list of ManagedClusters in the resource group. func (c *Client) listManagedCluster(ctx context.Context, resourceGroupName string) ([]containerservice.ManagedCluster, *retry.Error) { - resourceID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters", - autorest.Encode("path", c.subscriptionID), - autorest.Encode("path", resourceGroupName)) + resourceID := armclient.GetResourceListID(c.subscriptionID, resourceGroupName, managedClusterResourceType) result := make([]containerservice.ManagedCluster, 0) page := &ManagedClusterResultPage{} page.fn = c.listNextResults @@ -343,18 +342,15 @@ func (c *Client) createOrUpdateManagedCluster(ctx context.Context, resourceGroup resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.ContainerService/managedClusters", + managedClusterResourceType, managedClusterName, ) - decorators := []autorest.PrepareDecorator{ - autorest.WithPathParameters("{resourceID}", map[string]interface{}{"resourceID": resourceID}), - autorest.WithJSON(parameters), - } + decorators := []autorest.PrepareDecorator{} if etag != "" { decorators = append(decorators, autorest.WithHeader("If-Match", autorest.String(etag))) } - response, rerr := c.armClient.PutResourceWithDecorators(ctx, resourceID, parameters, decorators) + response, rerr := c.armClient.PutResource(ctx, resourceID, parameters, decorators...) defer c.armClient.CloseResponse(ctx, response) if rerr != nil { klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "managedCluster.put.request", resourceID, rerr.Error()) @@ -418,9 +414,9 @@ func (c *Client) deleteManagedCluster(ctx context.Context, resourceGroupName str resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.ContainerService/managedClusters", + managedClusterResourceType, managedClusterName, ) - return c.armClient.DeleteResource(ctx, resourceID, "") + return c.armClient.DeleteResource(ctx, resourceID) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/deploymentclient/azure_deploymentclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/deploymentclient/azure_deploymentclient.go index c0bffa7ee6dc..e0012660801a 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/deploymentclient/azure_deploymentclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/deploymentclient/azure_deploymentclient.go @@ -18,7 +18,6 @@ package deploymentclient import ( "context" - "fmt" "net/http" "time" @@ -38,6 +37,8 @@ import ( var _ Interface = &Client{} +const deploymentResourceType = "Microsoft.Resources/deployments" + // Client implements ContainerService client Interface. type Client struct { armClient armclient.Interface @@ -114,7 +115,7 @@ func (c *Client) getDeployment(ctx context.Context, resourceGroupName string, de resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Resources/deployments", + deploymentResourceType, deploymentName, ) result := resources.DeploymentExtended{} @@ -172,9 +173,7 @@ func (c *Client) List(ctx context.Context, resourceGroupName string) ([]resource // listDeployment gets a list of deployments in the resource group. func (c *Client) listDeployment(ctx context.Context, resourceGroupName string) ([]resources.DeploymentExtended, *retry.Error) { - resourceID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Resources/deployments", - autorest.Encode("path", c.subscriptionID), - autorest.Encode("path", resourceGroupName)) + resourceID := armclient.GetResourceListID(c.subscriptionID, resourceGroupName, deploymentResourceType) result := make([]resources.DeploymentExtended, 0) page := &DeploymentResultPage{} page.fn = c.listNextResults @@ -335,18 +334,15 @@ func (c *Client) createOrUpdateDeployment(ctx context.Context, resourceGroupName resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Resources/deployments", + deploymentResourceType, deploymentName, ) - decorators := []autorest.PrepareDecorator{ - autorest.WithPathParameters("{resourceID}", map[string]interface{}{"resourceID": resourceID}), - autorest.WithJSON(parameters), - } + decorators := []autorest.PrepareDecorator{} if etag != "" { decorators = append(decorators, autorest.WithHeader("If-Match", autorest.String(etag))) } - response, rerr := c.armClient.PutResourceWithDecorators(ctx, resourceID, parameters, decorators) + response, rerr := c.armClient.PutResource(ctx, resourceID, parameters, decorators...) defer c.armClient.CloseResponse(ctx, response) if rerr != nil { klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "deployment.put.request", resourceID, rerr.Error()) @@ -410,11 +406,11 @@ func (c *Client) deleteDeployment(ctx context.Context, resourceGroupName string, resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Resources/deployments", + deploymentResourceType, deploymentName, ) - return c.armClient.DeleteResource(ctx, resourceID, "") + return c.armClient.DeleteResource(ctx, resourceID) } // ExportTemplate exports the template used for specified deployment @@ -434,10 +430,12 @@ func (c *Client) ExportTemplate(ctx context.Context, resourceGroupName string, d return resources.DeploymentExportResult{}, rerr } - resourceID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Resources/deployments/%s/exportTemplate", - autorest.Encode("path", c.subscriptionID), - autorest.Encode("path", resourceGroupName), - autorest.Encode("path", deploymentName)) + resourceID := armclient.GetResourceID( + c.subscriptionID, + resourceGroupName, + deploymentResourceType, + deploymentName, + ) response, rerr := c.armClient.PostResource(ctx, resourceID, "exportTemplate", struct{}{}, map[string]interface{}{}) defer c.armClient.CloseResponse(ctx, response) if rerr != nil { diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/azure_diskclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/azure_diskclient.go index 5c9911aca6c8..53937f2a393c 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/azure_diskclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/azure_diskclient.go @@ -18,7 +18,6 @@ package diskclient import ( "context" - "fmt" "net/http" "strings" "time" @@ -39,6 +38,8 @@ import ( var _ Interface = &Client{} +const diskResourceType = "Microsoft.Compute/disks" + // Client implements Disk client Interface. type Client struct { armClient armclient.Interface @@ -89,8 +90,11 @@ func New(config *azclients.ClientConfig) *Client { } // Get gets a Disk. -func (c *Client) Get(ctx context.Context, resourceGroupName string, diskName string) (compute.Disk, *retry.Error) { - mc := metrics.NewMetricContext("disks", "get", resourceGroupName, c.subscriptionID, "") +func (c *Client) Get(ctx context.Context, subsID, resourceGroupName, diskName string) (compute.Disk, *retry.Error) { + if subsID == "" { + subsID = c.subscriptionID + } + mc := metrics.NewMetricContext("disks", "get", resourceGroupName, subsID, "") // Report errors if the client is rate limited. if !c.rateLimiterReader.TryAccept() { @@ -105,7 +109,7 @@ func (c *Client) Get(ctx context.Context, resourceGroupName string, diskName str return compute.Disk{}, rerr } - result, rerr := c.getDisk(ctx, resourceGroupName, diskName) + result, rerr := c.getDisk(ctx, subsID, resourceGroupName, diskName) mc.Observe(rerr) if rerr != nil { if rerr.IsThrottled() { @@ -120,11 +124,11 @@ func (c *Client) Get(ctx context.Context, resourceGroupName string, diskName str } // getDisk gets a Disk. -func (c *Client) getDisk(ctx context.Context, resourceGroupName string, diskName string) (compute.Disk, *retry.Error) { +func (c *Client) getDisk(ctx context.Context, subsID, resourceGroupName, diskName string) (compute.Disk, *retry.Error) { resourceID := armclient.GetResourceID( - c.subscriptionID, + subsID, resourceGroupName, - "Microsoft.Compute/disks", + diskResourceType, diskName, ) result := compute.Disk{} @@ -150,8 +154,11 @@ func (c *Client) getDisk(ctx context.Context, resourceGroupName string, diskName } // CreateOrUpdate creates or updates a Disk. -func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, diskParameter compute.Disk) *retry.Error { - mc := metrics.NewMetricContext("disks", "create_or_update", resourceGroupName, c.subscriptionID, "") +func (c *Client) CreateOrUpdate(ctx context.Context, subsID, resourceGroupName, diskName string, diskParameter compute.Disk) *retry.Error { + if subsID == "" { + subsID = c.subscriptionID + } + mc := metrics.NewMetricContext("disks", "create_or_update", resourceGroupName, subsID, "") // Report errors if the client is rate limited. if !c.rateLimiterWriter.TryAccept() { @@ -166,7 +173,7 @@ func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, d return rerr } - rerr := c.createOrUpdateDisk(ctx, resourceGroupName, diskName, diskParameter) + rerr := c.createOrUpdateDisk(ctx, subsID, resourceGroupName, diskName, diskParameter) mc.Observe(rerr) if rerr != nil { if rerr.IsThrottled() { @@ -181,11 +188,11 @@ func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, d } // createOrUpdateDisk creates or updates a Disk. -func (c *Client) createOrUpdateDisk(ctx context.Context, resourceGroupName string, diskName string, diskParameter compute.Disk) *retry.Error { +func (c *Client) createOrUpdateDisk(ctx context.Context, subsID, resourceGroupName, diskName string, diskParameter compute.Disk) *retry.Error { resourceID := armclient.GetResourceID( - c.subscriptionID, + subsID, resourceGroupName, - "Microsoft.Compute/disks", + diskResourceType, diskName, ) @@ -218,8 +225,11 @@ func (c *Client) createOrUpdateResponder(resp *http.Response) (*compute.Disk, *r } // Update creates or updates a Disk. -func (c *Client) Update(ctx context.Context, resourceGroupName string, diskName string, diskParameter compute.DiskUpdate) *retry.Error { - mc := metrics.NewMetricContext("disks", "update", resourceGroupName, c.subscriptionID, "") +func (c *Client) Update(ctx context.Context, subsID, resourceGroupName, diskName string, diskParameter compute.DiskUpdate) *retry.Error { + if subsID == "" { + subsID = c.subscriptionID + } + mc := metrics.NewMetricContext("disks", "update", resourceGroupName, subsID, "") // Report errors if the client is rate limited. if !c.rateLimiterWriter.TryAccept() { @@ -234,7 +244,7 @@ func (c *Client) Update(ctx context.Context, resourceGroupName string, diskName return rerr } - rerr := c.updateDisk(ctx, resourceGroupName, diskName, diskParameter) + rerr := c.updateDisk(ctx, subsID, resourceGroupName, diskName, diskParameter) mc.Observe(rerr) if rerr != nil { if rerr.IsThrottled() { @@ -249,11 +259,11 @@ func (c *Client) Update(ctx context.Context, resourceGroupName string, diskName } // updateDisk updates a Disk. -func (c *Client) updateDisk(ctx context.Context, resourceGroupName string, diskName string, diskParameter compute.DiskUpdate) *retry.Error { +func (c *Client) updateDisk(ctx context.Context, subsID, resourceGroupName, diskName string, diskParameter compute.DiskUpdate) *retry.Error { resourceID := armclient.GetResourceID( - c.subscriptionID, + subsID, resourceGroupName, - "Microsoft.Compute/disks", + diskResourceType, diskName, ) @@ -286,8 +296,11 @@ func (c *Client) updateResponder(resp *http.Response) (*compute.Disk, *retry.Err } // Delete deletes a Disk by name. -func (c *Client) Delete(ctx context.Context, resourceGroupName string, diskName string) *retry.Error { - mc := metrics.NewMetricContext("disks", "delete", resourceGroupName, c.subscriptionID, "") +func (c *Client) Delete(ctx context.Context, subsID, resourceGroupName, diskName string) *retry.Error { + if subsID == "" { + subsID = c.subscriptionID + } + mc := metrics.NewMetricContext("disks", "delete", resourceGroupName, subsID, "") // Report errors if the client is rate limited. if !c.rateLimiterWriter.TryAccept() { @@ -302,7 +315,7 @@ func (c *Client) Delete(ctx context.Context, resourceGroupName string, diskName return rerr } - rerr := c.deleteDisk(ctx, resourceGroupName, diskName) + rerr := c.deleteDisk(ctx, subsID, resourceGroupName, diskName) mc.Observe(rerr) if rerr != nil { if rerr.IsThrottled() { @@ -317,22 +330,23 @@ func (c *Client) Delete(ctx context.Context, resourceGroupName string, diskName } // deleteDisk deletes a PublicIPAddress by name. -func (c *Client) deleteDisk(ctx context.Context, resourceGroupName string, diskName string) *retry.Error { +func (c *Client) deleteDisk(ctx context.Context, subsID, resourceGroupName string, diskName string) *retry.Error { resourceID := armclient.GetResourceID( - c.subscriptionID, + subsID, resourceGroupName, - "Microsoft.Compute/disks", + diskResourceType, diskName, ) - return c.armClient.DeleteResource(ctx, resourceID, "") + return c.armClient.DeleteResource(ctx, resourceID) } // ListByResourceGroup lists all the disks under a resource group. -func (c *Client) ListByResourceGroup(ctx context.Context, resourceGroupName string) ([]compute.Disk, *retry.Error) { - resourceID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/disks", - autorest.Encode("path", c.subscriptionID), - autorest.Encode("path", resourceGroupName)) +func (c *Client) ListByResourceGroup(ctx context.Context, subsID, resourceGroupName string) ([]compute.Disk, *retry.Error) { + if subsID == "" { + subsID = c.subscriptionID + } + resourceID := armclient.GetResourceListID(subsID, resourceGroupName, diskResourceType) result := make([]compute.Disk, 0) page := &DiskListPage{} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/interface.go index 6d22cc8152d1..ffcd52096d80 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/interface.go @@ -37,17 +37,17 @@ const ( // Don't forget to run "hack/update-mock-clients.sh" command to generate the mock client. type Interface interface { // Get gets a Disk. - Get(ctx context.Context, resourceGroupName string, diskName string) (result compute.Disk, rerr *retry.Error) + Get(ctx context.Context, subsID, resourceGroupName, diskName string) (result compute.Disk, rerr *retry.Error) // CreateOrUpdate creates or updates a Disk. - CreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, diskParameter compute.Disk) *retry.Error + CreateOrUpdate(ctx context.Context, subsID, resourceGroupName, diskName string, diskParameter compute.Disk) *retry.Error // Update updates a Disk. - Update(ctx context.Context, resourceGroupName string, diskName string, diskParameter compute.DiskUpdate) *retry.Error + Update(ctx context.Context, subsID, resourceGroupName, diskName string, diskParameter compute.DiskUpdate) *retry.Error // Delete deletes a Disk by name. - Delete(ctx context.Context, resourceGroupName string, diskName string) *retry.Error + Delete(ctx context.Context, subsID, resourceGroupName, diskName string) *retry.Error // ListByResourceGroup lists all the disks under a resource group. - ListByResourceGroup(ctx context.Context, resourceGroupName string) ([]compute.Disk, *retry.Error) + ListByResourceGroup(ctx context.Context, subsID, resourceGroupName string) ([]compute.Disk, *retry.Error) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/mockdiskclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/mockdiskclient/interface.go index 2df9677b9ed2..e3af24459b97 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/mockdiskclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/mockdiskclient/interface.go @@ -54,73 +54,73 @@ func (m *MockInterface) EXPECT() *MockInterfaceMockRecorder { } // CreateOrUpdate mocks base method. -func (m *MockInterface) CreateOrUpdate(ctx context.Context, resourceGroupName, diskName string, diskParameter compute.Disk) *retry.Error { +func (m *MockInterface) CreateOrUpdate(ctx context.Context, subsID, resourceGroupName, diskName string, diskParameter compute.Disk) *retry.Error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CreateOrUpdate", ctx, resourceGroupName, diskName, diskParameter) + ret := m.ctrl.Call(m, "CreateOrUpdate", ctx, subsID, resourceGroupName, diskName, diskParameter) ret0, _ := ret[0].(*retry.Error) return ret0 } // CreateOrUpdate indicates an expected call of CreateOrUpdate. -func (mr *MockInterfaceMockRecorder) CreateOrUpdate(ctx, resourceGroupName, diskName, diskParameter interface{}) *gomock.Call { +func (mr *MockInterfaceMockRecorder) CreateOrUpdate(ctx, subsID, resourceGroupName, diskName, diskParameter interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdate", reflect.TypeOf((*MockInterface)(nil).CreateOrUpdate), ctx, resourceGroupName, diskName, diskParameter) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdate", reflect.TypeOf((*MockInterface)(nil).CreateOrUpdate), ctx, subsID, resourceGroupName, diskName, diskParameter) } // Delete mocks base method. -func (m *MockInterface) Delete(ctx context.Context, resourceGroupName, diskName string) *retry.Error { +func (m *MockInterface) Delete(ctx context.Context, subsID, resourceGroupName, diskName string) *retry.Error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", ctx, resourceGroupName, diskName) + ret := m.ctrl.Call(m, "Delete", ctx, subsID, resourceGroupName, diskName) ret0, _ := ret[0].(*retry.Error) return ret0 } // Delete indicates an expected call of Delete. -func (mr *MockInterfaceMockRecorder) Delete(ctx, resourceGroupName, diskName interface{}) *gomock.Call { +func (mr *MockInterfaceMockRecorder) Delete(ctx, subsID, resourceGroupName, diskName interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockInterface)(nil).Delete), ctx, resourceGroupName, diskName) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockInterface)(nil).Delete), ctx, subsID, resourceGroupName, diskName) } // Get mocks base method. -func (m *MockInterface) Get(ctx context.Context, resourceGroupName, diskName string) (compute.Disk, *retry.Error) { +func (m *MockInterface) Get(ctx context.Context, subsID, resourceGroupName, diskName string) (compute.Disk, *retry.Error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", ctx, resourceGroupName, diskName) + ret := m.ctrl.Call(m, "Get", ctx, subsID, resourceGroupName, diskName) ret0, _ := ret[0].(compute.Disk) ret1, _ := ret[1].(*retry.Error) return ret0, ret1 } // Get indicates an expected call of Get. -func (mr *MockInterfaceMockRecorder) Get(ctx, resourceGroupName, diskName interface{}) *gomock.Call { +func (mr *MockInterfaceMockRecorder) Get(ctx, subsID, resourceGroupName, diskName interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockInterface)(nil).Get), ctx, resourceGroupName, diskName) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockInterface)(nil).Get), ctx, subsID, resourceGroupName, diskName) } // ListByResourceGroup mocks base method. -func (m *MockInterface) ListByResourceGroup(ctx context.Context, resourceGroupName string) ([]compute.Disk, *retry.Error) { +func (m *MockInterface) ListByResourceGroup(ctx context.Context, subsID, resourceGroupName string) ([]compute.Disk, *retry.Error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListByResourceGroup", ctx, resourceGroupName) + ret := m.ctrl.Call(m, "ListByResourceGroup", ctx, subsID, resourceGroupName) ret0, _ := ret[0].([]compute.Disk) ret1, _ := ret[1].(*retry.Error) return ret0, ret1 } // ListByResourceGroup indicates an expected call of ListByResourceGroup. -func (mr *MockInterfaceMockRecorder) ListByResourceGroup(ctx, resourceGroupName interface{}) *gomock.Call { +func (mr *MockInterfaceMockRecorder) ListByResourceGroup(ctx, subsID, resourceGroupName interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByResourceGroup", reflect.TypeOf((*MockInterface)(nil).ListByResourceGroup), ctx, resourceGroupName) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByResourceGroup", reflect.TypeOf((*MockInterface)(nil).ListByResourceGroup), ctx, subsID, resourceGroupName) } // Update mocks base method. -func (m *MockInterface) Update(ctx context.Context, resourceGroupName, diskName string, diskParameter compute.DiskUpdate) *retry.Error { +func (m *MockInterface) Update(ctx context.Context, subsID, resourceGroupName, diskName string, diskParameter compute.DiskUpdate) *retry.Error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", ctx, resourceGroupName, diskName, diskParameter) + ret := m.ctrl.Call(m, "Update", ctx, subsID, resourceGroupName, diskName, diskParameter) ret0, _ := ret[0].(*retry.Error) return ret0 } // Update indicates an expected call of Update. -func (mr *MockInterfaceMockRecorder) Update(ctx, resourceGroupName, diskName, diskParameter interface{}) *gomock.Call { +func (mr *MockInterfaceMockRecorder) Update(ctx, subsID, resourceGroupName, diskName, diskParameter interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockInterface)(nil).Update), ctx, resourceGroupName, diskName, diskParameter) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockInterface)(nil).Update), ctx, subsID, resourceGroupName, diskName, diskParameter) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/fileclient/azure_fileclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/fileclient/azure_fileclient.go index 6b6a4d34c53c..59f4770a2c7d 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/fileclient/azure_fileclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/fileclient/azure_fileclient.go @@ -44,6 +44,10 @@ type ShareOptions struct { RequestGiB int // supported values: ""(by default), "TransactionOptimized", "Cool", "Hot", "Premium" AccessTier string + // supported values: ""(by default), "AllSquash", "NoRootSquash", "RootSquash" + RootSquash string + // Metadata - A name-value pair to associate with the share as metadata. + Metadata map[string]*string } // New creates a azure file client @@ -77,6 +81,12 @@ func (c *Client) CreateFileShare(resourceGroupName, accountName string, shareOpt if shareOptions.AccessTier != "" { fileShareProperties.AccessTier = storage.ShareAccessTier(shareOptions.AccessTier) } + if shareOptions.RootSquash != "" { + fileShareProperties.RootSquash = storage.RootSquashType(shareOptions.RootSquash) + } + if shareOptions.Metadata != nil { + fileShareProperties.Metadata = shareOptions.Metadata + } fileShare := storage.FileShare{ Name: &shareOptions.Name, FileShareProperties: fileShareProperties, diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/azure_interfaceclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/azure_interfaceclient.go index 4909e88ea71f..eed60995091a 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/azure_interfaceclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/azure_interfaceclient.go @@ -23,7 +23,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/to" @@ -39,6 +39,8 @@ import ( var _ Interface = &Client{} +const netInterfaceResourceType = "Microsoft.Network/networkInterfaces" + // Client implements network interface client. type Client struct { armClient armclient.Interface @@ -123,7 +125,7 @@ func (c *Client) getNetworkInterface(ctx context.Context, resourceGroupName stri resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/networkInterfaces", + netInterfaceResourceType, networkInterfaceName, ) result := network.Interface{} @@ -259,18 +261,15 @@ func (c *Client) createOrUpdateInterface(ctx context.Context, resourceGroupName resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/networkInterfaces", + netInterfaceResourceType, networkInterfaceName, ) - decorators := []autorest.PrepareDecorator{ - autorest.WithPathParameters("{resourceID}", map[string]interface{}{"resourceID": resourceID}), - autorest.WithJSON(parameters), - } + decorators := []autorest.PrepareDecorator{} if to.String(parameters.Etag) != "" { decorators = append(decorators, autorest.WithHeader("If-Match", autorest.String(to.String(parameters.Etag)))) } - response, rerr := c.armClient.PutResourceWithDecorators(ctx, resourceID, parameters, decorators) + response, rerr := c.armClient.PutResource(ctx, resourceID, parameters, decorators...) defer c.armClient.CloseResponse(ctx, response) if rerr != nil { klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "nic.put.request", resourceID, rerr.Error()) @@ -334,9 +333,9 @@ func (c *Client) deleteInterface(ctx context.Context, resourceGroupName string, resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/networkInterfaces", + netInterfaceResourceType, networkInterfaceName, ) - return c.armClient.DeleteResource(ctx, resourceID, "") + return c.armClient.DeleteResource(ctx, resourceID) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/interface.go index dea78ddf6ae0..e8e807a406bb 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/interface.go @@ -19,14 +19,14 @@ package interfaceclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version for network. - APIVersion = "2021-02-01" + APIVersion = "2021-08-01" // AzureStackCloudAPIVersion is the API version for Azure Stack AzureStackCloudAPIVersion = "2018-11-01" diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/mockinterfaceclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/mockinterfaceclient/interface.go index 37dcb6bb3978..62e7050481de 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/mockinterfaceclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/mockinterfaceclient/interface.go @@ -25,7 +25,7 @@ import ( context "context" reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" gomock "github.com/golang/mock/gomock" retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/azure_loadbalancerclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/azure_loadbalancerclient.go index 80f408720b15..1d5268463f43 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/azure_loadbalancerclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/azure_loadbalancerclient.go @@ -18,12 +18,11 @@ package loadbalancerclient import ( "context" - "fmt" "net/http" "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/to" @@ -39,6 +38,8 @@ import ( var _ Interface = &Client{} +const lbResourceType = "Microsoft.Network/loadBalancers" + // Client implements LoadBalancer client Interface. type Client struct { armClient armclient.Interface @@ -121,7 +122,7 @@ func (c *Client) getLB(ctx context.Context, resourceGroupName string, loadBalanc resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/loadBalancers", + lbResourceType, loadBalancerName, ) result := network.LoadBalancer{} @@ -179,9 +180,7 @@ func (c *Client) List(ctx context.Context, resourceGroupName string) ([]network. // listLB gets a list of LoadBalancers in the resource group. func (c *Client) listLB(ctx context.Context, resourceGroupName string) ([]network.LoadBalancer, *retry.Error) { - resourceID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers", - autorest.Encode("path", c.subscriptionID), - autorest.Encode("path", resourceGroupName)) + resourceID := armclient.GetResourceListID(c.subscriptionID, resourceGroupName, "Microsoft.Network/loadBalancers") result := make([]network.LoadBalancer, 0) page := &LoadBalancerListResultPage{} page.fn = c.listNextResults @@ -253,18 +252,15 @@ func (c *Client) createOrUpdateLB(ctx context.Context, resourceGroupName string, resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/loadBalancers", + lbResourceType, loadBalancerName, ) - decorators := []autorest.PrepareDecorator{ - autorest.WithPathParameters("{resourceID}", map[string]interface{}{"resourceID": resourceID}), - autorest.WithJSON(parameters), - } + decorators := []autorest.PrepareDecorator{} if etag != "" { decorators = append(decorators, autorest.WithHeader("If-Match", autorest.String(etag))) } - response, rerr := c.armClient.PutResourceWithDecorators(ctx, resourceID, parameters, decorators) + response, rerr := c.armClient.PutResource(ctx, resourceID, parameters, decorators...) defer c.armClient.CloseResponse(ctx, response) if rerr != nil { klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "loadbalancer.put.request", resourceID, rerr.Error()) @@ -328,11 +324,11 @@ func (c *Client) deleteLB(ctx context.Context, resourceGroupName string, loadBal resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/loadBalancers", + lbResourceType, loadBalancerName, ) - return c.armClient.DeleteResource(ctx, resourceID, "") + return c.armClient.DeleteResource(ctx, resourceID) } func (c *Client) listResponder(resp *http.Response) (result network.LoadBalancerListResult, err error) { @@ -461,20 +457,17 @@ func (c *Client) createOrUpdateLBBackendPool(ctx context.Context, resourceGroupN resourceID := armclient.GetChildResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/loadBalancers", + lbResourceType, loadBalancerName, "backendAddressPools", backendPoolName, ) - decorators := []autorest.PrepareDecorator{ - autorest.WithPathParameters("{resourceID}", map[string]interface{}{"resourceID": resourceID}), - autorest.WithJSON(parameters), - } + decorators := []autorest.PrepareDecorator{} if etag != "" { decorators = append(decorators, autorest.WithHeader("If-Match", autorest.String(etag))) } - response, rerr := c.armClient.PutResourceWithDecorators(ctx, resourceID, parameters, decorators) + response, rerr := c.armClient.PutResource(ctx, resourceID, parameters, decorators...) defer c.armClient.CloseResponse(ctx, response) if rerr != nil { klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "loadbalancerbackendpool.put.request", resourceID, rerr.Error()) @@ -527,12 +520,12 @@ func (c *Client) deleteLBBackendPool(ctx context.Context, resourceGroupName, loa resourceID := armclient.GetChildResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/loadBalancers", + lbResourceType, loadBalancerName, "backendAddressPools", backendPoolName, ) - return c.armClient.DeleteResource(ctx, resourceID, "") + return c.armClient.DeleteResource(ctx, resourceID) } func (c *Client) createOrUpdateBackendPoolResponder(resp *http.Response) (*network.BackendAddressPool, *retry.Error) { diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/interface.go index 8ea9e9804db1..a4da65f92f87 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/interface.go @@ -19,14 +19,14 @@ package loadbalancerclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version for network. - APIVersion = "2021-02-01" + APIVersion = "2021-08-01" // AzureStackCloudAPIVersion is the API version for Azure Stack AzureStackCloudAPIVersion = "2018-11-01" // AzureStackCloudName is the cloud name of Azure Stack diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/mockloadbalancerclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/mockloadbalancerclient/interface.go index 989ea115261f..e9d0aaad8dff 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/mockloadbalancerclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/mockloadbalancerclient/interface.go @@ -25,7 +25,7 @@ import ( context "context" reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" gomock "github.com/golang/mock/gomock" retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednsclient/azure_privatednsclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednsclient/azure_privatednsclient.go index 0c2369b9b48e..b3fcab3b7cb4 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednsclient/azure_privatednsclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednsclient/azure_privatednsclient.go @@ -18,48 +18,213 @@ package privatednsclient import ( "context" + "net/http" + "strings" + "time" "github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + + "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" + "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" + "sigs.k8s.io/cloud-provider-azure/pkg/metrics" + "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) var _ Interface = &Client{} +const ( + privateDNSZoneResourceType = "Microsoft.Network/privateDnsZones" +) + // Client implements privatednsclient Interface. type Client struct { - privateDNSClient privatedns.PrivateZonesClient + armClient armclient.Interface + subscriptionID string + cloudName string + + // Rate limiting configures. + rateLimiterReader flowcontrol.RateLimiter + rateLimiterWriter flowcontrol.RateLimiter + + // ARM throttling configures. + RetryAfterReader time.Time + RetryAfterWriter time.Time } -// New creates a new privatedns client. +// New creates a new private dns client with ratelimiting. func New(config *azclients.ClientConfig) *Client { - privateDNSClient := privatedns.NewPrivateZonesClientWithBaseURI(config.ResourceManagerEndpoint, config.SubscriptionID) - privateDNSClient.Authorizer = config.Authorizer + baseURI := config.ResourceManagerEndpoint + authorizer := config.Authorizer + apiVersion := APIVersion + if strings.EqualFold(config.CloudName, AzureStackCloudName) && !config.DisableAzureStackCloud { + klog.Warningf("Azure Stack is not supported for Private DNS Zone API") + } + armClient := armclient.New(authorizer, *config, baseURI, apiVersion) + rateLimiterReader, rateLimiterWriter := azclients.NewRateLimiter(config.RateLimitConfig) + + if azclients.RateLimitEnabled(config.RateLimitConfig) { + klog.V(2).Infof("Azure PrivateDNSZoneClient (read ops) using rate limit config: QPS=%g, bucket=%d", + config.RateLimitConfig.CloudProviderRateLimitQPS, + config.RateLimitConfig.CloudProviderRateLimitBucket) + klog.V(2).Infof("Azure PrivateDNSZoneClient (write ops) using rate limit config: QPS=%g, bucket=%d", + config.RateLimitConfig.CloudProviderRateLimitQPSWrite, + config.RateLimitConfig.CloudProviderRateLimitBucketWrite) + } + client := &Client{ - privateDNSClient: privateDNSClient, + armClient: armClient, + rateLimiterReader: rateLimiterReader, + rateLimiterWriter: rateLimiterWriter, + subscriptionID: config.SubscriptionID, + cloudName: config.CloudName, } + return client } -// CreateOrUpdate creates or updates a private dns zone -func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, privateZoneName string, parameters privatedns.PrivateZone, waitForCompletion bool) error { - createOrUpdateFuture, err := c.privateDNSClient.CreateOrUpdate(ctx, resourceGroupName, privateZoneName, parameters, "", "*") +// CreateOrUpdate creates or updates a private DNS zone. +func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName, privateZoneName string, parameters privatedns.PrivateZone, etag string, waitForCompletion bool) *retry.Error { + mc := metrics.NewMetricContext("private_dns_zone", "create_or_update", resourceGroupName, c.subscriptionID, "") - if err != nil { - klog.V(5).Infof("Received error for %s, resourceGroup: %s, error: %s", "privatedns.put.request", resourceGroupName, err) - return err + // Report errors if the client is rate limited. + if !c.rateLimiterWriter.TryAccept() { + mc.RateLimitedCount() + return retry.GetRateLimitError(true, "PrivateDNSZoneCreateOrUpdate") } + // Report errors if the client is throttled. + if c.RetryAfterWriter.After(time.Now()) { + mc.ThrottledCount() + rerr := retry.GetThrottlingError("PrivateDNSZoneCreateOrUpdate", "client throttled", c.RetryAfterWriter) + return rerr + } + + rerr := c.createOrUpdatePrivateDNSZone(ctx, resourceGroupName, privateZoneName, parameters, etag, waitForCompletion) + mc.Observe(rerr) + if rerr != nil { + if rerr.IsThrottled() { + // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. + c.RetryAfterWriter = rerr.RetryAfter + } + + return rerr + } + + return nil +} + +// createOrUpdatePrivateDNSZone creates or updates a private DNS zone. +func (c *Client) createOrUpdatePrivateDNSZone(ctx context.Context, resourceGroupName, privateDNSZoneName string, parameters privatedns.PrivateZone, etag string, waitForCompletion bool) *retry.Error { + resourceID := armclient.GetResourceID( + c.subscriptionID, + resourceGroupName, + privateDNSZoneResourceType, + privateDNSZoneName, + ) + decorators := []autorest.PrepareDecorator{} + if etag != "" { + decorators = append(decorators, autorest.WithHeader("If-Match", autorest.String(etag))) + } + + var response *http.Response + var rerr *retry.Error if waitForCompletion { - err := createOrUpdateFuture.WaitForCompletionRef(ctx, c.privateDNSClient.Client) - if err != nil { - klog.V(5).Infof("Received error while waiting for completion for %s, resourceGroup: %s, error: %s", "privatedns.put.request", resourceGroupName, err) - return err + response, rerr = c.armClient.PutResource(ctx, resourceID, parameters, decorators...) + defer c.armClient.CloseResponse(ctx, response) + } else { + _, rerr = c.armClient.PutResourceAsync(ctx, resourceID, parameters, decorators...) + } + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privatednszone.put.request", resourceID, rerr.Error()) + return rerr + } + if !waitForCompletion { + return nil + } + + if response != nil && response.StatusCode != http.StatusNoContent { + _, rerr = c.createOrUpdateResponder(response) + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privatednszone.put.respond", resourceID, rerr.Error()) + return rerr } } + return nil } -func (c *Client) Get(ctx context.Context, resourceGroupName string, privateZoneName string) (result privatedns.PrivateZone, err error) { - return c.privateDNSClient.Get(ctx, resourceGroupName, privateZoneName) +func (c *Client) createOrUpdateResponder(resp *http.Response) (*privatedns.PrivateZone, *retry.Error) { + result := &privatedns.PrivateZone{} + err := autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result)) + result.Response = autorest.Response{Response: resp} + return result, retry.GetError(resp, err) +} + +// Get gets a private dns zone. +func (c *Client) Get(ctx context.Context, resourceGroupName, privateZoneName string) (privatedns.PrivateZone, *retry.Error) { + mc := metrics.NewMetricContext("private_dns_zones", "get", resourceGroupName, c.subscriptionID, "") + + // Report errors if the client is rate limited. + if !c.rateLimiterReader.TryAccept() { + mc.RateLimitedCount() + return privatedns.PrivateZone{}, retry.GetRateLimitError(false, "PrivateDNSZoneGet") + } + + // Report errors if the client is throttled. + if c.RetryAfterReader.After(time.Now()) { + mc.ThrottledCount() + rerr := retry.GetThrottlingError("PrivateDNSZoneGet", "client throttled", c.RetryAfterReader) + return privatedns.PrivateZone{}, rerr + } + + result, rerr := c.getPrivateDNSZone(ctx, resourceGroupName, privateZoneName) + mc.Observe(rerr) + if rerr != nil { + if rerr.IsThrottled() { + // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. + c.RetryAfterReader = rerr.RetryAfter + } + + return result, rerr + } + + return result, nil +} + +// getPrivateDNSZone gets a private DNS zone. +func (c *Client) getPrivateDNSZone(ctx context.Context, resourceGroupName, privateDNSZoneName string) (privatedns.PrivateZone, *retry.Error) { + resourceID := armclient.GetResourceID( + c.subscriptionID, + resourceGroupName, + privateDNSZoneResourceType, + privateDNSZoneName, + ) + result := privatedns.PrivateZone{} + + response, rerr := c.armClient.GetResource(ctx, resourceID) + defer c.armClient.CloseResponse(ctx, response) + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privatednszone.get.request", resourceID, rerr.Error()) + return result, rerr + } + + err := autorest.Respond( + response, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result)) + if err != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privatednszone.get.respond", resourceID, err) + return result, retry.GetError(response, err) + } + + result.Response = autorest.Response{Response: response} + return result, nil } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednsclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednsclient/interface.go index 628f8dbc488a..63ae62a0a272 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednsclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednsclient/interface.go @@ -20,15 +20,23 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns" + + "sigs.k8s.io/cloud-provider-azure/pkg/retry" +) + +const ( + // APIVersion is the API version. + APIVersion = "2018-09-01" + // AzureStackCloudName is the cloud name of Azure Stack + AzureStackCloudName = "AZURESTACKCLOUD" ) // Interface is the client interface for Private DNS Zones // Don't forget to run "hack/update-mock-clients.sh" command to generate the mock client. type Interface interface { + // Get gets a private DNS zone + Get(ctx context.Context, resourceGroupName, privateZoneName string) (privatedns.PrivateZone, *retry.Error) - //Get gets the PrivateDNSZone - Get(ctx context.Context, resourceGroupName string, privateZoneName string) (result privatedns.PrivateZone, err error) - - // CreateOrUpdate creates or updates a private dns zone. - CreateOrUpdate(ctx context.Context, resourceGroupName string, privateZoneName string, parameters privatedns.PrivateZone, waitForCompletion bool) error + // CreateOrUpdate creates or updates a private DNS zone. + CreateOrUpdate(ctx context.Context, resourceGroupName, privateZoneName string, parameters privatedns.PrivateZone, etag string, waitForCompletion bool) *retry.Error } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient/azure_privatednszonegroupclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient/azure_privatednszonegroupclient.go index 401d7d0d38d1..adaec79d4559 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient/azure_privatednszonegroupclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient/azure_privatednszonegroupclient.go @@ -18,47 +18,218 @@ package privatednszonegroupclient import ( "context" + "net/http" + "strings" + "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + + "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" + "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" + "sigs.k8s.io/cloud-provider-azure/pkg/metrics" + "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) var _ Interface = &Client{} +const ( + peResourceType = "Microsoft.Network/privateEndpoints" + privateDNSZoneGroupResourceType = "privateDnsZoneGroups" +) + // Client implements privatednszonegroupclient client Interface. type Client struct { - privateDNSZoneGroupClient network.PrivateDNSZoneGroupsClient + armClient armclient.Interface + subscriptionID string + cloudName string + + // Rate limiting configures. + rateLimiterReader flowcontrol.RateLimiter + rateLimiterWriter flowcontrol.RateLimiter + + // ARM throttling configures. + RetryAfterReader time.Time + RetryAfterWriter time.Time } -// New creates a new private dns zone group client. +// New creates a new private dns zone group client with ratelimiting. func New(config *azclients.ClientConfig) *Client { - privateDNSZoneGroupClient := network.NewPrivateDNSZoneGroupsClientWithBaseURI(config.ResourceManagerEndpoint, config.SubscriptionID) - privateDNSZoneGroupClient.Authorizer = config.Authorizer + baseURI := config.ResourceManagerEndpoint + authorizer := config.Authorizer + apiVersion := APIVersion + if strings.EqualFold(config.CloudName, AzureStackCloudName) && !config.DisableAzureStackCloud { + klog.Warningf("Azure Stack is not supported for Private DNS Zone Group API") + } + armClient := armclient.New(authorizer, *config, baseURI, apiVersion) + rateLimiterReader, rateLimiterWriter := azclients.NewRateLimiter(config.RateLimitConfig) + + if azclients.RateLimitEnabled(config.RateLimitConfig) { + klog.V(2).Infof("Azure PrivateDNSZoneGroupClient (read ops) using rate limit config: QPS=%g, bucket=%d", + config.RateLimitConfig.CloudProviderRateLimitQPS, + config.RateLimitConfig.CloudProviderRateLimitBucket) + klog.V(2).Infof("Azure PrivateDNSZoneGroupClient (write ops) using rate limit config: QPS=%g, bucket=%d", + config.RateLimitConfig.CloudProviderRateLimitQPSWrite, + config.RateLimitConfig.CloudProviderRateLimitBucketWrite) + } + client := &Client{ - privateDNSZoneGroupClient: privateDNSZoneGroupClient, + armClient: armClient, + rateLimiterReader: rateLimiterReader, + rateLimiterWriter: rateLimiterWriter, + subscriptionID: config.SubscriptionID, + cloudName: config.CloudName, } + return client } -// CreateOrUpdate creates or updates a private dns zone group -func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, parameters network.PrivateDNSZoneGroup, waitForCompletion bool) error { - createOrUpdateFuture, err := c.privateDNSZoneGroupClient.CreateOrUpdate(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName, parameters) - if err != nil { - klog.V(5).Infof("Received error for %s, resourceGroup: %s, privateEndpointName: %s, error: %s", "privatednszonegroup.put.request", resourceGroupName, privateEndpointName, err) - return err +// CreateOrUpdate creates or updates a private DNS zone group. +func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName, privateEndpointName, privateDNSZoneGroupName string, parameters network.PrivateDNSZoneGroup, etag string, waitForCompletion bool) *retry.Error { + mc := metrics.NewMetricContext("private_dns_zone_group", "create_or_update", resourceGroupName, c.subscriptionID, "") + + // Report errors if the client is rate limited. + if !c.rateLimiterWriter.TryAccept() { + mc.RateLimitedCount() + return retry.GetRateLimitError(true, "PrivateDNSZoneGroupCreateOrUpdate") } + + // Report errors if the client is throttled. + if c.RetryAfterWriter.After(time.Now()) { + mc.ThrottledCount() + rerr := retry.GetThrottlingError("PrivateDNSZoneGroupCreateOrUpdate", "client throttled", c.RetryAfterWriter) + return rerr + } + + rerr := c.createOrUpdatePrivateDNSZoneGroup(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName, parameters, etag, waitForCompletion) + mc.Observe(rerr) + if rerr != nil { + if rerr.IsThrottled() { + // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. + c.RetryAfterWriter = rerr.RetryAfter + } + + return rerr + } + + return nil +} + +// createOrUpdatePrivateDNSZoneGroup creates or updates a private DNS zone group. +func (c *Client) createOrUpdatePrivateDNSZoneGroup(ctx context.Context, resourceGroupName, privateEndpointName, privateDNSZoneGroupName string, parameters network.PrivateDNSZoneGroup, etag string, waitForCompletion bool) *retry.Error { + resourceID := armclient.GetChildResourceID( + c.subscriptionID, + resourceGroupName, + peResourceType, + privateEndpointName, + privateDNSZoneGroupResourceType, + privateDNSZoneGroupName) + decorators := []autorest.PrepareDecorator{} + if etag != "" { + decorators = append(decorators, autorest.WithHeader("If-Match", autorest.String(etag))) + } + + var response *http.Response + var rerr *retry.Error if waitForCompletion { - err = createOrUpdateFuture.WaitForCompletionRef(ctx, c.privateDNSZoneGroupClient.Client) - if err != nil { - klog.V(5).Infof("Received error while waiting for completion for %s, resourceGroup: %s, privateEndpointName: %s, error: %s", "privatednszonegroup.put.request", resourceGroupName, privateEndpointName, err) - return err + response, rerr = c.armClient.PutResource(ctx, resourceID, parameters, decorators...) + defer c.armClient.CloseResponse(ctx, response) + + } else { + _, rerr = c.armClient.PutResourceAsync(ctx, resourceID, parameters, decorators...) + } + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privatednszonegroup.put.request", resourceID, rerr.Error()) + return rerr + } + if !waitForCompletion { + return nil + } + + if response != nil && response.StatusCode != http.StatusNoContent { + _, rerr = c.createOrUpdateResponder(response) + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privatednszonegroup.put.respond", resourceID, rerr.Error()) + return rerr } } + return nil } -// Get gets the private dns zone group -func (c *Client) Get(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string) (result network.PrivateDNSZoneGroup, err error) { - return c.privateDNSZoneGroupClient.Get(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName) +func (c *Client) createOrUpdateResponder(resp *http.Response) (*network.PrivateDNSZoneGroup, *retry.Error) { + result := &network.PrivateDNSZoneGroup{} + err := autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result)) + result.Response = autorest.Response{Response: resp} + return result, retry.GetError(resp, err) +} + +// Get gets a private dns zone group. +func (c *Client) Get(ctx context.Context, resourceGroupName, privateEndpointName, privateDNSZoneGroupName string) (network.PrivateDNSZoneGroup, *retry.Error) { + mc := metrics.NewMetricContext("private_dns_zone_group", "get", resourceGroupName, c.subscriptionID, "") + + // Report errors if the client is rate limited. + if !c.rateLimiterReader.TryAccept() { + mc.RateLimitedCount() + return network.PrivateDNSZoneGroup{}, retry.GetRateLimitError(false, "PrivateDNSZoneGroupGet") + } + + // Report errors if the client is throttled. + if c.RetryAfterReader.After(time.Now()) { + mc.ThrottledCount() + rerr := retry.GetThrottlingError("PrivateDNSZoneGroupGet", "client throttled", c.RetryAfterReader) + return network.PrivateDNSZoneGroup{}, rerr + } + + result, rerr := c.getPrivateDNSZoneGroup(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName) + mc.Observe(rerr) + if rerr != nil { + if rerr.IsThrottled() { + // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. + c.RetryAfterReader = rerr.RetryAfter + } + + return result, rerr + } + + return result, nil +} + +// getPrivateDNSZoneGroup gets a private DNS zone group. +func (c *Client) getPrivateDNSZoneGroup(ctx context.Context, resourceGroupName, privateEndpointName, privateDNSZoneGroupName string) (network.PrivateDNSZoneGroup, *retry.Error) { + resourceID := armclient.GetChildResourceID( + c.subscriptionID, + resourceGroupName, + peResourceType, + privateEndpointName, + privateDNSZoneGroupResourceType, + privateDNSZoneGroupName, + ) + result := network.PrivateDNSZoneGroup{} + + response, rerr := c.armClient.GetResource(ctx, resourceID) + defer c.armClient.CloseResponse(ctx, response) + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privatednszonegroup.get.request", resourceID, rerr.Error()) + return result, rerr + } + + err := autorest.Respond( + response, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result)) + if err != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privatednszonegroup.get.respond", resourceID, err) + return result, retry.GetError(response, err) + } + + result.Response = autorest.Response{Response: response} + return result, nil } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient/interface.go index fae7df643f0d..ce07a889b4fd 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient/interface.go @@ -19,16 +19,24 @@ package privatednszonegroupclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + + "sigs.k8s.io/cloud-provider-azure/pkg/retry" +) + +const ( + // APIVersion is the API version. + APIVersion = "2021-08-01" + // AzureStackCloudName is the cloud name of Azure Stack + AzureStackCloudName = "AZURESTACKCLOUD" ) // Interface is the client interface for Private DNS Zone Group. // Don't forget to run "hack/update-mock-clients.sh" command to generate the mock client. type Interface interface { - // Get gets the private dns zone group - Get(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string) (result network.PrivateDNSZoneGroup, err error) + Get(ctx context.Context, resourceGroupName, privateEndpointName, privateDNSZoneGroupName string) (network.PrivateDNSZoneGroup, *retry.Error) - // CreateOrUpdate creates or updates a private dns zone group endpoint. - CreateOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, parameters network.PrivateDNSZoneGroup, waitForCompletion bool) error + // CreateOrUpdate creates or updates a private dns zone group. + CreateOrUpdate(ctx context.Context, resourceGroupName, privateEndpointName, privateDNSZoneGroupName string, parameters network.PrivateDNSZoneGroup, etag string, waitForCompletion bool) *retry.Error } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/azure_privateendpointclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/azure_privateendpointclient.go index f7883321fd01..84240d5022c5 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/azure_privateendpointclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/azure_privateendpointclient.go @@ -14,53 +14,212 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Package privateendpointclient implements the client for Private Endpoint. package privateendpointclient import ( "context" + "net/http" + "strings" + "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + + "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" + "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" + "sigs.k8s.io/cloud-provider-azure/pkg/metrics" + "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) var _ Interface = &Client{} +const ( + PEResourceType = "Microsoft.Network/privateEndpoints" +) + // Client implements privateendpointclient Interface. type Client struct { - privateEndpointClient network.PrivateEndpointsClient + armClient armclient.Interface + cloudName string + subscriptionID string + + // Rate limiting configures. + rateLimiterReader flowcontrol.RateLimiter + rateLimiterWriter flowcontrol.RateLimiter + + // ARM throttling configures. + RetryAfterReader time.Time + RetryAfterWriter time.Time } // New creates a new private endpoint client. func New(config *azclients.ClientConfig) *Client { - privateEndpointClient := network.NewPrivateEndpointsClientWithBaseURI(config.ResourceManagerEndpoint, config.SubscriptionID) - privateEndpointClient.Authorizer = config.Authorizer + apiVersion := APIVersion + if strings.EqualFold(config.CloudName, AzureStackCloudName) && !config.DisableAzureStackCloud { + // To check whether Azure Stack Cloud supports a resource and the supported API version, refer to: + // https://docs.microsoft.com/en-us/azure-stack/user/azure-stack-profiles-azure-resource-manager-versions?view=azs-2108 + klog.Warningf("Azure Stack is not supported for Private Endpoint API") + } + armClient := armclient.New(config.Authorizer, *config, config.ResourceManagerEndpoint, apiVersion) + + rateLimiterReader, rateLimiterWriter := azclients.NewRateLimiter(config.RateLimitConfig) + if azclients.RateLimitEnabled(config.RateLimitConfig) { + klog.V(2).Infof("Azure PrivateEndpointsClient (read ops) using rate limit config: QPS=%g, bucket=%d", + config.RateLimitConfig.CloudProviderRateLimitQPS, + config.RateLimitConfig.CloudProviderRateLimitBucket) + klog.V(2).Infof("Azure PrivateEndpointsClient (write ops) using rate limit config: QPS=%g, bucket=%d", + config.RateLimitConfig.CloudProviderRateLimitQPSWrite, + config.RateLimitConfig.CloudProviderRateLimitBucketWrite) + } client := &Client{ - privateEndpointClient: privateEndpointClient, + armClient: armClient, + rateLimiterReader: rateLimiterReader, + rateLimiterWriter: rateLimiterWriter, + subscriptionID: config.SubscriptionID, + cloudName: config.CloudName, } return client } // CreateOrUpdate creates or updates a private endpoint. -func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, endpointName string, privateEndpoint network.PrivateEndpoint, waitForCompletion bool) error { - createOrUpdateFuture, err := c.privateEndpointClient.CreateOrUpdate(ctx, resourceGroupName, endpointName, privateEndpoint) - if err != nil { - klog.V(5).Infof("Received error for %s, resourceGroup: %s, error: %s", "privateendpoint.put.request", resourceGroupName, err) - return err +func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, endpointName string, privateEndpoint network.PrivateEndpoint, etag string, waitForCompletion bool) *retry.Error { + mc := metrics.NewMetricContext("private_endpoints", "create_or_update", resourceGroupName, c.subscriptionID, "") + + // Report errors if the client is rate limited. + if !c.rateLimiterWriter.TryAccept() { + mc.RateLimitedCount() + return retry.GetRateLimitError(true, "PrivateEndpointCreateOrUpdate") } - if waitForCompletion { - err = createOrUpdateFuture.WaitForCompletionRef(ctx, c.privateEndpointClient.Client) - if err != nil { - klog.V(5).Infof("Received error while waiting for completion for %s, resourceGroup: %s, error: %s", "privateendpoint.put.request", resourceGroupName, err) - return err + + // Report errors if the client is throttled. + if c.RetryAfterWriter.After(time.Now()) { + mc.ThrottledCount() + rerr := retry.GetThrottlingError("PrivateEndpointCreateOrUpdate", "client throttled", c.RetryAfterWriter) + return rerr + } + + rerr := c.createOrUpdatePE(ctx, resourceGroupName, endpointName, privateEndpoint, etag, waitForCompletion) + mc.Observe(rerr) + if rerr != nil { + if rerr.IsThrottled() { + // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. + c.RetryAfterWriter = rerr.RetryAfter } + return rerr + } + return nil +} + +func (c *Client) createOrUpdatePE(ctx context.Context, resourceGroupName string, endpointName string, parameters network.PrivateEndpoint, etag string, waitForCompletion bool) *retry.Error { + resourceID := armclient.GetResourceID( + c.subscriptionID, + resourceGroupName, + PEResourceType, + endpointName, + ) + decorators := []autorest.PrepareDecorator{} + if etag != "" { + decorators = append(decorators, autorest.WithHeader("If-Match", autorest.String(etag))) + } + + var response *http.Response + var rerr *retry.Error + if waitForCompletion { + response, rerr = c.armClient.PutResource(ctx, resourceID, parameters, decorators...) + } else { + _, rerr = c.armClient.PutResourceAsync(ctx, resourceID, parameters, decorators...) + } + defer c.armClient.CloseResponse(ctx, response) + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privateendpoint.put.request", resourceID, rerr.Error()) + return rerr + } + + if !waitForCompletion { + return nil + } + + if response != nil && response.StatusCode != http.StatusNoContent { + _, rerr = c.createOrUpdateResponder(response) + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privateendpoint.put.request", resourceID, rerr.Error()) + return rerr + } } return nil } +func (c *Client) createOrUpdateResponder(resp *http.Response) (*network.PrivateEndpoint, *retry.Error) { + result := &network.PrivateEndpoint{} + err := autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result)) + result.Response = autorest.Response{Response: resp} + return result, retry.GetError(resp, err) +} + // Get gets the private endpoint -func (c *Client) Get(ctx context.Context, resourceGroupName string, privateEndpointName string, expand string) (result network.PrivateEndpoint, err error) { - return c.privateEndpointClient.Get(ctx, resourceGroupName, privateEndpointName, expand) +func (c *Client) Get(ctx context.Context, resourceGroupName string, privateEndpointName string, expand string) (network.PrivateEndpoint, *retry.Error) { + mc := metrics.NewMetricContext("private_endpoints", "get", resourceGroupName, c.subscriptionID, "") + + // Report errors if the client is rate limited. + if !c.rateLimiterReader.TryAccept() { + mc.RateLimitedCount() + return network.PrivateEndpoint{}, retry.GetRateLimitError(false, "PrivateEndpointGet") + } + + // Report errors if the client is throttled. + if c.RetryAfterReader.After(time.Now()) { + mc.ThrottledCount() + rerr := retry.GetThrottlingError("PrivateEndpointGet", "client throttled", c.RetryAfterReader) + return network.PrivateEndpoint{}, rerr + } + result, rerr := c.getPE(ctx, resourceGroupName, privateEndpointName, expand) + + mc.Observe(rerr) + if rerr != nil { + if rerr.IsThrottled() { + // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. + c.RetryAfterReader = rerr.RetryAfter + } + return result, rerr + } + return result, nil +} + +// getPE gets a private endpoint. +func (c *Client) getPE(ctx context.Context, resourceGroupName string, privateEndpointName string, expand string) (network.PrivateEndpoint, *retry.Error) { + resourceID := armclient.GetResourceID( + c.subscriptionID, + resourceGroupName, + PEResourceType, + privateEndpointName, + ) + result := network.PrivateEndpoint{} + response, rerr := c.armClient.GetResourceWithExpandQuery(ctx, resourceID, expand) + defer c.armClient.CloseResponse(ctx, response) + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privateendpoint.get.request", resourceID, rerr.Error()) + return result, rerr + } + + err := autorest.Respond( + response, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result)) + if err != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privateendpoint.get.respond", resourceID, err) + return result, retry.GetError(response, err) + } + + result.Response = autorest.Response{Response: response} + return result, nil } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/doc.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/doc.go new file mode 100644 index 000000000000..b01f75b2e0c7 --- /dev/null +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package privateendpointclient implements the client for PrivateEndpoint. +package privateendpointclient // import "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient" diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/interface.go index 8aa1d4cd1ddd..06db14ad328b 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/interface.go @@ -19,7 +19,16 @@ package privateendpointclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + + "sigs.k8s.io/cloud-provider-azure/pkg/retry" +) + +const ( + // APIVersion is the API version for network. + APIVersion = "2021-08-01" + // AzureStackCloudName is the cloud name of Azure Stack + AzureStackCloudName = "AZURESTACKCLOUD" ) // Interface is the client interface for Private Endpoints. @@ -27,8 +36,8 @@ import ( type Interface interface { // Get gets the private endpoint - Get(ctx context.Context, resourceGroupName string, privateEndpointName string, expand string) (result network.PrivateEndpoint, err error) + Get(ctx context.Context, resourceGroupName string, privateEndpointName string, expand string) (result network.PrivateEndpoint, rerr *retry.Error) // CreateOrUpdate creates or updates a private endpoint. - CreateOrUpdate(ctx context.Context, resourceGroupName string, endpointName string, privateEndpoint network.PrivateEndpoint, waitForCompletion bool) error + CreateOrUpdate(ctx context.Context, resourceGroupName string, endpointName string, privateEndpoint network.PrivateEndpoint, etag string, waitForCompletion bool) *retry.Error } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/azure_privatelinkserviceclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/azure_privatelinkserviceclient.go new file mode 100644 index 000000000000..4477acf345a6 --- /dev/null +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/azure_privatelinkserviceclient.go @@ -0,0 +1,460 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package privatelinkserviceclient implements the client for PrivateLinkService. +package privatelinkserviceclient + +import ( + "context" + "net/http" + "strings" + "time" + + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/to" + + "k8s.io/client-go/util/flowcontrol" + "k8s.io/klog/v2" + + azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" + "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" + "sigs.k8s.io/cloud-provider-azure/pkg/metrics" + "sigs.k8s.io/cloud-provider-azure/pkg/retry" +) + +var _ Interface = &Client{} + +const ( + PLSResourceType = "Microsoft.Network/privatelinkservices" + PEConnResourceType = "privateEndpointConnections" +) + +// Client implements privatelinkservice Interface. +type Client struct { + armClient armclient.Interface + cloudName string + subscriptionID string + + // Rate limiting configures. + rateLimiterReader flowcontrol.RateLimiter + rateLimiterWriter flowcontrol.RateLimiter + + // ARM throttling configures. + RetryAfterReader time.Time + RetryAfterWriter time.Time +} + +// New creates a new private link service client. +func New(config *azclients.ClientConfig) *Client { + + apiVersion := APIVersion + if strings.EqualFold(config.CloudName, AzureStackCloudName) && !config.DisableAzureStackCloud { + apiVersion = AzureStackCloudAPIVersion + } + armClient := armclient.New(config.Authorizer, *config, config.ResourceManagerEndpoint, apiVersion) + + rateLimiterReader, rateLimiterWriter := azclients.NewRateLimiter(config.RateLimitConfig) + if azclients.RateLimitEnabled(config.RateLimitConfig) { + klog.V(2).Infof("Azure PrivateLinkServicesClient (read ops) using rate limit config: QPS=%g, bucket=%d", + config.RateLimitConfig.CloudProviderRateLimitQPS, + config.RateLimitConfig.CloudProviderRateLimitBucket) + klog.V(2).Infof("Azure PrivateLinkServicesClient (write ops) using rate limit config: QPS=%g, bucket=%d", + config.RateLimitConfig.CloudProviderRateLimitQPSWrite, + config.RateLimitConfig.CloudProviderRateLimitBucketWrite) + } + + client := &Client{ + armClient: armClient, + rateLimiterReader: rateLimiterReader, + rateLimiterWriter: rateLimiterWriter, + subscriptionID: config.SubscriptionID, + cloudName: config.CloudName, + } + return client +} + +// CreateOrUpdate creates or updates a private link service . +func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, privateLinkServiceName string, privateLinkService network.PrivateLinkService, etag string) *retry.Error { + mc := metrics.NewMetricContext("private_link_services", "create_or_update", resourceGroupName, c.subscriptionID, "") + + // Report errors if the client is rate limited. + if !c.rateLimiterWriter.TryAccept() { + mc.RateLimitedCount() + return retry.GetRateLimitError(true, "PLSCreateOrUpdate") + } + + // Report errors if the client is throttled. + if c.RetryAfterWriter.After(time.Now()) { + mc.ThrottledCount() + rerr := retry.GetThrottlingError("PLSCreateOrUpdate", "client throttled", c.RetryAfterWriter) + return rerr + } + + rerr := c.createOrUpdatePLS(ctx, resourceGroupName, privateLinkServiceName, privateLinkService, etag) + mc.Observe(rerr) + if rerr != nil { + if rerr.IsThrottled() { + // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. + c.RetryAfterWriter = rerr.RetryAfter + } + + return rerr + } + return nil +} +func (c *Client) createOrUpdatePLS(ctx context.Context, resourceGroupName string, privateLinkServiceName string, parameters network.PrivateLinkService, etag string) *retry.Error { + resourceID := armclient.GetResourceID( + c.subscriptionID, + resourceGroupName, + PLSResourceType, + privateLinkServiceName, + ) + decorators := []autorest.PrepareDecorator{} + if etag != "" { + decorators = append(decorators, autorest.WithHeader("If-Match", autorest.String(etag))) + } + + response, rerr := c.armClient.PutResource(ctx, resourceID, parameters, decorators...) + defer c.armClient.CloseResponse(ctx, response) + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privatelinkservice.put.request", resourceID, rerr.Error()) + return rerr + } + + if response != nil && response.StatusCode != http.StatusNoContent { + _, rerr = c.createOrUpdateResponder(response) + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privatelinkservice.put.respond", resourceID, rerr.Error()) + return rerr + } + } + return nil +} + +func (c *Client) createOrUpdateResponder(resp *http.Response) (*network.PrivateLinkService, *retry.Error) { + result := &network.PrivateLinkService{} + err := autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result)) + result.Response = autorest.Response{Response: resp} + return result, retry.GetError(resp, err) +} + +// Get gets the private link service +func (c *Client) Get(ctx context.Context, resourceGroupName string, privateLinkServiceName string, expand string) (network.PrivateLinkService, *retry.Error) { + mc := metrics.NewMetricContext("private_link_services", "get", resourceGroupName, c.subscriptionID, "") + + // Report errors if the client is rate limited. + if !c.rateLimiterReader.TryAccept() { + mc.RateLimitedCount() + return network.PrivateLinkService{}, retry.GetRateLimitError(false, "PLSGet") + } + + // Report errors if the client is throttled. + if c.RetryAfterReader.After(time.Now()) { + mc.ThrottledCount() + rerr := retry.GetThrottlingError("PLSGet", "client throttled", c.RetryAfterReader) + return network.PrivateLinkService{}, rerr + } + result, rerr := c.getPLS(ctx, resourceGroupName, privateLinkServiceName, expand) + + mc.Observe(rerr) + if rerr != nil { + if rerr.IsThrottled() { + // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. + c.RetryAfterReader = rerr.RetryAfter + } + return result, rerr + } + return result, nil +} + +// getPLS gets a privatelinkservice. +func (c *Client) getPLS(ctx context.Context, resourceGroupName string, privateLinkServiceName string, expand string) (network.PrivateLinkService, *retry.Error) { + resourceID := armclient.GetResourceID( + c.subscriptionID, + resourceGroupName, + PLSResourceType, + privateLinkServiceName, + ) + result := network.PrivateLinkService{} + response, rerr := c.armClient.GetResourceWithExpandQuery(ctx, resourceID, expand) + defer c.armClient.CloseResponse(ctx, response) + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privatelinkservice.get.request", resourceID, rerr.Error()) + return result, rerr + } + + err := autorest.Respond( + response, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result)) + if err != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privatelinkservice.get.respond", resourceID, err) + return result, retry.GetError(response, err) + } + + result.Response = autorest.Response{Response: response} + return result, nil +} + +/// List gets a list of PrivateLinkServices in the resource group. +func (c *Client) List(ctx context.Context, resourceGroupName string) ([]network.PrivateLinkService, *retry.Error) { + mc := metrics.NewMetricContext("private_link_services", "list", resourceGroupName, c.subscriptionID, "") + + // Report errors if the client is rate limited. + if !c.rateLimiterReader.TryAccept() { + mc.RateLimitedCount() + return nil, retry.GetRateLimitError(false, "PLSList") + } + + // Report errors if the client is throttled. + if c.RetryAfterReader.After(time.Now()) { + mc.ThrottledCount() + rerr := retry.GetThrottlingError("PLSList", "client throttled", c.RetryAfterReader) + return nil, rerr + } + + result, rerr := c.listPLS(ctx, resourceGroupName) + mc.Observe(rerr) + if rerr != nil { + if rerr.IsThrottled() { + // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. + c.RetryAfterReader = rerr.RetryAfter + } + + return result, rerr + } + + return result, nil +} + +// listPLS gets a list of PrivateLinkServices in the resource group. +func (c *Client) listPLS(ctx context.Context, resourceGroupName string) ([]network.PrivateLinkService, *retry.Error) { + resourceID := armclient.GetResourceListID(c.subscriptionID, resourceGroupName, PLSResourceType) + result := make([]network.PrivateLinkService, 0) + page := &PrivateLinkServiceListResultPage{} + page.fn = c.listNextResults + + resp, rerr := c.armClient.GetResource(ctx, resourceID) + defer c.armClient.CloseResponse(ctx, resp) + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privatelinkservice.list.request", resourceID, rerr.Error()) + return result, rerr + } + + var err error + page.plslr, err = c.listResponder(resp) + if err != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privatelinkservice.list.respond", resourceID, err) + return result, retry.GetError(resp, err) + } + + for { + result = append(result, page.Values()...) + + // Abort the loop when there's no nextLink in the response. + if to.String(page.Response().NextLink) == "" { + break + } + + if err = page.NextWithContext(ctx); err != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "privatelinkservice.list.next", resourceID, err) + return result, retry.GetError(page.Response().Response.Response, err) + } + } + + return result, nil +} + +func (c *Client) Delete(ctx context.Context, resourceGroupName string, privateLinkServiceName string) *retry.Error { + mc := metrics.NewMetricContext("private_link_services", "delete", resourceGroupName, c.subscriptionID, "") + + // Report errors if the client is rate limited. + if !c.rateLimiterWriter.TryAccept() { + mc.RateLimitedCount() + return retry.GetRateLimitError(true, "PLSDelete") + } + + // Report errors if the client is throttled. + if c.RetryAfterWriter.After(time.Now()) { + mc.ThrottledCount() + rerr := retry.GetThrottlingError("PLSDelete", "client throttled", c.RetryAfterWriter) + return rerr + } + + rerr := c.deletePLS(ctx, resourceGroupName, privateLinkServiceName) + mc.Observe(rerr) + if rerr != nil { + if rerr.IsThrottled() { + // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. + c.RetryAfterWriter = rerr.RetryAfter + } + + return rerr + } + + return nil +} + +// deletePLS deletes a privatelinkservice by name. +func (c *Client) deletePLS(ctx context.Context, resourceGroupName string, privateLinkServiceName string) *retry.Error { + resourceID := armclient.GetResourceID( + c.subscriptionID, + resourceGroupName, + PLSResourceType, + privateLinkServiceName, + ) + + return c.armClient.DeleteResource(ctx, resourceID) +} + +func (c *Client) DeletePEConnection(ctx context.Context, resourceGroupName string, privateLinkServiceName string, privateEndpointConnectionName string) *retry.Error { + mc := metrics.NewMetricContext("private_endpoint_connection", "delete", resourceGroupName, c.subscriptionID, "") + + // Report errors if the client is rate limited. + if !c.rateLimiterWriter.TryAccept() { + mc.RateLimitedCount() + return retry.GetRateLimitError(true, "PEConnDelete") + } + + // Report errors if the client is throttled. + if c.RetryAfterWriter.After(time.Now()) { + mc.ThrottledCount() + rerr := retry.GetThrottlingError("PEConnDelete", "client throttled", c.RetryAfterWriter) + return rerr + } + + rerr := c.deletePEConn(ctx, resourceGroupName, privateLinkServiceName, privateEndpointConnectionName) + mc.Observe(rerr) + if rerr != nil { + if rerr.IsThrottled() { + // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. + c.RetryAfterWriter = rerr.RetryAfter + } + + return rerr + } + + return nil +} + +// deletePLS deletes a private endpoint connection by name. +func (c *Client) deletePEConn(ctx context.Context, resourceGroupName string, privateLinkServiceName string, privateEndpointConnectionName string) *retry.Error { + resourceID := armclient.GetChildResourceID( + c.subscriptionID, + resourceGroupName, + PLSResourceType, + privateLinkServiceName, + PEConnResourceType, + privateEndpointConnectionName, + ) + + return c.armClient.DeleteResource(ctx, resourceID) +} + +func (c *Client) listResponder(resp *http.Response) (result network.PrivateLinkServiceListResult, err error) { + err = autorest.Respond( + resp, + autorest.ByIgnoring(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result)) + result.Response = autorest.Response{Response: resp} + return +} + +// privateLinkServiceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (c *Client) privateLinkServiceListResultPreparer(ctx context.Context, plslr network.PrivateLinkServiceListResult) (*http.Request, error) { + if plslr.NextLink == nil || len(to.String(plslr.NextLink)) < 1 { + return nil, nil + } + + decorators := []autorest.PrepareDecorator{ + autorest.WithBaseURL(to.String(plslr.NextLink)), + } + return c.armClient.PrepareGetRequest(ctx, decorators...) +} + +// listNextResults retrieves the next set of results, if any. +func (c *Client) listNextResults(ctx context.Context, lastResults network.PrivateLinkServiceListResult) (result network.PrivateLinkServiceListResult, err error) { + req, err := c.privateLinkServiceListResultPreparer(ctx, lastResults) + if err != nil { + return result, autorest.NewErrorWithError(err, "privatelinkserviceclient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, rerr := c.armClient.Send(ctx, req) + defer c.armClient.CloseResponse(ctx, resp) + if rerr != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(rerr.Error(), "privatelinkserviceclient", "listNextResults", resp, "Failure sending next results request") + } + + result, err = c.listResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "privatelinkserviceclient", "listNextResults", resp, "Failure responding to next results request") + } + + return +} + +// PrivateLinkServiceListResultPage contains a page of PrivateLinkService values. +type PrivateLinkServiceListResultPage struct { + fn func(context.Context, network.PrivateLinkServiceListResult) (network.PrivateLinkServiceListResult, error) + plslr network.PrivateLinkServiceListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PrivateLinkServiceListResultPage) NextWithContext(ctx context.Context) (err error) { + next, err := page.fn(ctx, page.plslr) + if err != nil { + return err + } + page.plslr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PrivateLinkServiceListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateLinkServiceListResultPage) NotDone() bool { + return !page.plslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PrivateLinkServiceListResultPage) Response() network.PrivateLinkServiceListResult { + return page.plslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PrivateLinkServiceListResultPage) Values() []network.PrivateLinkService { + if page.plslr.IsEmpty() { + return nil + } + return *page.plslr.Value +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/doc.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/doc.go new file mode 100644 index 000000000000..148b675baf35 --- /dev/null +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package privatelinkserviceclient implements the client for PrivateLinkService. +package privatelinkserviceclient // import "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient" diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/interface.go new file mode 100644 index 000000000000..6ca0fd56bb5c --- /dev/null +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/interface.go @@ -0,0 +1,54 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package privatelinkserviceclient + +import ( + "context" + + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + + "sigs.k8s.io/cloud-provider-azure/pkg/retry" +) + +const ( + // APIVersion is the API version for network. + APIVersion = "2021-08-01" + // AzureStackCloudAPIVersion is the API version for Azure Stack + AzureStackCloudAPIVersion = "2019-03-01" + // AzureStackCloudName is the cloud name of Azure Stack + AzureStackCloudName = "AZURESTACKCLOUD" +) + +// Interface is the client interface for Private Link Services. +// Don't forget to run "hack/update-mock-clients.sh" command to generate the mock client. +type Interface interface { + + // Get gets the private link service + Get(ctx context.Context, resourceGroupName string, privateLinkServiceName string, expand string) (result network.PrivateLinkService, rerr *retry.Error) + + // List gets a list of PrivateLinkService in the resource group. + List(ctx context.Context, resourceGroupName string) (result []network.PrivateLinkService, rerr *retry.Error) + + // CreateOrUpdate creates or updates a private link service. + CreateOrUpdate(ctx context.Context, resourceGroupName string, privateLinkServiceName string, privateLinkService network.PrivateLinkService, etag string) *retry.Error + + // Delete deletes a private link service by name. + Delete(ctx context.Context, resourceGroupName string, privateLinkServiceName string) *retry.Error + + // Delete deletes a private endpoint connection to the private link service by name + DeletePEConnection(ctx context.Context, resourceGroupName string, privateLinkServiceName string, privateEndpointConnectionName string) *retry.Error +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/mockprivatelinkserviceclient/doc.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/mockprivatelinkserviceclient/doc.go new file mode 100644 index 000000000000..b51d667dbe59 --- /dev/null +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/mockprivatelinkserviceclient/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package mockprivatelinkserviceclient implements the mock client for PrivateLinkService. +package mockprivatelinkserviceclient // import "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/mockprivatelinkserviceclient" diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/mockprivatelinkserviceclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/mockprivatelinkserviceclient/interface.go new file mode 100644 index 000000000000..eca997adfbc4 --- /dev/null +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/mockprivatelinkserviceclient/interface.go @@ -0,0 +1,126 @@ +// /* +// Copyright The Kubernetes Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// */ +// + +// Code generated by MockGen. DO NOT EDIT. +// Source: pkg/azureclients/privatelinkserviceclient/interface.go + +// Package mockprivatelinkserviceclient is a generated GoMock package. +package mockprivatelinkserviceclient + +import ( + context "context" + reflect "reflect" + + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + gomock "github.com/golang/mock/gomock" + retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" +) + +// MockInterface is a mock of Interface interface. +type MockInterface struct { + ctrl *gomock.Controller + recorder *MockInterfaceMockRecorder +} + +// MockInterfaceMockRecorder is the mock recorder for MockInterface. +type MockInterfaceMockRecorder struct { + mock *MockInterface +} + +// NewMockInterface creates a new mock instance. +func NewMockInterface(ctrl *gomock.Controller) *MockInterface { + mock := &MockInterface{ctrl: ctrl} + mock.recorder = &MockInterfaceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockInterface) EXPECT() *MockInterfaceMockRecorder { + return m.recorder +} + +// CreateOrUpdate mocks base method. +func (m *MockInterface) CreateOrUpdate(ctx context.Context, resourceGroupName, privateLinkServiceName string, privateLinkService network.PrivateLinkService, etag string) *retry.Error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateOrUpdate", ctx, resourceGroupName, privateLinkServiceName, privateLinkService, etag) + ret0, _ := ret[0].(*retry.Error) + return ret0 +} + +// CreateOrUpdate indicates an expected call of CreateOrUpdate. +func (mr *MockInterfaceMockRecorder) CreateOrUpdate(ctx, resourceGroupName, privateLinkServiceName, privateLinkService, etag interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdate", reflect.TypeOf((*MockInterface)(nil).CreateOrUpdate), ctx, resourceGroupName, privateLinkServiceName, privateLinkService, etag) +} + +// Delete mocks base method. +func (m *MockInterface) Delete(ctx context.Context, resourceGroupName, privateLinkServiceName string) *retry.Error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Delete", ctx, resourceGroupName, privateLinkServiceName) + ret0, _ := ret[0].(*retry.Error) + return ret0 +} + +// Delete indicates an expected call of Delete. +func (mr *MockInterfaceMockRecorder) Delete(ctx, resourceGroupName, privateLinkServiceName interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockInterface)(nil).Delete), ctx, resourceGroupName, privateLinkServiceName) +} + +// DeletePEConnection mocks base method. +func (m *MockInterface) DeletePEConnection(ctx context.Context, resourceGroupName, privateLinkServiceName, privateEndpointConnectionName string) *retry.Error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeletePEConnection", ctx, resourceGroupName, privateLinkServiceName, privateEndpointConnectionName) + ret0, _ := ret[0].(*retry.Error) + return ret0 +} + +// DeletePEConnection indicates an expected call of DeletePEConnection. +func (mr *MockInterfaceMockRecorder) DeletePEConnection(ctx, resourceGroupName, privateLinkServiceName, privateEndpointConnectionName interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePEConnection", reflect.TypeOf((*MockInterface)(nil).DeletePEConnection), ctx, resourceGroupName, privateLinkServiceName, privateEndpointConnectionName) +} + +// Get mocks base method. +func (m *MockInterface) Get(ctx context.Context, resourceGroupName, privateLinkServiceName, expand string) (network.PrivateLinkService, *retry.Error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Get", ctx, resourceGroupName, privateLinkServiceName, expand) + ret0, _ := ret[0].(network.PrivateLinkService) + ret1, _ := ret[1].(*retry.Error) + return ret0, ret1 +} + +// Get indicates an expected call of Get. +func (mr *MockInterfaceMockRecorder) Get(ctx, resourceGroupName, privateLinkServiceName, expand interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockInterface)(nil).Get), ctx, resourceGroupName, privateLinkServiceName, expand) +} + +// List mocks base method. +func (m *MockInterface) List(ctx context.Context, resourceGroupName string) ([]network.PrivateLinkService, *retry.Error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "List", ctx, resourceGroupName) + ret0, _ := ret[0].([]network.PrivateLinkService) + ret1, _ := ret[1].(*retry.Error) + return ret0, ret1 +} + +// List indicates an expected call of List. +func (mr *MockInterfaceMockRecorder) List(ctx, resourceGroupName interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockInterface)(nil).List), ctx, resourceGroupName) +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/azure_publicipclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/azure_publicipclient.go index a440af3eb748..5aef7b970166 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/azure_publicipclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/azure_publicipclient.go @@ -23,7 +23,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/to" @@ -39,6 +39,8 @@ import ( var _ Interface = &Client{} +const publicIPResourceType = "Microsoft.Network/publicIPAddresses" + // Client implements PublicIPAddress client Interface. type Client struct { armClient armclient.Interface @@ -123,7 +125,7 @@ func (c *Client) getPublicIPAddress(ctx context.Context, resourceGroupName strin resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/publicIPAddresses", + publicIPResourceType, publicIPAddressName, ) result := network.PublicIPAddress{} @@ -258,9 +260,7 @@ func (c *Client) List(ctx context.Context, resourceGroupName string) ([]network. // listPublicIPAddress gets a list of PublicIPAddress in the resource group. func (c *Client) listPublicIPAddress(ctx context.Context, resourceGroupName string) ([]network.PublicIPAddress, *retry.Error) { - resourceID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/publicIPAddresses", - autorest.Encode("path", c.subscriptionID), - autorest.Encode("path", resourceGroupName)) + resourceID := armclient.GetResourceListID(c.subscriptionID, resourceGroupName, publicIPResourceType) result := make([]network.PublicIPAddress, 0) page := &PublicIPAddressListResultPage{} page.fn = c.listNextResults @@ -332,7 +332,7 @@ func (c *Client) createOrUpdatePublicIP(ctx context.Context, resourceGroupName s resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/publicIPAddresses", + publicIPResourceType, publicIPAddressName, ) @@ -400,11 +400,11 @@ func (c *Client) deletePublicIP(ctx context.Context, resourceGroupName string, p resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/publicIPAddresses", + publicIPResourceType, publicIPAddressName, ) - return c.armClient.DeleteResource(ctx, resourceID, "") + return c.armClient.DeleteResource(ctx, resourceID) } func (c *Client) listResponder(resp *http.Response) (result network.PublicIPAddressListResult, err error) { @@ -525,8 +525,7 @@ func (c *Client) ListAll(ctx context.Context) ([]network.PublicIPAddress, *retry // listAllPublicIPAddress gets all of PublicIPAddress in the subscription. func (c *Client) listAllPublicIPAddress(ctx context.Context) ([]network.PublicIPAddress, *retry.Error) { - resourceID := fmt.Sprintf("/subscriptions/%s/providers/Microsoft.Network/publicIPAddresses", - autorest.Encode("path", c.subscriptionID)) + resourceID := armclient.GetProviderResourceID(c.subscriptionID, publicIPResourceType) result := make([]network.PublicIPAddress, 0) page := &PublicIPAddressListResultPage{} page.fn = c.listNextResults diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/interface.go index bb8cc34039a6..670c07a0213b 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/interface.go @@ -19,14 +19,14 @@ package publicipclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version for network. - APIVersion = "2021-02-01" + APIVersion = "2021-08-01" // AzureStackCloudAPIVersion is the API version for Azure Stack AzureStackCloudAPIVersion = "2018-11-01" diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/mockpublicipclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/mockpublicipclient/interface.go index 4030f145e409..eb22ba64c160 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/mockpublicipclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/mockpublicipclient/interface.go @@ -25,7 +25,7 @@ import ( context "context" reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" gomock "github.com/golang/mock/gomock" retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/azure_routeclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/azure_routeclient.go index e70801760764..b071beee0a5c 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/azure_routeclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/azure_routeclient.go @@ -22,7 +22,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" @@ -37,6 +37,8 @@ import ( var _ Interface = &Client{} +const routeTablesResourceType = "Microsoft.Network/routeTables" + // Client implements Route client Interface. type Client struct { armClient armclient.Interface @@ -119,20 +121,17 @@ func (c *Client) createOrUpdateRoute(ctx context.Context, resourceGroupName stri resourceID := armclient.GetChildResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/routeTables", + routeTablesResourceType, routeTableName, "routes", routeName, ) - decorators := []autorest.PrepareDecorator{ - autorest.WithPathParameters("{resourceID}", map[string]interface{}{"resourceID": resourceID}), - autorest.WithJSON(routeParameters), - } + decorators := []autorest.PrepareDecorator{} if etag != "" { decorators = append(decorators, autorest.WithHeader("If-Match", autorest.String(etag))) } - response, rerr := c.armClient.PutResourceWithDecorators(ctx, resourceID, routeParameters, decorators) + response, rerr := c.armClient.PutResource(ctx, resourceID, routeParameters, decorators...) defer c.armClient.CloseResponse(ctx, response) if rerr != nil { klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "route.put.request", resourceID, rerr.Error()) @@ -196,11 +195,11 @@ func (c *Client) deleteRoute(ctx context.Context, resourceGroupName string, rout resourceID := armclient.GetChildResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/routeTables", + routeTablesResourceType, routeTableName, "routes", routeName, ) - return c.armClient.DeleteResource(ctx, resourceID, "") + return c.armClient.DeleteResource(ctx, resourceID) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/interface.go index d59f57cb322b..c552888a54d7 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/interface.go @@ -19,14 +19,14 @@ package routeclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version for network. - APIVersion = "2021-02-01" + APIVersion = "2021-08-01" // AzureStackCloudAPIVersion is the API version for Azure Stack AzureStackCloudAPIVersion = "2018-11-01" // AzureStackCloudName is the cloud name of Azure Stack diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/mockrouteclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/mockrouteclient/interface.go index ba2ba061e457..914a43eb8abd 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/mockrouteclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/mockrouteclient/interface.go @@ -25,7 +25,7 @@ import ( context "context" reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" gomock "github.com/golang/mock/gomock" retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/azure_routetableclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/azure_routetableclient.go index 2ba1fbb99c94..fbfaba6f7b6a 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/azure_routetableclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/azure_routetableclient.go @@ -22,7 +22,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" @@ -37,6 +37,8 @@ import ( var _ Interface = &Client{} +const routeTablesResourceType = "Microsoft.Network/routeTables" + // Client implements RouteTable client Interface. type Client struct { armClient armclient.Interface @@ -119,7 +121,7 @@ func (c *Client) getRouteTable(ctx context.Context, resourceGroupName string, ro resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/routeTables", + routeTablesResourceType, routeTableName, ) result := network.RouteTable{} @@ -180,18 +182,15 @@ func (c *Client) createOrUpdateRouteTable(ctx context.Context, resourceGroupName resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/routeTables", + routeTablesResourceType, routeTableName, ) - decorators := []autorest.PrepareDecorator{ - autorest.WithPathParameters("{resourceID}", map[string]interface{}{"resourceID": resourceID}), - autorest.WithJSON(parameters), - } + decorators := []autorest.PrepareDecorator{} if etag != "" { decorators = append(decorators, autorest.WithHeader("If-Match", autorest.String(etag))) } - response, rerr := c.armClient.PutResourceWithDecorators(ctx, resourceID, parameters, decorators) + response, rerr := c.armClient.PutResource(ctx, resourceID, parameters, decorators...) defer c.armClient.CloseResponse(ctx, response) if rerr != nil { klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "routetable.put.request", resourceID, rerr.Error()) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/interface.go index 0584a733dc9d..1b467558939a 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/interface.go @@ -19,14 +19,14 @@ package routetableclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version for network. - APIVersion = "2021-02-01" + APIVersion = "2021-08-01" // AzureStackCloudAPIVersion is the API version for Azure Stack AzureStackCloudAPIVersion = "2018-11-01" // AzureStackCloudName is the cloud name of Azure Stack diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/mockroutetableclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/mockroutetableclient/interface.go index 6ff402517da6..2f350b48cd9f 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/mockroutetableclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/mockroutetableclient/interface.go @@ -25,7 +25,7 @@ import ( context "context" reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" gomock "github.com/golang/mock/gomock" retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/azure_securitygroupclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/azure_securitygroupclient.go index f625e7e4de25..dd76e6064f74 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/azure_securitygroupclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/azure_securitygroupclient.go @@ -18,12 +18,11 @@ package securitygroupclient import ( "context" - "fmt" "net/http" "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/to" @@ -39,6 +38,8 @@ import ( var _ Interface = &Client{} +const nsgResourceType = "Microsoft.Network/networkSecurityGroups" + // Client implements SecurityGroup client Interface. type Client struct { armClient armclient.Interface @@ -121,7 +122,7 @@ func (c *Client) getSecurityGroup(ctx context.Context, resourceGroupName string, resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/networkSecurityGroups", + nsgResourceType, networkSecurityGroupName, ) result := network.SecurityGroup{} @@ -179,9 +180,7 @@ func (c *Client) List(ctx context.Context, resourceGroupName string) ([]network. // listSecurityGroup gets a list of SecurityGroups in the resource group. func (c *Client) listSecurityGroup(ctx context.Context, resourceGroupName string) ([]network.SecurityGroup, *retry.Error) { - resourceID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkSecurityGroups", - autorest.Encode("path", c.subscriptionID), - autorest.Encode("path", resourceGroupName)) + resourceID := armclient.GetResourceListID(c.subscriptionID, resourceGroupName, nsgResourceType) result := make([]network.SecurityGroup, 0) page := &SecurityGroupListResultPage{} page.fn = c.listNextResults @@ -253,18 +252,15 @@ func (c *Client) createOrUpdateNSG(ctx context.Context, resourceGroupName string resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/networkSecurityGroups", + nsgResourceType, networkSecurityGroupName, ) - decorators := []autorest.PrepareDecorator{ - autorest.WithPathParameters("{resourceID}", map[string]interface{}{"resourceID": resourceID}), - autorest.WithJSON(parameters), - } + decorators := []autorest.PrepareDecorator{} if etag != "" { decorators = append(decorators, autorest.WithHeader("If-Match", autorest.String(etag))) } - response, rerr := c.armClient.PutResourceWithDecorators(ctx, resourceID, parameters, decorators) + response, rerr := c.armClient.PutResource(ctx, resourceID, parameters, decorators...) defer c.armClient.CloseResponse(ctx, response) if rerr != nil { klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "securityGroup.put.request", resourceID, rerr.Error()) @@ -328,11 +324,11 @@ func (c *Client) deleteNSG(ctx context.Context, resourceGroupName string, networ resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/networkSecurityGroups", + nsgResourceType, networkSecurityGroupName, ) - return c.armClient.DeleteResource(ctx, resourceID, "") + return c.armClient.DeleteResource(ctx, resourceID) } func (c *Client) listResponder(resp *http.Response) (result network.SecurityGroupListResult, err error) { diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/interface.go index 7dd0e0c3dde5..807eefd2d240 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/interface.go @@ -19,14 +19,14 @@ package securitygroupclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version for network. - APIVersion = "2021-02-01" + APIVersion = "2021-08-01" // AzureStackCloudAPIVersion is the API version for Azure Stack AzureStackCloudAPIVersion = "2018-11-01" // AzureStackCloudName is the cloud name of Azure Stack diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/mocksecuritygroupclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/mocksecuritygroupclient/interface.go index 54db4542d154..53c5b8e2fc24 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/mocksecuritygroupclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/mocksecuritygroupclient/interface.go @@ -25,7 +25,7 @@ import ( context "context" reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" gomock "github.com/golang/mock/gomock" retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/azure_snapshotclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/azure_snapshotclient.go index 256be5518ae6..54ff72ee394a 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/azure_snapshotclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/azure_snapshotclient.go @@ -18,7 +18,6 @@ package snapshotclient import ( "context" - "fmt" "net/http" "strings" "time" @@ -39,6 +38,8 @@ import ( var _ Interface = &Client{} +const snapshotsResourceType = "Microsoft.Compute/snapshots" + // Client implements Snapshot client Interface. type Client struct { armClient armclient.Interface @@ -86,8 +87,11 @@ func New(config *azclients.ClientConfig) *Client { } // Get gets a Snapshot. -func (c *Client) Get(ctx context.Context, resourceGroupName string, snapshotName string) (compute.Snapshot, *retry.Error) { - mc := metrics.NewMetricContext("snapshot", "get", resourceGroupName, c.subscriptionID, "") +func (c *Client) Get(ctx context.Context, subsID, resourceGroupName, snapshotName string) (compute.Snapshot, *retry.Error) { + if subsID == "" { + subsID = c.subscriptionID + } + mc := metrics.NewMetricContext("snapshot", "get", resourceGroupName, subsID, "") // Report errors if the client is rate limited. if !c.rateLimiterReader.TryAccept() { @@ -102,7 +106,7 @@ func (c *Client) Get(ctx context.Context, resourceGroupName string, snapshotName return compute.Snapshot{}, rerr } - result, rerr := c.getSnapshot(ctx, resourceGroupName, snapshotName) + result, rerr := c.getSnapshot(ctx, subsID, resourceGroupName, snapshotName) mc.Observe(rerr) if rerr != nil { if rerr.IsThrottled() { @@ -117,11 +121,11 @@ func (c *Client) Get(ctx context.Context, resourceGroupName string, snapshotName } // getSnapshot gets a Snapshot. -func (c *Client) getSnapshot(ctx context.Context, resourceGroupName string, snapshotName string) (compute.Snapshot, *retry.Error) { +func (c *Client) getSnapshot(ctx context.Context, subsID, resourceGroupName, snapshotName string) (compute.Snapshot, *retry.Error) { resourceID := armclient.GetResourceID( - c.subscriptionID, + subsID, resourceGroupName, - "Microsoft.Compute/snapshots", + snapshotsResourceType, snapshotName, ) result := compute.Snapshot{} @@ -147,8 +151,11 @@ func (c *Client) getSnapshot(ctx context.Context, resourceGroupName string, snap } // Delete deletes a Snapshot by name. -func (c *Client) Delete(ctx context.Context, resourceGroupName string, snapshotName string) *retry.Error { - mc := metrics.NewMetricContext("snapshot", "delete", resourceGroupName, c.subscriptionID, "") +func (c *Client) Delete(ctx context.Context, subsID, resourceGroupName, snapshotName string) *retry.Error { + if subsID == "" { + subsID = c.subscriptionID + } + mc := metrics.NewMetricContext("snapshot", "delete", resourceGroupName, subsID, "") // Report errors if the client is rate limited. if !c.rateLimiterWriter.TryAccept() { @@ -163,7 +170,7 @@ func (c *Client) Delete(ctx context.Context, resourceGroupName string, snapshotN return rerr } - rerr := c.deleteSnapshot(ctx, resourceGroupName, snapshotName) + rerr := c.deleteSnapshot(ctx, subsID, resourceGroupName, snapshotName) mc.Observe(rerr) if rerr != nil { if rerr.IsThrottled() { @@ -178,20 +185,23 @@ func (c *Client) Delete(ctx context.Context, resourceGroupName string, snapshotN } // deleteSnapshot deletes a PublicIPAddress by name. -func (c *Client) deleteSnapshot(ctx context.Context, resourceGroupName string, snapshotName string) *retry.Error { +func (c *Client) deleteSnapshot(ctx context.Context, subsID, resourceGroupName, snapshotName string) *retry.Error { resourceID := armclient.GetResourceID( - c.subscriptionID, + subsID, resourceGroupName, - "Microsoft.Compute/snapshots", + snapshotsResourceType, snapshotName, ) - return c.armClient.DeleteResource(ctx, resourceID, "") + return c.armClient.DeleteResource(ctx, resourceID) } // CreateOrUpdate creates or updates a Snapshot. -func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot compute.Snapshot) *retry.Error { - mc := metrics.NewMetricContext("snapshot", "create_or_update", resourceGroupName, c.subscriptionID, "") +func (c *Client) CreateOrUpdate(ctx context.Context, subsID, resourceGroupName, snapshotName string, snapshot compute.Snapshot) *retry.Error { + if subsID == "" { + subsID = c.subscriptionID + } + mc := metrics.NewMetricContext("snapshot", "create_or_update", resourceGroupName, subsID, "") // Report errors if the client is rate limited. if !c.rateLimiterWriter.TryAccept() { @@ -206,7 +216,7 @@ func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, s return rerr } - rerr := c.createOrUpdateSnapshot(ctx, resourceGroupName, snapshotName, snapshot) + rerr := c.createOrUpdateSnapshot(ctx, subsID, resourceGroupName, snapshotName, snapshot) mc.Observe(rerr) if rerr != nil { if rerr.IsThrottled() { @@ -221,11 +231,11 @@ func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, s } // createOrUpdateSnapshot creates or updates a Snapshot. -func (c *Client) createOrUpdateSnapshot(ctx context.Context, resourceGroupName string, snapshotName string, snapshot compute.Snapshot) *retry.Error { +func (c *Client) createOrUpdateSnapshot(ctx context.Context, subsID, resourceGroupName, snapshotName string, snapshot compute.Snapshot) *retry.Error { resourceID := armclient.GetResourceID( - c.subscriptionID, + subsID, resourceGroupName, - "Microsoft.Compute/snapshots", + snapshotsResourceType, snapshotName, ) @@ -258,8 +268,11 @@ func (c *Client) createOrUpdateResponder(resp *http.Response) (*compute.Snapshot } // ListByResourceGroup get a list snapshots by resourceGroup. -func (c *Client) ListByResourceGroup(ctx context.Context, resourceGroupName string) ([]compute.Snapshot, *retry.Error) { - mc := metrics.NewMetricContext("snapshot", "list_by_resource_group", resourceGroupName, c.subscriptionID, "") +func (c *Client) ListByResourceGroup(ctx context.Context, subsID, resourceGroupName string) ([]compute.Snapshot, *retry.Error) { + if subsID == "" { + subsID = c.subscriptionID + } + mc := metrics.NewMetricContext("snapshot", "list_by_resource_group", resourceGroupName, subsID, "") // Report errors if the client is rate limited. if !c.rateLimiterReader.TryAccept() { @@ -274,7 +287,7 @@ func (c *Client) ListByResourceGroup(ctx context.Context, resourceGroupName stri return nil, rerr } - result, rerr := c.listSnapshotsByResourceGroup(ctx, resourceGroupName) + result, rerr := c.listSnapshotsByResourceGroup(ctx, subsID, resourceGroupName) mc.Observe(rerr) if rerr != nil { if rerr.IsThrottled() { @@ -289,10 +302,11 @@ func (c *Client) ListByResourceGroup(ctx context.Context, resourceGroupName stri } // listSnapshotsByResourceGroup gets a list of snapshots in the resource group. -func (c *Client) listSnapshotsByResourceGroup(ctx context.Context, resourceGroupName string) ([]compute.Snapshot, *retry.Error) { - resourceID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/snapshots", - autorest.Encode("path", c.subscriptionID), - autorest.Encode("path", resourceGroupName)) +func (c *Client) listSnapshotsByResourceGroup(ctx context.Context, subsID, resourceGroupName string) ([]compute.Snapshot, *retry.Error) { + if subsID == "" { + subsID = c.subscriptionID + } + resourceID := armclient.GetResourceListID(subsID, resourceGroupName, snapshotsResourceType) result := make([]compute.Snapshot, 0) page := &SnapshotListPage{} page.fn = c.listNextResults diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/interface.go index f0f6f285a5af..731db0d291c5 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/interface.go @@ -37,14 +37,14 @@ const ( // Don't forget to run "hack/update-mock-clients.sh" command to generate the mock client. type Interface interface { // Get gets a Snapshot. - Get(ctx context.Context, resourceGroupName string, snapshotName string) (compute.Snapshot, *retry.Error) + Get(ctx context.Context, subsID, resourceGroupName, snapshotName string) (compute.Snapshot, *retry.Error) // Delete deletes a Snapshot by name. - Delete(ctx context.Context, resourceGroupName string, snapshotName string) *retry.Error + Delete(ctx context.Context, subsID, resourceGroupName, snapshotName string) *retry.Error // ListByResourceGroup get a list snapshots by resourceGroup. - ListByResourceGroup(ctx context.Context, resourceGroupName string) ([]compute.Snapshot, *retry.Error) + ListByResourceGroup(ctx context.Context, subsID, resourceGroupName string) ([]compute.Snapshot, *retry.Error) // CreateOrUpdate creates or updates a Snapshot. - CreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot compute.Snapshot) *retry.Error + CreateOrUpdate(ctx context.Context, subsID, resourceGroupName, snapshotName string, snapshot compute.Snapshot) *retry.Error } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/mocksnapshotclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/mocksnapshotclient/interface.go index 7936abf3de73..6c9809abf1d5 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/mocksnapshotclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/mocksnapshotclient/interface.go @@ -54,59 +54,59 @@ func (m *MockInterface) EXPECT() *MockInterfaceMockRecorder { } // CreateOrUpdate mocks base method. -func (m *MockInterface) CreateOrUpdate(ctx context.Context, resourceGroupName, snapshotName string, snapshot compute.Snapshot) *retry.Error { +func (m *MockInterface) CreateOrUpdate(ctx context.Context, subsID, resourceGroupName, snapshotName string, snapshot compute.Snapshot) *retry.Error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CreateOrUpdate", ctx, resourceGroupName, snapshotName, snapshot) + ret := m.ctrl.Call(m, "CreateOrUpdate", ctx, subsID, resourceGroupName, snapshotName, snapshot) ret0, _ := ret[0].(*retry.Error) return ret0 } // CreateOrUpdate indicates an expected call of CreateOrUpdate. -func (mr *MockInterfaceMockRecorder) CreateOrUpdate(ctx, resourceGroupName, snapshotName, snapshot interface{}) *gomock.Call { +func (mr *MockInterfaceMockRecorder) CreateOrUpdate(ctx, subsID, resourceGroupName, snapshotName, snapshot interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdate", reflect.TypeOf((*MockInterface)(nil).CreateOrUpdate), ctx, resourceGroupName, snapshotName, snapshot) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdate", reflect.TypeOf((*MockInterface)(nil).CreateOrUpdate), ctx, subsID, resourceGroupName, snapshotName, snapshot) } // Delete mocks base method. -func (m *MockInterface) Delete(ctx context.Context, resourceGroupName, snapshotName string) *retry.Error { +func (m *MockInterface) Delete(ctx context.Context, subsID, resourceGroupName, snapshotName string) *retry.Error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", ctx, resourceGroupName, snapshotName) + ret := m.ctrl.Call(m, "Delete", ctx, subsID, resourceGroupName, snapshotName) ret0, _ := ret[0].(*retry.Error) return ret0 } // Delete indicates an expected call of Delete. -func (mr *MockInterfaceMockRecorder) Delete(ctx, resourceGroupName, snapshotName interface{}) *gomock.Call { +func (mr *MockInterfaceMockRecorder) Delete(ctx, subsID, resourceGroupName, snapshotName interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockInterface)(nil).Delete), ctx, resourceGroupName, snapshotName) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockInterface)(nil).Delete), ctx, subsID, resourceGroupName, snapshotName) } // Get mocks base method. -func (m *MockInterface) Get(ctx context.Context, resourceGroupName, snapshotName string) (compute.Snapshot, *retry.Error) { +func (m *MockInterface) Get(ctx context.Context, subsID, resourceGroupName, snapshotName string) (compute.Snapshot, *retry.Error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", ctx, resourceGroupName, snapshotName) + ret := m.ctrl.Call(m, "Get", ctx, subsID, resourceGroupName, snapshotName) ret0, _ := ret[0].(compute.Snapshot) ret1, _ := ret[1].(*retry.Error) return ret0, ret1 } // Get indicates an expected call of Get. -func (mr *MockInterfaceMockRecorder) Get(ctx, resourceGroupName, snapshotName interface{}) *gomock.Call { +func (mr *MockInterfaceMockRecorder) Get(ctx, subsID, resourceGroupName, snapshotName interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockInterface)(nil).Get), ctx, resourceGroupName, snapshotName) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockInterface)(nil).Get), ctx, subsID, resourceGroupName, snapshotName) } // ListByResourceGroup mocks base method. -func (m *MockInterface) ListByResourceGroup(ctx context.Context, resourceGroupName string) ([]compute.Snapshot, *retry.Error) { +func (m *MockInterface) ListByResourceGroup(ctx context.Context, subsID, resourceGroupName string) ([]compute.Snapshot, *retry.Error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListByResourceGroup", ctx, resourceGroupName) + ret := m.ctrl.Call(m, "ListByResourceGroup", ctx, subsID, resourceGroupName) ret0, _ := ret[0].([]compute.Snapshot) ret1, _ := ret[1].(*retry.Error) return ret0, ret1 } // ListByResourceGroup indicates an expected call of ListByResourceGroup. -func (mr *MockInterfaceMockRecorder) ListByResourceGroup(ctx, resourceGroupName interface{}) *gomock.Call { +func (mr *MockInterfaceMockRecorder) ListByResourceGroup(ctx, subsID, resourceGroupName interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByResourceGroup", reflect.TypeOf((*MockInterface)(nil).ListByResourceGroup), ctx, resourceGroupName) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByResourceGroup", reflect.TypeOf((*MockInterface)(nil).ListByResourceGroup), ctx, subsID, resourceGroupName) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/azure_storageaccountclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/azure_storageaccountclient.go index 34bc3c1d72e4..4acb3e2b953d 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/azure_storageaccountclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/azure_storageaccountclient.go @@ -18,7 +18,6 @@ package storageaccountclient import ( "context" - "fmt" "net/http" "strings" "time" @@ -39,6 +38,8 @@ import ( var _ Interface = &Client{} +const saResourceType = "Microsoft.Storage/storageAccounts" + // Client implements StorageAccount client Interface. type Client struct { armClient armclient.Interface @@ -86,8 +87,11 @@ func New(config *azclients.ClientConfig) *Client { } // GetProperties gets properties of the StorageAccount. -func (c *Client) GetProperties(ctx context.Context, resourceGroupName string, accountName string) (storage.Account, *retry.Error) { - mc := metrics.NewMetricContext("storage_account", "get", resourceGroupName, c.subscriptionID, "") +func (c *Client) GetProperties(ctx context.Context, subsID, resourceGroupName, accountName string) (storage.Account, *retry.Error) { + if subsID == "" { + subsID = c.subscriptionID + } + mc := metrics.NewMetricContext("storage_account", "get", resourceGroupName, subsID, "") // Report errors if the client is rate limited. if !c.rateLimiterReader.TryAccept() { @@ -102,7 +106,7 @@ func (c *Client) GetProperties(ctx context.Context, resourceGroupName string, ac return storage.Account{}, rerr } - result, rerr := c.getStorageAccount(ctx, resourceGroupName, accountName) + result, rerr := c.getStorageAccount(ctx, subsID, resourceGroupName, accountName) mc.Observe(rerr) if rerr != nil { if rerr.IsThrottled() { @@ -117,11 +121,11 @@ func (c *Client) GetProperties(ctx context.Context, resourceGroupName string, ac } // getStorageAccount gets properties of the StorageAccount. -func (c *Client) getStorageAccount(ctx context.Context, resourceGroupName string, accountName string) (storage.Account, *retry.Error) { +func (c *Client) getStorageAccount(ctx context.Context, subsID, resourceGroupName string, accountName string) (storage.Account, *retry.Error) { resourceID := armclient.GetResourceID( - c.subscriptionID, + subsID, resourceGroupName, - "Microsoft.Storage/storageAccounts", + saResourceType, accountName, ) result := storage.Account{} @@ -147,8 +151,11 @@ func (c *Client) getStorageAccount(ctx context.Context, resourceGroupName string } // ListKeys get a list of storage account keys. -func (c *Client) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (storage.AccountListKeysResult, *retry.Error) { - mc := metrics.NewMetricContext("storage_account", "list_keys", resourceGroupName, c.subscriptionID, "") +func (c *Client) ListKeys(ctx context.Context, subsID, resourceGroupName, accountName string) (storage.AccountListKeysResult, *retry.Error) { + if subsID == "" { + subsID = c.subscriptionID + } + mc := metrics.NewMetricContext("storage_account", "list_keys", resourceGroupName, subsID, "") // Report errors if the client is rate limited. if !c.rateLimiterReader.TryAccept() { @@ -163,7 +170,7 @@ func (c *Client) ListKeys(ctx context.Context, resourceGroupName string, account return storage.AccountListKeysResult{}, rerr } - result, rerr := c.listStorageAccountKeys(ctx, resourceGroupName, accountName) + result, rerr := c.listStorageAccountKeys(ctx, subsID, resourceGroupName, accountName) mc.Observe(rerr) if rerr != nil { if rerr.IsThrottled() { @@ -178,11 +185,11 @@ func (c *Client) ListKeys(ctx context.Context, resourceGroupName string, account } // listStorageAccountKeys get a list of storage account keys. -func (c *Client) listStorageAccountKeys(ctx context.Context, resourceGroupName string, accountName string) (storage.AccountListKeysResult, *retry.Error) { +func (c *Client) listStorageAccountKeys(ctx context.Context, subsID, resourceGroupName, accountName string) (storage.AccountListKeysResult, *retry.Error) { resourceID := armclient.GetResourceID( - c.subscriptionID, + subsID, resourceGroupName, - "Microsoft.Storage/storageAccounts", + saResourceType, accountName, ) @@ -208,8 +215,11 @@ func (c *Client) listStorageAccountKeys(ctx context.Context, resourceGroupName s } // Create creates a StorageAccount. -func (c *Client) Create(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountCreateParameters) *retry.Error { - mc := metrics.NewMetricContext("storage_account", "create", resourceGroupName, c.subscriptionID, "") +func (c *Client) Create(ctx context.Context, subsID, resourceGroupName, accountName string, parameters storage.AccountCreateParameters) *retry.Error { + if subsID == "" { + subsID = c.subscriptionID + } + mc := metrics.NewMetricContext("storage_account", "create", resourceGroupName, subsID, "") // Report errors if the client is rate limited. if !c.rateLimiterWriter.TryAccept() { @@ -224,26 +234,24 @@ func (c *Client) Create(ctx context.Context, resourceGroupName string, accountNa return rerr } - rerr := c.createStorageAccount(ctx, resourceGroupName, accountName, parameters) + rerr := c.createStorageAccount(ctx, subsID, resourceGroupName, accountName, parameters) mc.Observe(rerr) if rerr != nil { if rerr.IsThrottled() { // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. c.RetryAfterWriter = rerr.RetryAfter } - return rerr } - return nil } // createStorageAccount creates or updates a StorageAccount. -func (c *Client) createStorageAccount(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountCreateParameters) *retry.Error { +func (c *Client) createStorageAccount(ctx context.Context, subsID, resourceGroupName, accountName string, parameters storage.AccountCreateParameters) *retry.Error { resourceID := armclient.GetResourceID( - c.subscriptionID, + subsID, resourceGroupName, - "Microsoft.Storage/storageAccounts", + saResourceType, accountName, ) @@ -276,8 +284,11 @@ func (c *Client) createResponder(resp *http.Response) (*storage.Account, *retry. } // Update updates a storage account. -func (c *Client) Update(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountUpdateParameters) *retry.Error { - mc := metrics.NewMetricContext("storage_account", "update", resourceGroupName, c.subscriptionID, "") +func (c *Client) Update(ctx context.Context, subsID, resourceGroupName, accountName string, parameters storage.AccountUpdateParameters) *retry.Error { + if subsID == "" { + subsID = c.subscriptionID + } + mc := metrics.NewMetricContext("storage_account", "update", resourceGroupName, subsID, "") // Report errors if the client is rate limited. if !c.rateLimiterWriter.TryAccept() { @@ -292,7 +303,7 @@ func (c *Client) Update(ctx context.Context, resourceGroupName string, accountNa return rerr } - rerr := c.updateStorageAccount(ctx, resourceGroupName, accountName, parameters) + rerr := c.updateStorageAccount(ctx, subsID, resourceGroupName, accountName, parameters) mc.Observe(rerr) if rerr != nil { if rerr.IsThrottled() { @@ -305,11 +316,11 @@ func (c *Client) Update(ctx context.Context, resourceGroupName string, accountNa } // updateStorageAccount updates a StorageAccount. -func (c *Client) updateStorageAccount(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountUpdateParameters) *retry.Error { +func (c *Client) updateStorageAccount(ctx context.Context, subsID, resourceGroupName, accountName string, parameters storage.AccountUpdateParameters) *retry.Error { resourceID := armclient.GetResourceID( - c.subscriptionID, + subsID, resourceGroupName, - "Microsoft.Storage/storageAccounts", + saResourceType, accountName, ) @@ -342,8 +353,11 @@ func (c *Client) updateResponder(resp *http.Response) (*storage.Account, *retry. } // Delete deletes a StorageAccount by name. -func (c *Client) Delete(ctx context.Context, resourceGroupName string, accountName string) *retry.Error { - mc := metrics.NewMetricContext("storage_account", "delete", resourceGroupName, c.subscriptionID, "") +func (c *Client) Delete(ctx context.Context, subsID, resourceGroupName, accountName string) *retry.Error { + if subsID == "" { + subsID = c.subscriptionID + } + mc := metrics.NewMetricContext("storage_account", "delete", resourceGroupName, subsID, "") // Report errors if the client is rate limited. if !c.rateLimiterWriter.TryAccept() { @@ -358,7 +372,7 @@ func (c *Client) Delete(ctx context.Context, resourceGroupName string, accountNa return rerr } - rerr := c.deleteStorageAccount(ctx, resourceGroupName, accountName) + rerr := c.deleteStorageAccount(ctx, subsID, resourceGroupName, accountName) mc.Observe(rerr) if rerr != nil { if rerr.IsThrottled() { @@ -373,20 +387,23 @@ func (c *Client) Delete(ctx context.Context, resourceGroupName string, accountNa } // deleteStorageAccount deletes a PublicIPAddress by name. -func (c *Client) deleteStorageAccount(ctx context.Context, resourceGroupName string, accountName string) *retry.Error { +func (c *Client) deleteStorageAccount(ctx context.Context, subsID, resourceGroupName, accountName string) *retry.Error { resourceID := armclient.GetResourceID( - c.subscriptionID, + subsID, resourceGroupName, - "Microsoft.Storage/storageAccounts", + saResourceType, accountName, ) - return c.armClient.DeleteResource(ctx, resourceID, "") + return c.armClient.DeleteResource(ctx, resourceID) } // ListByResourceGroup get a list storage accounts by resourceGroup. -func (c *Client) ListByResourceGroup(ctx context.Context, resourceGroupName string) ([]storage.Account, *retry.Error) { - mc := metrics.NewMetricContext("storage_account", "list_by_resource_group", resourceGroupName, c.subscriptionID, "") +func (c *Client) ListByResourceGroup(ctx context.Context, subsID, resourceGroupName string) ([]storage.Account, *retry.Error) { + if subsID == "" { + subsID = c.subscriptionID + } + mc := metrics.NewMetricContext("storage_account", "list_by_resource_group", resourceGroupName, subsID, "") // Report errors if the client is rate limited. if !c.rateLimiterReader.TryAccept() { @@ -401,25 +418,24 @@ func (c *Client) ListByResourceGroup(ctx context.Context, resourceGroupName stri return nil, rerr } - result, rerr := c.ListStorageAccountByResourceGroup(ctx, resourceGroupName) + result, rerr := c.ListStorageAccountByResourceGroup(ctx, subsID, resourceGroupName) mc.Observe(rerr) if rerr != nil { if rerr.IsThrottled() { // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. c.RetryAfterReader = rerr.RetryAfter } - return result, rerr } - return result, nil } // ListStorageAccountByResourceGroup get a list storage accounts by resourceGroup. -func (c *Client) ListStorageAccountByResourceGroup(ctx context.Context, resourceGroupName string) ([]storage.Account, *retry.Error) { - resourceID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Storage/storageAccounts", - autorest.Encode("path", c.subscriptionID), - autorest.Encode("path", resourceGroupName)) +func (c *Client) ListStorageAccountByResourceGroup(ctx context.Context, subsID, resourceGroupName string) ([]storage.Account, *retry.Error) { + if subsID == "" { + subsID = c.subscriptionID + } + resourceID := armclient.GetResourceListID(subsID, resourceGroupName, saResourceType) result := make([]storage.Account, 0) page := &AccountListResultPage{} page.fn = c.listNextResults diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/interface.go index 9c7389e8fe6f..bce755c39df5 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/interface.go @@ -37,20 +37,20 @@ const ( // Don't forget to run "hack/update-mock-clients.sh" command to generate the mock client. type Interface interface { // Create creates a StorageAccount. - Create(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountCreateParameters) *retry.Error + Create(ctx context.Context, subsID, resourceGroupName, accountName string, parameters storage.AccountCreateParameters) *retry.Error // Update updates a StorageAccount. - Update(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountUpdateParameters) *retry.Error + Update(ctx context.Context, subsID, resourceGroupName, accountName string, parameters storage.AccountUpdateParameters) *retry.Error // Delete deletes a StorageAccount by name. - Delete(ctx context.Context, resourceGroupName string, accountName string) *retry.Error + Delete(ctx context.Context, subsID, resourceGroupName, accountName string) *retry.Error // ListKeys get a list of storage account keys. - ListKeys(ctx context.Context, resourceGroupName string, accountName string) (storage.AccountListKeysResult, *retry.Error) + ListKeys(ctx context.Context, subsID, resourceGroupName, accountName string) (storage.AccountListKeysResult, *retry.Error) // ListByResourceGroup get a list storage accounts by resourceGroup. - ListByResourceGroup(ctx context.Context, resourceGroupName string) ([]storage.Account, *retry.Error) + ListByResourceGroup(ctx context.Context, subsID, resourceGroupName string) ([]storage.Account, *retry.Error) // GetProperties gets properties of the StorageAccount. - GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result storage.Account, rerr *retry.Error) + GetProperties(ctx context.Context, subsID, resourceGroupName, accountName string) (result storage.Account, rerr *retry.Error) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/mockstorageaccountclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/mockstorageaccountclient/interface.go index 8bad6f46cdb6..2bc75a0ab43d 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/mockstorageaccountclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/mockstorageaccountclient/interface.go @@ -54,88 +54,88 @@ func (m *MockInterface) EXPECT() *MockInterfaceMockRecorder { } // Create mocks base method. -func (m *MockInterface) Create(ctx context.Context, resourceGroupName, accountName string, parameters storage.AccountCreateParameters) *retry.Error { +func (m *MockInterface) Create(ctx context.Context, subsID, resourceGroupName, accountName string, parameters storage.AccountCreateParameters) *retry.Error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", ctx, resourceGroupName, accountName, parameters) + ret := m.ctrl.Call(m, "Create", ctx, subsID, resourceGroupName, accountName, parameters) ret0, _ := ret[0].(*retry.Error) return ret0 } // Create indicates an expected call of Create. -func (mr *MockInterfaceMockRecorder) Create(ctx, resourceGroupName, accountName, parameters interface{}) *gomock.Call { +func (mr *MockInterfaceMockRecorder) Create(ctx, subsID, resourceGroupName, accountName, parameters interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockInterface)(nil).Create), ctx, resourceGroupName, accountName, parameters) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockInterface)(nil).Create), ctx, subsID, resourceGroupName, accountName, parameters) } // Delete mocks base method. -func (m *MockInterface) Delete(ctx context.Context, resourceGroupName, accountName string) *retry.Error { +func (m *MockInterface) Delete(ctx context.Context, subsID, resourceGroupName, accountName string) *retry.Error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", ctx, resourceGroupName, accountName) + ret := m.ctrl.Call(m, "Delete", ctx, subsID, resourceGroupName, accountName) ret0, _ := ret[0].(*retry.Error) return ret0 } // Delete indicates an expected call of Delete. -func (mr *MockInterfaceMockRecorder) Delete(ctx, resourceGroupName, accountName interface{}) *gomock.Call { +func (mr *MockInterfaceMockRecorder) Delete(ctx, subsID, resourceGroupName, accountName interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockInterface)(nil).Delete), ctx, resourceGroupName, accountName) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockInterface)(nil).Delete), ctx, subsID, resourceGroupName, accountName) } // GetProperties mocks base method. -func (m *MockInterface) GetProperties(ctx context.Context, resourceGroupName, accountName string) (storage.Account, *retry.Error) { +func (m *MockInterface) GetProperties(ctx context.Context, subsID, resourceGroupName, accountName string) (storage.Account, *retry.Error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetProperties", ctx, resourceGroupName, accountName) + ret := m.ctrl.Call(m, "GetProperties", ctx, subsID, resourceGroupName, accountName) ret0, _ := ret[0].(storage.Account) ret1, _ := ret[1].(*retry.Error) return ret0, ret1 } // GetProperties indicates an expected call of GetProperties. -func (mr *MockInterfaceMockRecorder) GetProperties(ctx, resourceGroupName, accountName interface{}) *gomock.Call { +func (mr *MockInterfaceMockRecorder) GetProperties(ctx, subsID, resourceGroupName, accountName interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProperties", reflect.TypeOf((*MockInterface)(nil).GetProperties), ctx, resourceGroupName, accountName) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProperties", reflect.TypeOf((*MockInterface)(nil).GetProperties), ctx, subsID, resourceGroupName, accountName) } // ListByResourceGroup mocks base method. -func (m *MockInterface) ListByResourceGroup(ctx context.Context, resourceGroupName string) ([]storage.Account, *retry.Error) { +func (m *MockInterface) ListByResourceGroup(ctx context.Context, subsID, resourceGroupName string) ([]storage.Account, *retry.Error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListByResourceGroup", ctx, resourceGroupName) + ret := m.ctrl.Call(m, "ListByResourceGroup", ctx, subsID, resourceGroupName) ret0, _ := ret[0].([]storage.Account) ret1, _ := ret[1].(*retry.Error) return ret0, ret1 } // ListByResourceGroup indicates an expected call of ListByResourceGroup. -func (mr *MockInterfaceMockRecorder) ListByResourceGroup(ctx, resourceGroupName interface{}) *gomock.Call { +func (mr *MockInterfaceMockRecorder) ListByResourceGroup(ctx, subsID, resourceGroupName interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByResourceGroup", reflect.TypeOf((*MockInterface)(nil).ListByResourceGroup), ctx, resourceGroupName) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByResourceGroup", reflect.TypeOf((*MockInterface)(nil).ListByResourceGroup), ctx, subsID, resourceGroupName) } // ListKeys mocks base method. -func (m *MockInterface) ListKeys(ctx context.Context, resourceGroupName, accountName string) (storage.AccountListKeysResult, *retry.Error) { +func (m *MockInterface) ListKeys(ctx context.Context, subsID, resourceGroupName, accountName string) (storage.AccountListKeysResult, *retry.Error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListKeys", ctx, resourceGroupName, accountName) + ret := m.ctrl.Call(m, "ListKeys", ctx, subsID, resourceGroupName, accountName) ret0, _ := ret[0].(storage.AccountListKeysResult) ret1, _ := ret[1].(*retry.Error) return ret0, ret1 } // ListKeys indicates an expected call of ListKeys. -func (mr *MockInterfaceMockRecorder) ListKeys(ctx, resourceGroupName, accountName interface{}) *gomock.Call { +func (mr *MockInterfaceMockRecorder) ListKeys(ctx, subsID, resourceGroupName, accountName interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListKeys", reflect.TypeOf((*MockInterface)(nil).ListKeys), ctx, resourceGroupName, accountName) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListKeys", reflect.TypeOf((*MockInterface)(nil).ListKeys), ctx, subsID, resourceGroupName, accountName) } // Update mocks base method. -func (m *MockInterface) Update(ctx context.Context, resourceGroupName, accountName string, parameters storage.AccountUpdateParameters) *retry.Error { +func (m *MockInterface) Update(ctx context.Context, subsID, resourceGroupName, accountName string, parameters storage.AccountUpdateParameters) *retry.Error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", ctx, resourceGroupName, accountName, parameters) + ret := m.ctrl.Call(m, "Update", ctx, subsID, resourceGroupName, accountName, parameters) ret0, _ := ret[0].(*retry.Error) return ret0 } // Update indicates an expected call of Update. -func (mr *MockInterfaceMockRecorder) Update(ctx, resourceGroupName, accountName, parameters interface{}) *gomock.Call { +func (mr *MockInterfaceMockRecorder) Update(ctx, subsID, resourceGroupName, accountName, parameters interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockInterface)(nil).Update), ctx, resourceGroupName, accountName, parameters) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockInterface)(nil).Update), ctx, subsID, resourceGroupName, accountName, parameters) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/azure_subnetclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/azure_subnetclient.go index 05ebfa0b4d41..d90f29f17a9b 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/azure_subnetclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/azure_subnetclient.go @@ -22,7 +22,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/to" @@ -38,6 +38,8 @@ import ( var _ Interface = &Client{} +const vnetResourceType = "Microsoft.Network/virtualNetworks" + // Client implements Subnet client Interface. type Client struct { armClient armclient.Interface @@ -120,7 +122,7 @@ func (c *Client) getSubnet(ctx context.Context, resourceGroupName string, virtua resourceID := armclient.GetChildResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/virtualNetworks", + vnetResourceType, virtualNetworkName, "subnets", subnetName, @@ -183,7 +185,7 @@ func (c *Client) listSubnet(ctx context.Context, resourceGroupName string, virtu resourceID := armclient.GetChildResourcesListID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/virtualNetworks", + vnetResourceType, virtualNetworkName, "subnets") @@ -258,7 +260,7 @@ func (c *Client) createOrUpdateSubnet(ctx context.Context, resourceGroupName str resourceID := armclient.GetChildResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/virtualNetworks", + vnetResourceType, virtualNetworkName, "subnets", subnetName) @@ -327,12 +329,12 @@ func (c *Client) deleteSubnet(ctx context.Context, resourceGroupName string, vir resourceID := armclient.GetChildResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Network/virtualNetworks", + vnetResourceType, virtualNetworkName, "subnets", subnetName) - return c.armClient.DeleteResource(ctx, resourceID, "") + return c.armClient.DeleteResource(ctx, resourceID) } func (c *Client) listResponder(resp *http.Response) (result network.SubnetListResult, err error) { diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/interface.go index 28de4787a18a..21967c0b74ea 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/interface.go @@ -19,14 +19,14 @@ package subnetclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version for network. - APIVersion = "2021-02-01" + APIVersion = "2021-08-01" // AzureStackCloudAPIVersion is the API version for Azure Stack AzureStackCloudAPIVersion = "2018-11-01" // AzureStackCloudName is the cloud name of Azure Stack diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/mocksubnetclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/mocksubnetclient/interface.go index 9866e668b523..a954980ec7d4 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/mocksubnetclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/mocksubnetclient/interface.go @@ -25,7 +25,7 @@ import ( context "context" reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" gomock "github.com/golang/mock/gomock" retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/virtualnetworklinksclient/azure_virtualnetworklinksclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/virtualnetworklinksclient/azure_virtualnetworklinksclient.go index 2c0befbc3902..cb513c18e708 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/virtualnetworklinksclient/azure_virtualnetworklinksclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/virtualnetworklinksclient/azure_virtualnetworklinksclient.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Kubernetes Authors. +Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,48 +18,209 @@ package virtualnetworklinksclient import ( "context" + "net/http" + "strings" + "time" "github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" + "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" + "sigs.k8s.io/cloud-provider-azure/pkg/metrics" + "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) var _ Interface = &Client{} +const ( + privateDNSZoneResourceType = "Microsoft.Network/privateDnsZones" + virtualNetworkLinkResourceType = "virtualNetworkLinks" +) + // Client implements virtualnetworklinksclient Interface. type Client struct { - virtualNetworkLinksClient privatedns.VirtualNetworkLinksClient + armClient armclient.Interface + cloudName string + subscriptionID string + + // Rate limiting configures. + rateLimiterReader flowcontrol.RateLimiter + rateLimiterWriter flowcontrol.RateLimiter + + // ARM throttling configures. + RetryAfterReader time.Time + RetryAfterWriter time.Time } // New creates a new virtualnetworklinks client. func New(config *azclients.ClientConfig) *Client { - virtualNetworkLinksClient := privatedns.NewVirtualNetworkLinksClient(config.SubscriptionID) - virtualNetworkLinksClient.Authorizer = config.Authorizer + apiVersion := APIVersion + if strings.EqualFold(config.CloudName, AzureStackCloudName) && !config.DisableAzureStackCloud { + klog.Warningf("Azure Stack is not supported for Virtual Network Link API") + } + armClient := armclient.New(config.Authorizer, *config, config.ResourceManagerEndpoint, apiVersion) + + rateLimiterReader, rateLimiterWriter := azclients.NewRateLimiter(config.RateLimitConfig) + if azclients.RateLimitEnabled(config.RateLimitConfig) { + klog.V(2).Infof("Azure VirtualNetworkLinksClient (read ops) using rate limit config: QPS=%g, bucket=%d", + config.RateLimitConfig.CloudProviderRateLimitQPS, + config.RateLimitConfig.CloudProviderRateLimitBucket) + klog.V(2).Infof("Azure VirtualNetworkLinksClient (write ops) using rate limit config: QPS=%g, bucket=%d", + config.RateLimitConfig.CloudProviderRateLimitQPSWrite, + config.RateLimitConfig.CloudProviderRateLimitBucketWrite) + } client := &Client{ - virtualNetworkLinksClient: virtualNetworkLinksClient, + armClient: armClient, + rateLimiterReader: rateLimiterReader, + rateLimiterWriter: rateLimiterWriter, + subscriptionID: config.SubscriptionID, + cloudName: config.CloudName, } return client } // CreateOrUpdate creates or updates a virtual network link -func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, privateZoneName string, virtualNetworkLinkName string, parameters privatedns.VirtualNetworkLink, waitForCompletion bool) error { - createOrUpdateFuture, err := c.virtualNetworkLinksClient.CreateOrUpdate(ctx, resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, "", "*") - if err != nil { - klog.V(5).Infof("Received error for %s, resourceGroup: %s, privateZoneName: %s, error: %s", "virtualnetworklinks.put.request", resourceGroupName, privateZoneName, err) - return err +func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, privateZoneName string, virtualNetworkLinkName string, parameters privatedns.VirtualNetworkLink, etag string, waitForCompletion bool) *retry.Error { + mc := metrics.NewMetricContext("virtual_network_links", "create_or_update", resourceGroupName, c.subscriptionID, "") + + // Report errors if the client is rate limited. + if !c.rateLimiterWriter.TryAccept() { + mc.RateLimitedCount() + return retry.GetRateLimitError(true, "VirtualNetworkLinkCreateOrUpdate") + } + + // Report errors if the client is throttled. + if c.RetryAfterWriter.After(time.Now()) { + mc.ThrottledCount() + rerr := retry.GetThrottlingError("VirtualNetworkLinkCreateOrUpdate", "client throttled", c.RetryAfterWriter) + return rerr } + + rerr := c.createOrUpdateVirtualNetworkLink(ctx, resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, etag, waitForCompletion) + mc.Observe(rerr) + if rerr != nil { + if rerr.IsThrottled() { + // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. + c.RetryAfterWriter = rerr.RetryAfter + } + + return rerr + } + return nil +} + +// createOrUpdateVirtualNetworkLink creates or updates a virtual network link. +func (c *Client) createOrUpdateVirtualNetworkLink(ctx context.Context, resourceGroupName, privateZoneName, virtualNetworkLinkName string, parameters privatedns.VirtualNetworkLink, etag string, waitForCompletion bool) *retry.Error { + resourceID := armclient.GetChildResourceID( + c.subscriptionID, + resourceGroupName, + privateDNSZoneResourceType, + privateZoneName, + virtualNetworkLinkResourceType, + virtualNetworkLinkName, + ) + decorators := []autorest.PrepareDecorator{} + if etag != "" { + decorators = append(decorators, autorest.WithHeader("If-Match", autorest.String(etag))) + } + + var response *http.Response + var rerr *retry.Error if waitForCompletion { - err := createOrUpdateFuture.WaitForCompletionRef(ctx, c.virtualNetworkLinksClient.Client) - if err != nil { - klog.V(5).Infof("Received error while waiting for completion for %s, resourceGroup: %s, privateZoneName: %s, error: %s", "virtualnetworklinks.put.request", resourceGroupName, privateZoneName, err) - return err + response, rerr = c.armClient.PutResource(ctx, resourceID, parameters, decorators...) + } else { + _, rerr = c.armClient.PutResourceAsync(ctx, resourceID, parameters, decorators...) + } + defer c.armClient.CloseResponse(ctx, response) + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "virtualnetworklink.put.request", resourceID, rerr.Error()) + return rerr + } + + if !waitForCompletion { + return nil + } + + if response != nil && response.StatusCode != http.StatusNoContent { + _, rerr = c.createOrUpdateResponder(response) + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "virtualnetworklink.put.request", resourceID, rerr.Error()) + return rerr } } return nil } +func (c *Client) createOrUpdateResponder(resp *http.Response) (*privatedns.VirtualNetworkLink, *retry.Error) { + result := &privatedns.VirtualNetworkLink{} + err := autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result)) + result.Response = autorest.Response{Response: resp} + return result, retry.GetError(resp, err) +} + // Get gets a virtual network link -func (c *Client) Get(ctx context.Context, resourceGroupName string, privateZoneName string, virtualNetworkLinkName string) (result privatedns.VirtualNetworkLink, err error) { - return c.virtualNetworkLinksClient.Get(ctx, resourceGroupName, privateZoneName, virtualNetworkLinkName) +func (c *Client) Get(ctx context.Context, resourceGroupName string, privateZoneName string, virtualNetworkLinkName string) (result privatedns.VirtualNetworkLink, err *retry.Error) { + mc := metrics.NewMetricContext("virtual_network_links", "get", resourceGroupName, c.subscriptionID, "") + + // Report errors if the client is rate limited. + if !c.rateLimiterReader.TryAccept() { + mc.RateLimitedCount() + return privatedns.VirtualNetworkLink{}, retry.GetRateLimitError(false, "VirtualNetworkLinkGet") + } + + // Report errors if the client is throttled. + if c.RetryAfterReader.After(time.Now()) { + mc.ThrottledCount() + rerr := retry.GetThrottlingError("VirtualNetworkLinkGet", "client throttled", c.RetryAfterReader) + return privatedns.VirtualNetworkLink{}, rerr + } + result, rerr := c.getVirtualNetworkLink(ctx, resourceGroupName, privateZoneName, virtualNetworkLinkName) + + mc.Observe(rerr) + if rerr != nil { + if rerr.IsThrottled() { + // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. + c.RetryAfterReader = rerr.RetryAfter + } + return result, rerr + } + return result, nil +} + +// getVirtualNetworkLink gets a virtual network link. +func (c *Client) getVirtualNetworkLink(ctx context.Context, resourceGroupName string, privateZoneName string, virtualNetworkLinkName string) (privatedns.VirtualNetworkLink, *retry.Error) { + resourceID := armclient.GetChildResourceID( + c.subscriptionID, + resourceGroupName, + privateDNSZoneResourceType, + privateZoneName, + virtualNetworkLinkResourceType, + virtualNetworkLinkName, + ) + result := privatedns.VirtualNetworkLink{} + response, rerr := c.armClient.GetResourceWithExpandQuery(ctx, resourceID, "") + defer c.armClient.CloseResponse(ctx, response) + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "virtualnetworklink.get.request", resourceID, rerr.Error()) + return result, rerr + } + + err := autorest.Respond( + response, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result)) + if err != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "virtualnetworklink.get.respond", resourceID, err) + return result, retry.GetError(response, err) + } + + result.Response = autorest.Response{Response: response} + return result, nil } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/virtualnetworklinksclient/doc.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/virtualnetworklinksclient/doc.go new file mode 100644 index 000000000000..219f7df49672 --- /dev/null +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/virtualnetworklinksclient/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package virtualnetworklinksclient implements the client for Virtual Network Link. +package virtualnetworklinksclient // import "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/virtualnetworklinksclient" diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/virtualnetworklinksclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/virtualnetworklinksclient/interface.go index a4af65819458..ff8c6c2df821 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/virtualnetworklinksclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/virtualnetworklinksclient/interface.go @@ -20,15 +20,23 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns" + "sigs.k8s.io/cloud-provider-azure/pkg/retry" +) + +const ( + // APIVersion is the API version. + // 2020-06-01 is the latest supported version + APIVersion = "2020-06-01" + // AzureStackCloudName is the cloud name of Azure Stack + AzureStackCloudName = "AZURESTACKCLOUD" ) // Interface is the client interface for Virtual Network Link. // Don't forget to run "hack/update-mock-clients.sh" command to generate the mock client. type Interface interface { - // Get gets a virtual network link - Get(ctx context.Context, resourceGroupName string, privateZoneName string, virtualNetworkLinkName string) (result privatedns.VirtualNetworkLink, err error) + Get(ctx context.Context, resourceGroupName string, privateZoneName string, virtualNetworkLinkName string) (privatedns.VirtualNetworkLink, *retry.Error) - // CreateOrUpdate creates or updates a private dns zone. - CreateOrUpdate(ctx context.Context, resourceGroupName string, privateZoneName string, virtualNetworkLinkName string, parameters privatedns.VirtualNetworkLink, waitForCompletion bool) error + // CreateOrUpdate creates or updates a virtual network link. + CreateOrUpdate(ctx context.Context, resourceGroupName string, privateZoneName string, virtualNetworkLinkName string, parameters privatedns.VirtualNetworkLink, etag string, waitForCompletion bool) *retry.Error } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmasclient/azure_vmasclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmasclient/azure_vmasclient.go index 4a9751b3f046..59372fb251eb 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmasclient/azure_vmasclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmasclient/azure_vmasclient.go @@ -18,7 +18,6 @@ package vmasclient import ( "context" - "fmt" "net/http" "strings" "time" @@ -37,7 +36,9 @@ import ( "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) -//var _ Interface = &Client{} +var _ Interface = &Client{} + +const vmasResourceType = "Microsoft.Compute/availabilitySets" // Client implements VMAS client Interface. type Client struct { @@ -121,7 +122,7 @@ func (c *Client) getVMAS(ctx context.Context, resourceGroupName string, vmasName resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/availabilitySets", + vmasResourceType, vmasName, ) result := compute.AvailabilitySet{} @@ -179,9 +180,7 @@ func (c *Client) List(ctx context.Context, resourceGroupName string) ([]compute. // listVMAS gets a list of AvailabilitySets in the resource group. func (c *Client) listVMAS(ctx context.Context, resourceGroupName string) ([]compute.AvailabilitySet, *retry.Error) { - resourceID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/availabilitySets", - autorest.Encode("path", c.subscriptionID), - autorest.Encode("path", resourceGroupName)) + resourceID := armclient.GetResourceListID(c.subscriptionID, resourceGroupName, vmasResourceType) result := make([]compute.AvailabilitySet, 0) page := &AvailabilitySetListResultPage{} page.fn = c.listNextResults diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/azure_vmclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/azure_vmclient.go index f46fff6518e5..f5d1a253bcaa 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/azure_vmclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/azure_vmclient.go @@ -18,7 +18,6 @@ package vmclient import ( "context" - "fmt" "net/http" "strings" "time" @@ -39,6 +38,8 @@ import ( var _ Interface = &Client{} +const vmResourceType = "Microsoft.Compute/virtualMachines" + // Client implements VirtualMachine client Interface. type Client struct { armClient armclient.Interface @@ -121,7 +122,7 @@ func (c *Client) getVM(ctx context.Context, resourceGroupName string, VMName str resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/virtualMachines", + vmResourceType, VMName, ) result := compute.VirtualMachine{} @@ -179,10 +180,7 @@ func (c *Client) List(ctx context.Context, resourceGroupName string) ([]compute. // listVM gets a list of VirtualMachines in the resourceGroupName. func (c *Client) listVM(ctx context.Context, resourceGroupName string) ([]compute.VirtualMachine, *retry.Error) { - resourceID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachines", - autorest.Encode("path", c.subscriptionID), - autorest.Encode("path", resourceGroupName), - ) + resourceID := armclient.GetResourceListID(c.subscriptionID, resourceGroupName, vmResourceType) result := make([]compute.VirtualMachine, 0) page := &VirtualMachineListResultPage{} @@ -270,7 +268,7 @@ func (c *Client) UpdateAsync(ctx context.Context, resourceGroupName string, VMNa resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/virtualMachines", + vmResourceType, VMName, ) @@ -310,7 +308,7 @@ func (c *Client) updateVM(ctx context.Context, resourceGroupName string, VMName resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/virtualMachines", + vmResourceType, VMName, ) @@ -471,7 +469,7 @@ func (c *Client) createOrUpdateVM(ctx context.Context, resourceGroupName string, resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/virtualMachines", + vmResourceType, VMName, ) @@ -540,9 +538,9 @@ func (c *Client) deleteVM(ctx context.Context, resourceGroupName string, VMName resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/virtualMachines", + vmResourceType, VMName, ) - return c.armClient.DeleteResource(ctx, resourceID, "") + return c.armClient.DeleteResource(ctx, resourceID) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/azure_vmssclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/azure_vmssclient.go index b54f48ce53d2..4a3a5c946ba4 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/azure_vmssclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/azure_vmssclient.go @@ -18,7 +18,6 @@ package vmssclient import ( "context" - "fmt" "net/http" "strings" "time" @@ -39,6 +38,8 @@ import ( var _ Interface = &Client{} +const vmssResourceType = "Microsoft.Compute/virtualMachineScaleSets" + // Client implements VMSS client Interface. type Client struct { armClient armclient.Interface @@ -121,7 +122,7 @@ func (c *Client) getVMSS(ctx context.Context, resourceGroupName string, VMScaleS resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/virtualMachineScaleSets", + vmssResourceType, VMScaleSetName, ) result := compute.VirtualMachineScaleSet{} @@ -179,9 +180,11 @@ func (c *Client) List(ctx context.Context, resourceGroupName string) ([]compute. // listVMSS gets a list of VirtualMachineScaleSets in the resource group. func (c *Client) listVMSS(ctx context.Context, resourceGroupName string) ([]compute.VirtualMachineScaleSet, *retry.Error) { - resourceID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachineScaleSets", - autorest.Encode("path", c.subscriptionID), - autorest.Encode("path", resourceGroupName)) + resourceID := armclient.GetResourceListID( + c.subscriptionID, + resourceGroupName, + vmssResourceType, + ) result := make([]compute.VirtualMachineScaleSet, 0) page := &VirtualMachineScaleSetListResultPage{} page.fn = c.listNextResults @@ -268,7 +271,7 @@ func (c *Client) CreateOrUpdateAsync(ctx context.Context, resourceGroupName stri resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/virtualMachineScaleSets", + vmssResourceType, VMScaleSetName, ) @@ -319,7 +322,7 @@ func (c *Client) createOrUpdateVMSS(ctx context.Context, resourceGroupName strin resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/virtualMachineScaleSets", + vmssResourceType, VMScaleSetName, ) response, rerr := c.armClient.PutResource(ctx, resourceID, parameters) @@ -491,7 +494,7 @@ func (c *Client) DeleteInstancesAsync(ctx context.Context, resourceGroupName str resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/virtualMachineScaleSets", + vmssResourceType, vmScaleSetName, ) @@ -546,7 +549,7 @@ func (c *Client) DeallocateInstancesAsync(ctx context.Context, resourceGroupName resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/virtualMachineScaleSets", + vmssResourceType, vmScaleSetName, ) @@ -595,7 +598,7 @@ func (c *Client) StartInstancesAsync(ctx context.Context, resourceGroupName stri resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/virtualMachineScaleSets", + vmssResourceType, vmScaleSetName, ) @@ -629,7 +632,7 @@ func (c *Client) deleteVMSSInstances(ctx context.Context, resourceGroupName stri resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/virtualMachineScaleSets", + vmssResourceType, vmScaleSetName, ) response, rerr := c.armClient.PostResource(ctx, resourceID, "delete", vmInstanceIDs, map[string]interface{}{}) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/azure_vmssvmclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/azure_vmssvmclient.go index a65615eb3c05..04f47ac68a52 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/azure_vmssvmclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/azure_vmssvmclient.go @@ -18,7 +18,6 @@ package vmssvmclient import ( "context" - "fmt" "net/http" "strings" "time" @@ -40,6 +39,11 @@ import ( var _ Interface = &Client{} +const ( + vmssResourceType = "Microsoft.Compute/virtualMachineScaleSets" + vmResourceType = "virtualMachines" +) + // Client implements VMSS client Interface. type Client struct { armClient armclient.Interface @@ -122,9 +126,9 @@ func (c *Client) getVMSSVM(ctx context.Context, resourceGroupName string, VMScal resourceID := armclient.GetChildResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/virtualMachineScaleSets", + vmssResourceType, VMScaleSetName, - "virtualMachines", + vmResourceType, instanceID, ) result := compute.VirtualMachineScaleSetVM{} @@ -182,10 +186,12 @@ func (c *Client) List(ctx context.Context, resourceGroupName string, virtualMach // listVMSSVM gets a list of VirtualMachineScaleSetVMs in the virtualMachineScaleSet. func (c *Client) listVMSSVM(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, expand string) ([]compute.VirtualMachineScaleSetVM, *retry.Error) { - resourceID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachineScaleSets/%s/virtualMachines", - autorest.Encode("path", c.subscriptionID), - autorest.Encode("path", resourceGroupName), - autorest.Encode("path", virtualMachineScaleSetName), + resourceID := armclient.GetChildResourcesListID( + c.subscriptionID, + resourceGroupName, + vmssResourceType, + virtualMachineScaleSetName, + vmResourceType, ) result := make([]compute.VirtualMachineScaleSetVM, 0) @@ -274,9 +280,9 @@ func (c *Client) UpdateAsync(ctx context.Context, resourceGroupName string, VMSc resourceID := armclient.GetChildResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/virtualMachineScaleSets", + vmssResourceType, VMScaleSetName, - "virtualMachines", + vmResourceType, instanceID, ) @@ -315,9 +321,9 @@ func (c *Client) updateVMSSVM(ctx context.Context, resourceGroupName string, VMS resourceID := armclient.GetChildResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/virtualMachineScaleSets", + vmssResourceType, VMScaleSetName, - "virtualMachines", + vmResourceType, instanceID, ) @@ -479,9 +485,9 @@ func (c *Client) updateVMSSVMs(ctx context.Context, resourceGroupName string, VM resourceID := armclient.GetChildResourceID( c.subscriptionID, resourceGroupName, - "Microsoft.Compute/virtualMachineScaleSets", + vmssResourceType, VMScaleSetName, - "virtualMachines", + vmResourceType, instanceID, ) resources[resourceID] = parameter diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/zoneclient/azure_zoneclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/zoneclient/azure_zoneclient.go index ac197a641980..9a226d0b0cea 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/zoneclient/azure_zoneclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/zoneclient/azure_zoneclient.go @@ -18,7 +18,6 @@ package zoneclient import ( "context" - "fmt" "net/http" "strings" @@ -34,6 +33,8 @@ import ( var _ Interface = &Client{} +const computeResourceProvider = "Microsoft.Compute" + type resourceTypeMetadata struct { ResourceType string `json:"resourceType"` ZoneMappings []zoneMappings `json:"zoneMappings"` @@ -112,7 +113,10 @@ func (c *Client) getZones(ctx context.Context, subscriptionID string) (map[strin } regionZoneMap := make(map[string][]string) - expectedID := fmt.Sprintf("/subscriptions/%s/providers/Microsoft.Compute", subscriptionID) + expectedID := armclient.GetProviderResourceID( + subscriptionID, + computeResourceProvider, + ) if len(result.ProviderListDataProperties) != 0 { for _, property := range result.ProviderListDataProperties { if strings.EqualFold(property.ID, expectedID) { diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/consts.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/consts.go index cd83134ae363..4f07c40acf17 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/consts.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/consts.go @@ -236,6 +236,9 @@ const ( // ServiceAnnotationPIPName specifies the pip that will be applied to load balancer ServiceAnnotationPIPName = "service.beta.kubernetes.io/azure-pip-name" + // ServiceAnnotationPIPPrefixID specifies the pip prefix that will be applied to the load balancer. + ServiceAnnotationPIPPrefixID = "service.beta.kubernetes.io/azure-pip-prefix-id" + // ServiceAnnotationIPTagsForPublicIP specifies the iptags used when dynamically creating a public ip ServiceAnnotationIPTagsForPublicIP = "service.beta.kubernetes.io/azure-pip-ip-tags" @@ -402,9 +405,55 @@ const ( // HealthProbeParamsRequestPath determines the request path of the load balancer health probe. // This is only useful for the HTTP and HTTPS, and would be ignored when using TCP. If not set, - // `/` would be configured by default. + // `/healthz` would be configured by default. HealthProbeParamsRequestPath HealthProbeParams = "request-path" HealthProbeDefaultRequestPath string = "/" ) type HealthProbeParams string + +// private link service +const ( + // ServiceAnnotationPLSCreation determines whether a PLS needs to be created. + ServiceAnnotationPLSCreation = "service.beta.kubernetes.io/azure-pls-create" + + // ServiceAnnotationPLSName determines name of the PLS resource to create. + ServiceAnnotationPLSName = "service.beta.kubernetes.io/azure-pls-name" + + // ServiceAnnotationPLSIpConfigurationSubnet determines the subnet name to deploy the PLS resource. + ServiceAnnotationPLSIpConfigurationSubnet = "service.beta.kubernetes.io/azure-pls-ip-configuration-subnet" + + // ServiceAnnotationPLSIpConfigurationIPAddressCount determines number of IPs to be associated with the PLS. + ServiceAnnotationPLSIpConfigurationIPAddressCount = "service.beta.kubernetes.io/azure-pls-ip-configuration-ip-address-count" + + // ServiceAnnotationPLSIPConfigurationIPAddress determines a space separated list of static IPs for the PLS. + // Total number of IPs should not be greater than the IP count specified in ServiceAnnotationPLSIpConfigurationIPAddressCount. + // If there are fewer IPs specified, the rest are dynamically allocated. The first IP in the list is set as Primary. + ServiceAnnotationPLSIpConfigurationIPAddress = "service.beta.kubernetes.io/azure-pls-ip-configuration-ip-address" + + // ServiceAnnotationPLSFqdns determines a space separated list of fqdns associated with the PLS. + ServiceAnnotationPLSFqdns = "service.beta.kubernetes.io/azure-pls-fqdns" + + // ServiceAnnotationPLSProxyProtocol determines whether TCP Proxy protocol needs to be enabled on the PLS. + ServiceAnnotationPLSProxyProtocol = "service.beta.kubernetes.io/azure-pls-proxy-protocol" + + // ServiceAnnotationPLSVisibility determines a space separated list of Azure subscription IDs for which the PLS is visible. + // Use "*" to expose the PLS to all subscriptions. + ServiceAnnotationPLSVisibility = "service.beta.kubernetes.io/azure-pls-visibility" + + // ServiceAnnotationPLSAutoApproval determines a space separated list of Azure subscription IDs from which requests can be + // automatically approved, only works when visibility is set to "*". + ServiceAnnotationPLSAutoApproval = "service.beta.kubernetes.io/azure-pls-auto-approval" + + // ID string used to create a not existing PLS placehold in plsCache to avoid redundant + PrivateLinkServiceNotExistID = "PrivateLinkServiceNotExistID" + + // Key of tag indicating owner service of the PLS. + OwnerServiceTagKey = "k8s-azure-owner-service" + + // Key of tag indicating cluster name of the service that owns PLS. + ClusterNameTagKey = "k8s-azure-cluster-name" + + // Default number of IP configs for PLS + PLSDefaultNumOfIPConfig = 1 +) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/helpers.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/helpers.go index f86236218f37..44296f3d945c 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/helpers.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/helpers.go @@ -23,6 +23,7 @@ import ( "strings" v1 "k8s.io/api/core/v1" + "k8s.io/utils/net" ) // IsK8sServiceHasHAModeEnabled return if HA Mode is enabled in kuberntes service annotations @@ -35,6 +36,10 @@ func IsK8sServiceUsingInternalLoadBalancer(service *v1.Service) bool { return expectAttributeInSvcAnnotationBeEqualTo(service.Annotations, ServiceAnnotationLoadBalancerInternal, TrueAnnotationValue) } +func IsK8sServiceInternalIPv6(service *v1.Service) bool { + return IsK8sServiceUsingInternalLoadBalancer(service) && net.IsIPv6String(service.Spec.ClusterIP) +} + // GetHealthProbeConfigOfPortFromK8sSvcAnnotation get health probe configuration for port func GetHealthProbeConfigOfPortFromK8sSvcAnnotation(annotations map[string]string, port int32, key HealthProbeParams, validators ...BusinessValidator) (*string, error) { return GetAttributeValueInSvcAnnotation(annotations, BuildHealthProbeAnnotationKeyForPort(port, key), validators...) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure.go index b7397fb0a5aa..6d6643b19a00 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure.go @@ -54,6 +54,7 @@ import ( "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednsclient" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient" + "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient" @@ -226,6 +227,8 @@ type Config struct { NsgCacheTTLInSeconds int `json:"nsgCacheTTLInSeconds,omitempty" yaml:"nsgCacheTTLInSeconds,omitempty"` // RouteTableCacheTTLInSeconds sets the cache TTL for route table RouteTableCacheTTLInSeconds int `json:"routeTableCacheTTLInSeconds,omitempty" yaml:"routeTableCacheTTLInSeconds,omitempty"` + // PlsCacheTTLInSeconds sets the cache TTL for private link service resource + PlsCacheTTLInSeconds int `json:"plsCacheTTLInSeconds,omitempty" yaml:"plsCacheTTLInSeconds,omitempty"` // AvailabilitySetsCacheTTLInSeconds sets the cache TTL for VMAS AvailabilitySetsCacheTTLInSeconds int `json:"availabilitySetsCacheTTLInSeconds,omitempty" yaml:"availabilitySetsCacheTTLInSeconds,omitempty"` // PublicIPCacheTTLInSeconds sets the cache TTL for public ip @@ -244,6 +247,8 @@ type Config struct { // PutVMSSVMBatchSize defines how many requests the client send concurrently when putting the VMSS VMs. // If it is smaller than or equal to zero, the request will be sent one by one in sequence (default). PutVMSSVMBatchSize int `json:"putVMSSVMBatchSize" yaml:"putVMSSVMBatchSize"` + // PrivateLinkServiceResourceGroup determines the specific resource group of the private link services user want to use + PrivateLinkServiceResourceGroup string `json:"privateLinkServiceResourceGroup,omitempty" yaml:"privateLinkServiceResourceGroup,omitempty"` } type InitSecretConfig struct { @@ -293,6 +298,7 @@ type Cloud struct { privatednsclient privatednsclient.Interface privatednszonegroupclient privatednszonegroupclient.Interface virtualNetworkLinksClient virtualnetworklinksclient.Interface + PrivateLinkServiceClient privatelinkserviceclient.Interface ResourceRequestBackoff wait.Backoff Metadata *InstanceMetadataService @@ -339,6 +345,8 @@ type Cloud struct { nsgCache *azcache.TimedCache rtCache *azcache.TimedCache pipCache *azcache.TimedCache + // use LB frontEndIpConfiguration ID as the key and search for PLS attached to the frontEnd + plsCache *azcache.TimedCache *ManagedDiskController *controllerCommon @@ -487,6 +495,10 @@ func (az *Cloud) InitializeCloudFromConfig(config *Config, fromSecret, callFromC config.SecurityGroupResourceGroup = config.ResourceGroup } + if config.PrivateLinkServiceResourceGroup == "" { + config.PrivateLinkServiceResourceGroup = config.ResourceGroup + } + if config.VMType == "" { // default to standard vmType if not set. config.VMType = consts.VMTypeStandard @@ -675,6 +687,11 @@ func (az *Cloud) initCaches() (err error) { return err } + az.plsCache, err = az.newPLSCache() + if err != nil { + return err + } + return nil } @@ -833,6 +850,7 @@ func (az *Cloud) configAzureClients( az.privatednsclient = privatednsclient.New(azClientConfig) az.privatednszonegroupclient = privatednszonegroupclient.New(azClientConfig) az.virtualNetworkLinksClient = virtualnetworklinksclient.New(azClientConfig) + az.PrivateLinkServiceClient = privatelinkserviceclient.New(azClientConfig) if az.ZoneClient == nil { az.ZoneClient = zoneclient.New(zoneClientConfig) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_backoff.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_backoff.go index b91c72aeb7f1..0c47e54642a8 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_backoff.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_backoff.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-07-01/compute" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/go-autorest/autorest/to" v1 "k8s.io/api/core/v1" @@ -588,3 +588,86 @@ func (az *Cloud) CreateOrUpdateVMSS(resourceGroupName string, VMScaleSetName str return nil } + +func (az *Cloud) CreateOrUpdatePLS(service *v1.Service, pls network.PrivateLinkService) error { + ctx, cancel := getContextWithCancel() + defer cancel() + + rerr := az.PrivateLinkServiceClient.CreateOrUpdate(ctx, az.PrivateLinkServiceResourceGroup, to.String(pls.Name), pls, to.String(pls.Etag)) + if rerr == nil { + // Invalidate the cache right after updating + _ = az.plsCache.Delete(to.String((*pls.LoadBalancerFrontendIPConfigurations)[0].ID)) + return nil + } + + rtJSON, _ := json.Marshal(pls) + klog.Warningf("PrivateLinkServiceClient.CreateOrUpdate(%s) failed: %v, PrivateLinkService request: %s", to.String(pls.Name), rerr.Error(), string(rtJSON)) + + // Invalidate the cache because etag mismatch. + if rerr.HTTPStatusCode == http.StatusPreconditionFailed { + klog.V(3).Infof("Private link service cache for %s is cleanup because of http.StatusPreconditionFailed", to.String(pls.Name)) + _ = az.plsCache.Delete(to.String((*pls.LoadBalancerFrontendIPConfigurations)[0].ID)) + } + // Invalidate the cache because another new operation has canceled the current request. + if strings.Contains(strings.ToLower(rerr.Error().Error()), consts.OperationCanceledErrorMessage) { + klog.V(3).Infof("Private link service for %s is cleanup because CreateOrUpdatePrivateLinkService is canceled by another operation", to.String(pls.Name)) + _ = az.plsCache.Delete(to.String((*pls.LoadBalancerFrontendIPConfigurations)[0].ID)) + } + klog.Errorf("PrivateLinkServiceClient.CreateOrUpdate(%s) failed: %v", to.String(pls.Name), rerr.Error()) + return rerr.Error() +} + +// DeletePLS invokes az.PrivateLinkServiceClient.Delete with exponential backoff retry +func (az *Cloud) DeletePLS(service *v1.Service, plsName string, plsLBFrontendID string) *retry.Error { + ctx, cancel := getContextWithCancel() + defer cancel() + + rerr := az.PrivateLinkServiceClient.Delete(ctx, az.PrivateLinkServiceResourceGroup, plsName) + if rerr == nil { + // Invalidate the cache right after deleting + _ = az.plsCache.Delete(plsLBFrontendID) + return nil + } + + klog.Errorf("PrivateLinkServiceClient.DeletePLS(%s) failed: %s", plsName, rerr.Error().Error()) + az.Event(service, v1.EventTypeWarning, "DeletePrivateLinkService", rerr.Error().Error()) + return rerr +} + +// DeletePEConn invokes az.PrivateLinkServiceClient.DeletePEConnection with exponential backoff retry +func (az *Cloud) DeletePEConn(service *v1.Service, plsName string, peConnName string) *retry.Error { + ctx, cancel := getContextWithCancel() + defer cancel() + + rerr := az.PrivateLinkServiceClient.DeletePEConnection(ctx, az.PrivateLinkServiceResourceGroup, plsName, peConnName) + if rerr == nil { + return nil + } + + klog.Errorf("PrivateLinkServiceClient.DeletePEConnection(%s-%s) failed: %s", plsName, peConnName, rerr.Error().Error()) + az.Event(service, v1.EventTypeWarning, "DeletePrivateEndpointConnection", rerr.Error().Error()) + return rerr +} + +// CreateOrUpdateSubnet invokes az.SubnetClient.CreateOrUpdate with exponential backoff retry +func (az *Cloud) CreateOrUpdateSubnet(service *v1.Service, subnet network.Subnet) error { + ctx, cancel := getContextWithCancel() + defer cancel() + + var rg string + if len(az.VnetResourceGroup) > 0 { + rg = az.VnetResourceGroup + } else { + rg = az.ResourceGroup + } + + rerr := az.SubnetsClient.CreateOrUpdate(ctx, rg, az.VnetName, *subnet.Name, subnet) + klog.V(10).Infof("SubnetClient.CreateOrUpdate(%s): end", *subnet.Name) + if rerr != nil { + klog.Errorf("SubnetClient.CreateOrUpdate(%s) failed: %s", *subnet.Name, rerr.Error().Error()) + az.Event(service, v1.EventTypeWarning, "CreateOrUpdateSubnet", rerr.Error().Error()) + return rerr.Error() + } + + return nil +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_common.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_common.go index 1d1c3a516666..34baafc9ec47 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_common.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_common.go @@ -159,9 +159,9 @@ func (c *controllerCommon) AttachDisk(ctx context.Context, async bool, diskName, return -1, err } if strings.EqualFold(string(nodeName), string(attachedNode)) { - klog.Warningf("volume %q is actually attached to current node %q, invalidate vm cache and return error", diskURI, nodeName) + klog.Warningf("volume %s is actually attached to current node %s, invalidate vm cache and return error", diskURI, nodeName) // update VM(invalidate vm cache) - if errUpdate := c.UpdateVM(nodeName); errUpdate != nil { + if errUpdate := c.UpdateVM(ctx, nodeName); errUpdate != nil { return -1, errUpdate } lun, _, err := c.GetDiskLun(diskName, diskURI, nodeName) @@ -232,7 +232,7 @@ func (c *controllerCommon) AttachDisk(ctx context.Context, async bool, diskName, return -1, err } - klog.V(2).Infof("Trying to attach volume %q lun %d to node %q, diskMap: %s", diskURI, lun, nodeName, diskMap) + klog.V(2).Infof("Trying to attach volume %s lun %d to node %s, diskMap: %s", diskURI, lun, nodeName, diskMap) if len(diskMap) == 0 { return lun, nil } @@ -243,7 +243,7 @@ func (c *controllerCommon) AttachDisk(ctx context.Context, async bool, diskName, } c.diskStateMap.Store(disk, "attaching") defer c.diskStateMap.Delete(disk) - future, err := vmset.AttachDisk(nodeName, diskMap) + future, err := vmset.AttachDisk(ctx, nodeName, diskMap) if err != nil { return -1, err } @@ -253,9 +253,11 @@ func (c *controllerCommon) AttachDisk(ctx context.Context, async bool, diskName, unlock = true c.lockMap.UnlockEntry(node) } else { - klog.Warningf("azureDisk - switch to batch operation due to rate limited(async: %t), QPS: %f", async, c.diskOpRateLimiter.QPS()) + if async { + klog.Warningf("azureDisk - switch to batch operation due to rate limited, QPS: %f", c.diskOpRateLimiter.QPS()) + } } - resourceGroup, err := getResourceGroupFromDiskURI(diskURI) + resourceGroup, _, err := getInfoFromDiskURI(diskURI) if err != nil { return -1, err } @@ -307,10 +309,10 @@ func (c *controllerCommon) cleanAttachDiskRequests(nodeName string) (map[string] // DetachDisk detaches a disk from VM func (c *controllerCommon) DetachDisk(ctx context.Context, diskName, diskURI string, nodeName types.NodeName) error { - if _, err := c.cloud.InstanceID(context.TODO(), nodeName); err != nil { + if _, err := c.cloud.InstanceID(ctx, nodeName); err != nil { if errors.Is(err, cloudprovider.InstanceNotFound) { // if host doesn't exist, no need to detach - klog.Warningf("azureDisk - failed to get azure instance id(%q), DetachDisk(%s) will assume disk is already detached", + klog.Warningf("azureDisk - failed to get azure instance id(%s), DetachDisk(%s) will assume disk is already detached", nodeName, diskURI) return nil } @@ -336,11 +338,11 @@ func (c *controllerCommon) DetachDisk(ctx context.Context, diskName, diskURI str return err } - klog.V(2).Infof("Trying to detach volume %q from node %q, diskMap: %s", diskURI, nodeName, diskMap) + klog.V(2).Infof("Trying to detach volume %s from node %s, diskMap: %s", diskURI, nodeName, diskMap) if len(diskMap) > 0 { c.diskStateMap.Store(disk, "detaching") defer c.diskStateMap.Delete(disk) - if err = vmset.DetachDisk(nodeName, diskMap); err != nil { + if err = vmset.DetachDisk(ctx, nodeName, diskMap); err != nil { if isInstanceNotFoundError(err) { // if host doesn't exist, no need to detach klog.Warningf("azureDisk - got InstanceNotFoundError(%v), DetachDisk(%s) will assume disk is already detached", @@ -365,7 +367,7 @@ func (c *controllerCommon) DetachDisk(ctx context.Context, diskName, diskURI str } // UpdateVM updates a vm -func (c *controllerCommon) UpdateVM(nodeName types.NodeName) error { +func (c *controllerCommon) UpdateVM(ctx context.Context, nodeName types.NodeName) error { vmset, err := c.getNodeVMSet(nodeName, azcache.CacheReadTypeUnsafe) if err != nil { return err @@ -373,7 +375,7 @@ func (c *controllerCommon) UpdateVM(nodeName types.NodeName) error { node := strings.ToLower(string(nodeName)) c.lockMap.LockEntry(node) defer c.lockMap.UnlockEntry(node) - return vmset.UpdateVM(nodeName) + return vmset.UpdateVM(ctx, nodeName) } func (c *controllerCommon) insertDetachDiskRequest(diskName, diskURI, nodeName string) error { @@ -436,7 +438,7 @@ func (c *controllerCommon) GetDiskLun(diskName, diskURI string, nodeName types.N // to ensure we get LUN based on latest entry. disks, provisioningState, err := c.getNodeDataDisks(nodeName, azcache.CacheReadTypeDefault) if err != nil { - klog.Errorf("error of getting data disks for node %q: %v", nodeName, err) + klog.Errorf("error of getting data disks for node %s: %v", nodeName, err) return -1, provisioningState, err } @@ -445,10 +447,10 @@ func (c *controllerCommon) GetDiskLun(diskName, diskURI string, nodeName types.N (disk.Vhd != nil && disk.Vhd.URI != nil && diskURI != "" && strings.EqualFold(*disk.Vhd.URI, diskURI)) || (disk.ManagedDisk != nil && strings.EqualFold(*disk.ManagedDisk.ID, diskURI)) { if disk.ToBeDetached != nil && *disk.ToBeDetached { - klog.Warningf("azureDisk - find disk(ToBeDetached): lun %d name %q uri %q", *disk.Lun, diskName, diskURI) + klog.Warningf("azureDisk - find disk(ToBeDetached): lun %d name %s uri %s", *disk.Lun, diskName, diskURI) } else { // found the disk - klog.V(2).Infof("azureDisk - find disk: lun %d name %q uri %q", *disk.Lun, diskName, diskURI) + klog.V(2).Infof("azureDisk - find disk: lun %d name %s uri %s", *disk.Lun, diskName, diskURI) return *disk.Lun, provisioningState, nil } } @@ -461,7 +463,7 @@ func (c *controllerCommon) GetDiskLun(diskName, diskURI string, nodeName types.N func (c *controllerCommon) SetDiskLun(nodeName types.NodeName, diskURI string, diskMap map[string]*AttachDiskOptions) (int32, error) { disks, _, err := c.getNodeDataDisks(nodeName, azcache.CacheReadTypeDefault) if err != nil { - klog.Errorf("error of getting data disks for node %q: %v", nodeName, err) + klog.Errorf("error of getting data disks for node %s: %v", nodeName, err) return -1, err } @@ -537,7 +539,7 @@ func (c *controllerCommon) DisksAreAttached(diskNames []string, nodeName types.N if err != nil { if errors.Is(err, cloudprovider.InstanceNotFound) { // if host doesn't exist, no need to detach - klog.Warningf("azureDisk - Cannot find node %q, DisksAreAttached will assume disks %v are not attached to it.", + klog.Warningf("azureDisk - Cannot find node %s, DisksAreAttached will assume disks %v are not attached to it.", nodeName, diskNames) return attached, nil } @@ -597,12 +599,12 @@ func (c *controllerCommon) filterNonExistingDisks(ctx context.Context, unfiltere func (c *controllerCommon) checkDiskExists(ctx context.Context, diskURI string) (bool, error) { diskName := path.Base(diskURI) - resourceGroup, err := getResourceGroupFromDiskURI(diskURI) + resourceGroup, subsID, err := getInfoFromDiskURI(diskURI) if err != nil { return false, err } - if _, rerr := c.cloud.DisksClient.Get(ctx, resourceGroup, diskName); rerr != nil { + if _, rerr := c.cloud.DisksClient.Get(ctx, subsID, resourceGroup, diskName); rerr != nil { if rerr.HTTPStatusCode == http.StatusNotFound { return false, nil } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_standard.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_standard.go index facc04390611..7e4b3537dfde 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_standard.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_standard.go @@ -33,7 +33,7 @@ import ( ) // AttachDisk attaches a disk to vm -func (as *availabilitySet) AttachDisk(nodeName types.NodeName, diskMap map[string]*AttachDiskOptions) (*azure.Future, error) { +func (as *availabilitySet) AttachDisk(ctx context.Context, nodeName types.NodeName, diskMap map[string]*AttachDiskOptions) (*azure.Future, error) { vm, err := as.getVirtualMachine(nodeName, azcache.CacheReadTypeDefault) if err != nil { return nil, err @@ -95,9 +95,6 @@ func (as *availabilitySet) AttachDisk(nodeName types.NodeName, diskMap map[strin }, } klog.V(2).Infof("azureDisk - update(%s): vm(%s) - attach disk list(%s)", nodeResourceGroup, vmName, diskMap) - ctx, cancel := getContextWithCancel() - defer cancel() - // Invalidate the cache right after updating defer func() { _ = as.cloud.vmCache.Delete(vmName) @@ -130,7 +127,7 @@ func (as *availabilitySet) WaitForUpdateResult(ctx context.Context, future *azur } // DetachDisk detaches a disk from VM -func (as *availabilitySet) DetachDisk(nodeName types.NodeName, diskMap map[string]string) error { +func (as *availabilitySet) DetachDisk(ctx context.Context, nodeName types.NodeName, diskMap map[string]string) error { vm, err := as.getVirtualMachine(nodeName, azcache.CacheReadTypeDefault) if err != nil { // if host doesn't exist, no need to detach @@ -154,7 +151,7 @@ func (as *availabilitySet) DetachDisk(nodeName types.NodeName, diskMap map[strin (disk.Vhd != nil && disk.Vhd.URI != nil && diskURI != "" && strings.EqualFold(*disk.Vhd.URI, diskURI)) || (disk.ManagedDisk != nil && diskURI != "" && strings.EqualFold(*disk.ManagedDisk.ID, diskURI)) { // found the disk - klog.V(2).Infof("azureDisk - detach disk: name %q uri %q", diskName, diskURI) + klog.V(2).Infof("azureDisk - detach disk: name %s uri %s", diskName, diskURI) disks[i].ToBeDetached = to.BoolPtr(true) bFoundDisk = true } @@ -185,9 +182,6 @@ func (as *availabilitySet) DetachDisk(nodeName types.NodeName, diskMap map[strin }, } klog.V(2).Infof("azureDisk - update(%s): vm(%s) - detach disk list(%s)", nodeResourceGroup, vmName, nodeName, diskMap) - ctx, cancel := getContextWithCancel() - defer cancel() - // Invalidate the cache right after updating defer func() { _ = as.cloud.vmCache.Delete(vmName) @@ -212,16 +206,13 @@ func (as *availabilitySet) DetachDisk(nodeName types.NodeName, diskMap map[strin } // UpdateVM updates a vm -func (as *availabilitySet) UpdateVM(nodeName types.NodeName) error { +func (as *availabilitySet) UpdateVM(ctx context.Context, nodeName types.NodeName) error { vmName := mapNodeNameToVMName(nodeName) nodeResourceGroup, err := as.GetNodeResourceGroup(vmName) if err != nil { return err } klog.V(2).Infof("azureDisk - update(%s): vm(%s)", nodeResourceGroup, vmName) - ctx, cancel := getContextWithCancel() - defer cancel() - // Invalidate the cache right after updating defer func() { _ = as.cloud.vmCache.Delete(vmName) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmss.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmss.go index d547ef51cb84..a8f01c1e1fe1 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmss.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmss.go @@ -33,9 +33,9 @@ import ( ) // AttachDisk attaches a disk to vm -func (ss *ScaleSet) AttachDisk(nodeName types.NodeName, diskMap map[string]*AttachDiskOptions) (*azure.Future, error) { +func (ss *ScaleSet) AttachDisk(ctx context.Context, nodeName types.NodeName, diskMap map[string]*AttachDiskOptions) (*azure.Future, error) { vmName := mapNodeNameToVMName(nodeName) - ssName, instanceID, vm, err := ss.getVmssVM(vmName, azcache.CacheReadTypeDefault) + vm, err := ss.getVmssVM(vmName, azcache.CacheReadTypeDefault) if err != nil { return nil, err } @@ -45,17 +45,20 @@ func (ss *ScaleSet) AttachDisk(nodeName types.NodeName, diskMap map[string]*Atta return nil, err } - disks := []compute.DataDisk{} - if vm.StorageProfile != nil && vm.StorageProfile.DataDisks != nil { - disks = make([]compute.DataDisk, len(*vm.StorageProfile.DataDisks)) - copy(disks, *vm.StorageProfile.DataDisks) + var disks []compute.DataDisk + + storageProfile := vm.AsVirtualMachineScaleSetVM().StorageProfile + + if storageProfile != nil && storageProfile.DataDisks != nil { + disks = make([]compute.DataDisk, len(*storageProfile.DataDisks)) + copy(disks, *storageProfile.DataDisks) } for k, v := range diskMap { diskURI := k opt := v attached := false - for _, disk := range *vm.StorageProfile.DataDisks { + for _, disk := range *storageProfile.DataDisks { if disk.ManagedDisk != nil && strings.EqualFold(*disk.ManagedDisk.ID, diskURI) { attached = true break @@ -68,12 +71,12 @@ func (ss *ScaleSet) AttachDisk(nodeName types.NodeName, diskMap map[string]*Atta managedDisk := &compute.ManagedDiskParameters{ID: &diskURI} if opt.diskEncryptionSetID == "" { - if vm.StorageProfile.OsDisk != nil && - vm.StorageProfile.OsDisk.ManagedDisk != nil && - vm.StorageProfile.OsDisk.ManagedDisk.DiskEncryptionSet != nil && - vm.StorageProfile.OsDisk.ManagedDisk.DiskEncryptionSet.ID != nil { + if storageProfile.OsDisk != nil && + storageProfile.OsDisk.ManagedDisk != nil && + storageProfile.OsDisk.ManagedDisk.DiskEncryptionSet != nil && + storageProfile.OsDisk.ManagedDisk.DiskEncryptionSet.ID != nil { // set diskEncryptionSet as value of os disk by default - opt.diskEncryptionSetID = *vm.StorageProfile.OsDisk.ManagedDisk.DiskEncryptionSet.ID + opt.diskEncryptionSetID = *storageProfile.OsDisk.ManagedDisk.DiskEncryptionSet.ID } } if opt.diskEncryptionSetID != "" { @@ -98,23 +101,20 @@ func (ss *ScaleSet) AttachDisk(nodeName types.NodeName, diskMap map[string]*Atta }, } - ctx, cancel := getContextWithCancel() - defer cancel() - // Invalidate the cache right after updating defer func() { _ = ss.deleteCacheForNode(vmName) }() klog.V(2).Infof("azureDisk - update(%s): vm(%s) - attach disk list(%s)", nodeResourceGroup, nodeName, diskMap) - future, rerr := ss.VirtualMachineScaleSetVMsClient.UpdateAsync(ctx, nodeResourceGroup, ssName, instanceID, newVM, "attach_disk") + future, rerr := ss.VirtualMachineScaleSetVMsClient.UpdateAsync(ctx, nodeResourceGroup, vm.VMSSName, vm.InstanceID, newVM, "attach_disk") if rerr != nil { klog.Errorf("azureDisk - attach disk list(%s) on rg(%s) vm(%s) failed, err: %v", diskMap, nodeResourceGroup, nodeName, rerr) if rerr.HTTPStatusCode == http.StatusNotFound { klog.Errorf("azureDisk - begin to filterNonExistingDisks(%v) on rg(%s) vm(%s)", diskMap, nodeResourceGroup, nodeName) disks := ss.filterNonExistingDisks(ctx, *newVM.VirtualMachineScaleSetVMProperties.StorageProfile.DataDisks) newVM.VirtualMachineScaleSetVMProperties.StorageProfile.DataDisks = &disks - future, rerr = ss.VirtualMachineScaleSetVMsClient.UpdateAsync(ctx, nodeResourceGroup, ssName, instanceID, newVM, "attach_disk") + future, rerr = ss.VirtualMachineScaleSetVMsClient.UpdateAsync(ctx, nodeResourceGroup, vm.VMSSName, vm.InstanceID, newVM, "attach_disk") } } @@ -134,9 +134,9 @@ func (ss *ScaleSet) WaitForUpdateResult(ctx context.Context, future *azure.Futur } // DetachDisk detaches a disk from VM -func (ss *ScaleSet) DetachDisk(nodeName types.NodeName, diskMap map[string]string) error { +func (ss *ScaleSet) DetachDisk(ctx context.Context, nodeName types.NodeName, diskMap map[string]string) error { vmName := mapNodeNameToVMName(nodeName) - ssName, instanceID, vm, err := ss.getVmssVM(vmName, azcache.CacheReadTypeDefault) + vm, err := ss.getVmssVM(vmName, azcache.CacheReadTypeDefault) if err != nil { return err } @@ -146,10 +146,11 @@ func (ss *ScaleSet) DetachDisk(nodeName types.NodeName, diskMap map[string]strin return err } - disks := []compute.DataDisk{} - if vm.StorageProfile != nil && vm.StorageProfile.DataDisks != nil { - disks = make([]compute.DataDisk, len(*vm.StorageProfile.DataDisks)) - copy(disks, *vm.StorageProfile.DataDisks) + var disks []compute.DataDisk + storageProfile := vm.VirtualMachineScaleSetVMProperties.StorageProfile + if storageProfile != nil && storageProfile.DataDisks != nil { + disks = make([]compute.DataDisk, len(*storageProfile.DataDisks)) + copy(disks, *storageProfile.DataDisks) } bFoundDisk := false for i, disk := range disks { @@ -158,7 +159,7 @@ func (ss *ScaleSet) DetachDisk(nodeName types.NodeName, diskMap map[string]strin (disk.Vhd != nil && disk.Vhd.URI != nil && diskURI != "" && strings.EqualFold(*disk.Vhd.URI, diskURI)) || (disk.ManagedDisk != nil && diskURI != "" && strings.EqualFold(*disk.ManagedDisk.ID, diskURI)) { // found the disk - klog.V(2).Infof("azureDisk - detach disk: name %q uri %q", diskName, diskURI) + klog.V(2).Infof("azureDisk - detach disk: name %s uri %s", diskName, diskURI) disks[i].ToBeDetached = to.BoolPtr(true) bFoundDisk = true } @@ -171,7 +172,7 @@ func (ss *ScaleSet) DetachDisk(nodeName types.NodeName, diskMap map[string]strin } else { if strings.EqualFold(ss.cloud.Environment.Name, consts.AzureStackCloudName) && !ss.Config.DisableAzureStackCloud { // Azure stack does not support ToBeDetached flag, use original way to detach disk - newDisks := []compute.DataDisk{} + var newDisks []compute.DataDisk for _, disk := range disks { if !to.Bool(disk.ToBeDetached) { newDisks = append(newDisks, disk) @@ -188,24 +189,21 @@ func (ss *ScaleSet) DetachDisk(nodeName types.NodeName, diskMap map[string]strin }, }, } - - ctx, cancel := getContextWithCancel() - defer cancel() - // Invalidate the cache right after updating defer func() { _ = ss.deleteCacheForNode(vmName) }() klog.V(2).Infof("azureDisk - update(%s): vm(%s) - detach disk list(%s)", nodeResourceGroup, nodeName, diskMap) - rerr := ss.VirtualMachineScaleSetVMsClient.Update(ctx, nodeResourceGroup, ssName, instanceID, newVM, "detach_disk") + rerr := ss.VirtualMachineScaleSetVMsClient.Update(ctx, nodeResourceGroup, vm.VMSSName, vm.InstanceID, newVM, + "detach_disk") if rerr != nil { klog.Errorf("azureDisk - detach disk list(%s) on rg(%s) vm(%s) failed, err: %v", diskMap, nodeResourceGroup, nodeName, rerr) if rerr.HTTPStatusCode == http.StatusNotFound { klog.Errorf("azureDisk - begin to filterNonExistingDisks(%v) on rg(%s) vm(%s)", diskMap, nodeResourceGroup, nodeName) disks := ss.filterNonExistingDisks(ctx, *newVM.VirtualMachineScaleSetVMProperties.StorageProfile.DataDisks) newVM.VirtualMachineScaleSetVMProperties.StorageProfile.DataDisks = &disks - rerr = ss.VirtualMachineScaleSetVMsClient.Update(ctx, nodeResourceGroup, ssName, instanceID, newVM, "detach_disk") + rerr = ss.VirtualMachineScaleSetVMsClient.Update(ctx, nodeResourceGroup, vm.VMSSName, vm.InstanceID, newVM, "detach_disk") } } @@ -217,9 +215,9 @@ func (ss *ScaleSet) DetachDisk(nodeName types.NodeName, diskMap map[string]strin } // UpdateVM updates a vm -func (ss *ScaleSet) UpdateVM(nodeName types.NodeName) error { +func (ss *ScaleSet) UpdateVM(ctx context.Context, nodeName types.NodeName) error { vmName := mapNodeNameToVMName(nodeName) - ssName, instanceID, _, err := ss.getVmssVM(vmName, azcache.CacheReadTypeDefault) + vm, err := ss.getVmssVM(vmName, azcache.CacheReadTypeDefault) if err != nil { return err } @@ -229,16 +227,13 @@ func (ss *ScaleSet) UpdateVM(nodeName types.NodeName) error { return err } - ctx, cancel := getContextWithCancel() - defer cancel() - // Invalidate the cache right after updating defer func() { _ = ss.deleteCacheForNode(vmName) }() klog.V(2).Infof("azureDisk - update(%s): vm(%s)", nodeResourceGroup, nodeName) - rerr := ss.VirtualMachineScaleSetVMsClient.Update(ctx, nodeResourceGroup, ssName, instanceID, compute.VirtualMachineScaleSetVM{}, "update_vmss_instance") + rerr := ss.VirtualMachineScaleSetVMsClient.Update(ctx, nodeResourceGroup, vm.VMSSName, vm.InstanceID, compute.VirtualMachineScaleSetVM{}, "update_vmss_instance") klog.V(2).Infof("azureDisk - update(%s): vm(%s) - returned with %v", nodeResourceGroup, nodeName, rerr) if rerr != nil { @@ -249,14 +244,16 @@ func (ss *ScaleSet) UpdateVM(nodeName types.NodeName) error { // GetDataDisks gets a list of data disks attached to the node. func (ss *ScaleSet) GetDataDisks(nodeName types.NodeName, crt azcache.AzureCacheReadType) ([]compute.DataDisk, *string, error) { - _, _, vm, err := ss.getVmssVM(string(nodeName), crt) + vm, err := ss.getVmssVM(string(nodeName), crt) if err != nil { return nil, nil, err } - if vm.StorageProfile == nil || vm.StorageProfile.DataDisks == nil { + storageProfile := vm.AsVirtualMachineScaleSetVM().StorageProfile + + if storageProfile == nil || storageProfile.DataDisks == nil { return nil, nil, nil } - return *vm.StorageProfile.DataDisks, vm.ProvisioningState, nil + return *storageProfile.DataDisks, vm.AsVirtualMachineScaleSetVM().ProvisioningState, nil } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_fakes.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_fakes.go index d6e1d56963f7..1ef726c56def 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_fakes.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_fakes.go @@ -28,6 +28,7 @@ import ( "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/mockdiskclient" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/mockinterfaceclient" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/mockloadbalancerclient" + "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/mockprivatelinkserviceclient" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/mockpublicipclient" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/mockrouteclient" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/mockroutetableclient" @@ -71,6 +72,7 @@ func GetTestCloud(ctrl *gomock.Controller) (az *Cloud) { VnetResourceGroup: "rg", RouteTableResourceGroup: "rg", SecurityGroupResourceGroup: "rg", + PrivateLinkServiceResourceGroup: "rg", Location: "westus", VnetName: "vnet", SubnetName: "subnet", @@ -103,12 +105,14 @@ func GetTestCloud(ctrl *gomock.Controller) (az *Cloud) { az.VirtualMachineScaleSetsClient = mockvmssclient.NewMockInterface(ctrl) az.VirtualMachineScaleSetVMsClient = mockvmssvmclient.NewMockInterface(ctrl) az.VirtualMachinesClient = mockvmclient.NewMockInterface(ctrl) + az.PrivateLinkServiceClient = mockprivatelinkserviceclient.NewMockInterface(ctrl) az.VMSet, _ = newAvailabilitySet(az) az.vmCache, _ = az.newVMCache() az.lbCache, _ = az.newLBCache() az.nsgCache, _ = az.newNSGCache() az.rtCache, _ = az.newRouteTableCache() az.pipCache, _ = az.newPIPCache() + az.plsCache, _ = az.newPLSCache() az.LoadBalancerBackendPool = NewMockBackendPool(ctrl) _ = initDiskControllers(az) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer.go index 351fa3eccfe0..512e5734664d 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer.go @@ -26,7 +26,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/go-autorest/autorest/to" v1 "k8s.io/api/core/v1" @@ -36,6 +36,7 @@ import ( servicehelpers "k8s.io/cloud-provider/service/helpers" "k8s.io/klog/v2" utilnet "k8s.io/utils/net" + "k8s.io/utils/strings/slices" azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/consts" @@ -47,7 +48,7 @@ import ( // if so, what its status is. func (az *Cloud) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (status *v1.LoadBalancerStatus, exists bool, err error) { // Since public IP is not a part of the load balancer on Azure, - // there is a chance that we could orphan public IP resources while we delete the load blanacer (kubernetes/kubernetes#80571). + // there is a chance that we could orphan public IP resources while we delete the load balancer (kubernetes/kubernetes#80571). // We need to make sure the existence of the load balancer depends on the load balancer resource and public IP resource on Azure. existsPip := func() bool { pipName, _, err := az.determinePublicIPName(clusterName, service, nil) @@ -94,7 +95,7 @@ func (az *Cloud) reconcileService(ctx context.Context, clusterName string, servi return nil, err } - lbStatus, _, err := az.getServiceLoadBalancerStatus(service, lb, nil) + lbStatus, fipConfig, err := az.getServiceLoadBalancerStatus(service, lb, nil) if err != nil { klog.Errorf("getServiceLoadBalancerStatus(%s) failed: %v", serviceName, err) return nil, err @@ -110,6 +111,13 @@ func (az *Cloud) reconcileService(ctx context.Context, clusterName string, servi return nil, err } + if fipConfig != nil { + if err := az.reconcilePrivateLinkService(clusterName, service, fipConfig, true /* wantPLS */); err != nil { + klog.Errorf("reconcilePrivateLinkService(%s) failed: %#v", serviceName, err) + return nil, err + } + } + updateService := updateServiceLoadBalancerIP(service, to.String(serviceIP)) flippedService := flipServiceInternalAnnotation(updateService) if _, err := az.reconcileLoadBalancer(clusterName, flippedService, nil, false /* wantLb */); err != nil { @@ -321,6 +329,13 @@ func (az *Cloud) removeFrontendIPConfigurationFromLoadBalancer(lb *network.LoadB lb.Probes = &lbProbes } + // clean up any private link service associated with the frontEndIPConfig + err := az.reconcilePrivateLinkService(clusterName, service, fip, false /* wantPLS */) + if err != nil { + klog.Errorf("removeFrontendIPConfigurationFromLoadBalancer(%s, %s, %s, %s): failed to clean up PLS: %v", to.String(lb.Name), to.String(fip.Name), clusterName, service.Name, err) + return err + } + if len(fipConfigs) == 0 { klog.V(2).Infof("removeFrontendIPConfigurationFromLoadBalancer(%s, %s, %s, %s): deleting load balancer because there is no remaining frontend IP configurations", to.String(lb.Name), to.String(fip.Name), clusterName, service.Name) err := az.cleanOrphanedLoadBalancer(lb, existingLBs, service, clusterName) @@ -425,7 +440,7 @@ func (az *Cloud) safeDeleteLoadBalancer(lb network.LoadBalancer, clusterName, vm } } - klog.V(2).Infof("safeDeleteLoadBalancer: deleting LB %s because the corresponding vmSet is supposed to be in the primary SLB", to.String(lb.Name)) + klog.V(2).Infof("safeDeleteLoadBalancer: deleting LB %s", to.String(lb.Name)) rerr := az.DeleteLB(service, to.String(lb.Name)) if rerr != nil { return rerr @@ -435,28 +450,6 @@ func (az *Cloud) safeDeleteLoadBalancer(lb network.LoadBalancer, clusterName, vm return nil } -func extractBackendIPConfigurationIDsFromLB(lb network.LoadBalancer, lbBackendPoolName string) []string { - result := make([]string, 0) - if lb.LoadBalancerPropertiesFormat != nil && - lb.BackendAddressPools != nil { - for i := 0; i < len(*lb.BackendAddressPools); i++ { - backendPool := (*lb.BackendAddressPools)[i] - if strings.EqualFold(to.String(backendPool.Name), lbBackendPoolName) { - if backendPool.BackendAddressPoolPropertiesFormat != nil && - backendPool.BackendIPConfigurations != nil { - for _, ipConfiguration := range *backendPool.BackendIPConfigurations { - if ipConfiguration.ID != nil { - result = append(result, to.String(ipConfiguration.ID)) - } - } - } - } - } - } - - return result -} - // reconcileSharedLoadBalancer deletes the dedicated SLBs of the non-primary vmSets. There are // two scenarios where this operation is needed: // 1. Using multiple slbs and the vmSet is supposed to share the primary slb. @@ -465,9 +458,8 @@ func extractBackendIPConfigurationIDsFromLB(lb network.LoadBalancer, lbBackendPo // It runs only once everytime the cloud controller manager restarts. func (az *Cloud) reconcileSharedLoadBalancer(service *v1.Service, clusterName string, nodes []*v1.Node) ([]network.LoadBalancer, error) { var ( - primarySLBs, existingLBs []network.LoadBalancer - changed bool - err error + existingLBs []network.LoadBalancer + err error ) existingLBs, err = az.ListManagedLBs(service, nodes, clusterName) @@ -498,16 +490,13 @@ func (az *Cloud) reconcileSharedLoadBalancer(service *v1.Service, clusterName st return existingLBs, nil } - lbBackendPoolName := getBackendPoolName(clusterName, service) lbNamesToBeDeleted := sets.NewString() - // 1: delete unwanted LBs + // delete unwanted LBs for _, lb := range existingLBs { klog.V(4).Infof("reconcileSharedLoadBalancer: checking LB %s", to.String(lb.Name)) - lbNamePrefix := strings.TrimSuffix(to.String(lb.Name), consts.InternalLoadBalancerNameSuffix) - // skip the internal or external primary load balancer + lbNamePrefix := strings.TrimSuffix(to.String(lb.Name), consts.InternalLoadBalancerNameSuffix) if strings.EqualFold(lbNamePrefix, clusterName) { - primarySLBs = append(primarySLBs, lb) continue } @@ -515,6 +504,7 @@ func (az *Cloud) reconcileSharedLoadBalancer(service *v1.Service, clusterName st // the vmSet is supposed to have dedicated SLBs vmSetName := strings.ToLower(az.mapLoadBalancerNameToVMSet(to.String(lb.Name), clusterName)) if az.EnableMultipleStandardLoadBalancers && !az.getVMSetNamesSharingPrimarySLB().Has(vmSetName) { + klog.V(4).Infof("reconcileSharedLoadBalancer: skip deleting the LB %s because the vmSet %s needs a dedicated SLB", to.String(lb.Name), vmSetName) continue } @@ -522,6 +512,7 @@ func (az *Cloud) reconcileSharedLoadBalancer(service *v1.Service, clusterName st // If the VMSet name is in az.NodePoolsWithoutDedicatedSLB, we should // decouple the VMSet from the lb and delete the lb. Then adding the VMSet // to the backend pool of the primary slb. + klog.V(2).Infof("reconcileSharedLoadBalancer: deleting LB %s because the corresponding vmSet is supposed to be in the primary SLB", to.String(lb.Name)) rerr := az.safeDeleteLoadBalancer(lb, clusterName, vmSetName, service) if rerr != nil { return nil, rerr.Error() @@ -530,93 +521,17 @@ func (az *Cloud) reconcileSharedLoadBalancer(service *v1.Service, clusterName st // remove the deleted lb from the list and construct a new primary // lb, so that getServiceLoadBalancer doesn't have to call list api again lbNamesToBeDeleted.Insert(strings.ToLower(to.String(lb.Name))) - changed = true } - if !changed { - klog.V(4).Infof("reconcileSharedLoadBalancer: no changes made, return now") - return existingLBs, nil - } - - vmSetsToBeMovedToPrimarySLB := sets.NewString() - ipConfigIDsToBeAddedToPrimarySLB := sets.NewString() - // 2: add nodes to the backend pool of the primary SLBs for i := len(existingLBs) - 1; i >= 0; i-- { lb := existingLBs[i] if !lbNamesToBeDeleted.Has(strings.ToLower(to.String(lb.Name))) { continue } - - vmSetName := strings.ToLower(az.mapLoadBalancerNameToVMSet(to.String(lb.Name), clusterName)) - vmSetsToBeMovedToPrimarySLB.Insert(vmSetName) - isInternalLB := strings.HasSuffix(to.String(lb.Name), consts.InternalLoadBalancerNameSuffix) - primarySLBName := clusterName - if isInternalLB { - primarySLBName = fmt.Sprintf("%s%s", clusterName, consts.InternalLoadBalancerNameSuffix) - } - primaryLBBackendPoolID := az.getBackendPoolID(primarySLBName, az.getLoadBalancerResourceGroup(), getBackendPoolName(clusterName, service)) - - klog.V(2).Infof("reconcileSharedLoadBalancer: binding the vmSet %s to the backend pool %s", vmSetName, primaryLBBackendPoolID) - if strings.EqualFold(az.LoadBalancerBackendPoolConfigurationType, consts.LoadBalancerBackendPoolConfigurationTypeNodeIPConfiguration) { - err = az.VMSet.EnsureHostsInPool(service, nodes, primaryLBBackendPoolID, vmSetName) - if err != nil { - return nil, fmt.Errorf("reconcileSharedLoadBalancer: failed to EnsureHostsInPool: %w", err) - } - - for _, id := range extractBackendIPConfigurationIDsFromLB(lb, lbBackendPoolName) { - ipConfigIDsToBeAddedToPrimarySLB.Insert(id) - } - } - // remove the deleted LB from the list existingLBs = append(existingLBs[:i], existingLBs[i+1:]...) } - for _, primarySLB := range primarySLBs { - if primarySLB.LoadBalancerPropertiesFormat != nil && - primarySLB.BackendAddressPools != nil { - for i := 0; i < len(*primarySLB.BackendAddressPools); i++ { - if strings.EqualFold(to.String((*primarySLB.BackendAddressPools)[i].Name), lbBackendPoolName) { - if az.isLBBackendPoolTypeNodeIPConfig() { - backendPoolIPConfigs := (*primarySLB.BackendAddressPools)[i].BackendIPConfigurations - for _, id := range ipConfigIDsToBeAddedToPrimarySLB.List() { - *backendPoolIPConfigs = append(*backendPoolIPConfigs, network.InterfaceIPConfiguration{ - ID: to.StringPtr(id), - }) - } - } else if az.isLBBackendPoolTypeNodeIP() { - backendPool := (*primarySLB.BackendAddressPools)[i] - if backendPool.LoadBalancerBackendAddresses == nil { - lbBackendPoolAddresses := make([]network.LoadBalancerBackendAddress, 0) - backendPool.LoadBalancerBackendAddresses = &lbBackendPoolAddresses - } - - if err := az.LoadBalancerBackendPool.EnsureHostsInPool(service, nodes, "", "", clusterName, to.String(primarySLB.Name), backendPool); err != nil { - return nil, fmt.Errorf("reconcileSharedLoadBalancer: failed to EnsureHostsInPool: %w", err) - } - - (*primarySLB.BackendAddressPools)[i] = backendPool - } - - break - } - } - } - } - - for i, existingLB := range existingLBs { - for _, primarySLB := range primarySLBs { - if strings.EqualFold(to.String(existingLB.Name), to.String(primarySLB.Name)) { - // Proactively disable the etag to prevent etag mismatch error when putting lb later. - // This could happen because when we remove the hosts from the lb, the nrp - // would put the lb to remove the backend references as well. - primarySLB.Etag = nil - - existingLBs[i] = primarySLB - } - } - } - return existingLBs, nil } @@ -881,9 +796,12 @@ func (az *Cloud) getServiceLoadBalancerStatus(service *v1.Service, lb *network.L func (az *Cloud) determinePublicIPName(clusterName string, service *v1.Service, pips *[]network.PublicIPAddress) (string, bool, error) { var shouldPIPExisted bool + if name, found := service.Annotations[consts.ServiceAnnotationPIPName]; found && name != "" { - shouldPIPExisted = true - return name, shouldPIPExisted, nil + return name, true, nil + } + if ipPrefix, ok := service.Annotations[consts.ServiceAnnotationPIPPrefixID]; ok && ipPrefix != "" { + return az.getPublicIPName(clusterName, service), false, nil } pipResourceGroup := az.getPublicIPAddressResourceGroup(service) @@ -1064,6 +982,9 @@ func (az *Cloud) ensurePublicIPExists(service *v1.Service, pipName string, domai pip.Sku = &network.PublicIPAddressSku{ Name: network.PublicIPAddressSkuNameStandard, } + if pipPrefixName, ok := service.Annotations[consts.ServiceAnnotationPIPPrefixID]; ok && pipPrefixName != "" { + pip.PublicIPPrefix = &network.SubResource{ID: to.StringPtr(pipPrefixName)} + } // skip adding zone info since edge zones doesn't support multiple availability zones. if !az.HasExtendedLocation() { @@ -1349,7 +1270,7 @@ func (az *Cloud) isFrontendIPChanged(clusterName string, config network.Frontend if !existsSubnet { return false, fmt.Errorf("failed to get subnet") } - if config.Subnet != nil && !strings.EqualFold(to.String(config.Subnet.Name), to.String(subnet.Name)) { + if config.Subnet != nil && !strings.EqualFold(to.String(config.Subnet.ID), to.String(subnet.ID)) { return true, nil } } @@ -1544,7 +1465,7 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service, } // reconcile the load balancer's frontend IP configurations. - ownedFIPConfig, changed, err := az.reconcileFrontendIPConfigs(clusterName, service, lb, lbStatus, wantLb, defaultLBFrontendIPConfigName) + ownedFIPConfig, toDeleteConfigs, changed, err := az.reconcileFrontendIPConfigs(clusterName, service, lb, lbStatus, wantLb, defaultLBFrontendIPConfigName) if err != nil { return lb, err } @@ -1593,6 +1514,22 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service, // We only care about if there is any change in the LB, which means dirtyLB // If it is not exist, and no change to that, we don't CreateOrUpdate LB if dirtyLb { + if len(toDeleteConfigs) > 0 { + for i := range toDeleteConfigs { + fipConfigToDel := toDeleteConfigs[i] + err := az.reconcilePrivateLinkService(clusterName, service, &fipConfigToDel, false /* wantPLS */) + if err != nil { + klog.Errorf( + "reconcileLoadBalancer for service(%s): lb(%s) - failed to clean up PrivateLinkService for frontEnd(%s): %v", + serviceName, + lbName, + to.String(fipConfigToDel.Name), + err, + ) + } + } + } + if lb.FrontendIPConfigurations == nil || len(*lb.FrontendIPConfigurations) == 0 { err := az.cleanOrphanedLoadBalancer(lb, existingLBs, service, clusterName) if err != nil { @@ -1734,13 +1671,14 @@ func (az *Cloud) reconcileLBRules(lb *network.LoadBalancer, service *v1.Service, return dirtyRules } -func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Service, lb *network.LoadBalancer, status *v1.LoadBalancerStatus, wantLb bool, defaultLBFrontendIPConfigName string) (*network.FrontendIPConfiguration, bool, error) { +func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Service, lb *network.LoadBalancer, status *v1.LoadBalancerStatus, wantLb bool, defaultLBFrontendIPConfigName string) (*network.FrontendIPConfiguration, []network.FrontendIPConfiguration, bool, error) { var err error lbName := *lb.Name serviceName := getServiceName(service) isInternal := requiresInternalLoadBalancer(service) dirtyConfigs := false var newConfigs []network.FrontendIPConfiguration + var toDeleteConfigs []network.FrontendIPConfiguration if lb.FrontendIPConfigurations != nil { newConfigs = *lb.FrontendIPConfigurations } @@ -1753,12 +1691,12 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv config := newConfigs[i] isServiceOwnsFrontendIP, _, err := az.serviceOwnsFrontendIP(config, service, pips) if err != nil { - return nil, false, err + return nil, toDeleteConfigs, false, err } if isServiceOwnsFrontendIP { unsafe, err := az.isFrontendIPConfigUnsafeToDelete(lb, service, config.ID) if err != nil { - return nil, false, err + return nil, toDeleteConfigs, false, err } // If the frontend IP configuration is not being referenced by: @@ -1776,6 +1714,7 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv klog.V(2).Infof("reconcileLoadBalancer for service (%s)(%t): nil name of lb frontendconfig", serviceName, wantLb) } + toDeleteConfigs = append(toDeleteConfigs, newConfigs[i]) newConfigs = append(newConfigs[:i], newConfigs[i+1:]...) dirtyConfigs = true } @@ -1796,10 +1735,11 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv klog.V(4).Infof("reconcileFrontendIPConfigs for service (%s): checking owned frontend IP cofiguration %s", serviceName, to.String(config.Name)) isFipChanged, err = az.isFrontendIPChanged(clusterName, config, service, defaultLBFrontendIPConfigName, pips) if err != nil { - return nil, false, err + return nil, toDeleteConfigs, false, err } if isFipChanged { klog.V(2).Infof("reconcileLoadBalancer for service (%s)(%t): lb frontendconfig(%s) - dropping", serviceName, wantLb, *config.Name) + toDeleteConfigs = append(toDeleteConfigs, newConfigs[i]) newConfigs = append(newConfigs[:i], newConfigs[i+1:]...) dirtyConfigs = true previousZone = config.Zones @@ -1809,7 +1749,7 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv ownedFIPConfig, _, err = az.findFrontendIPConfigOfService(&newConfigs, service, pips) if err != nil { - return nil, false, err + return nil, toDeleteConfigs, false, err } if ownedFIPConfig == nil { @@ -1824,11 +1764,11 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv } subnet, existsSubnet, err := az.getSubnet(az.VnetName, *subnetName) if err != nil { - return nil, false, err + return nil, toDeleteConfigs, false, err } if !existsSubnet { - return nil, false, fmt.Errorf("ensure(%s): lb(%s) - failed to get subnet: %s/%s", serviceName, lbName, az.VnetName, az.SubnetName) + return nil, toDeleteConfigs, false, fmt.Errorf("ensure(%s): lb(%s) - failed to get subnet: %s/%s", serviceName, lbName, az.VnetName, az.SubnetName) } configProperties := network.FrontendIPConfigurationPropertiesFormat{ @@ -1857,12 +1797,12 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv } else { pipName, shouldPIPExisted, err := az.determinePublicIPName(clusterName, service, pips) if err != nil { - return nil, false, err + return nil, toDeleteConfigs, false, err } domainNameLabel, found := getPublicIPDomainNameLabel(service) pip, err := az.ensurePublicIPExists(service, pipName, domainNameLabel, clusterName, shouldPIPExisted, found) if err != nil { - return nil, false, err + return nil, toDeleteConfigs, false, err } fipConfigurationProperties = &network.FrontendIPConfigurationPropertiesFormat{ PublicIPAddress: &network.PublicIPAddress{ID: pip.ID}, @@ -1878,7 +1818,7 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv if isInternal { if err := az.getFrontendZones(&newConfig, previousZone, isFipChanged, serviceName, defaultLBFrontendIPConfigName); err != nil { klog.Errorf("reconcileLoadBalancer for service (%s)(%t): failed to getFrontendZones: %s", serviceName, wantLb, err.Error()) - return nil, false, err + return nil, toDeleteConfigs, false, err } } newConfigs = append(newConfigs, newConfig) @@ -1891,7 +1831,7 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv lb.FrontendIPConfigurations = &newConfigs } - return ownedFIPConfig, dirtyConfigs, err + return ownedFIPConfig, toDeleteConfigs, dirtyConfigs, err } func (az *Cloud) getFrontendZones( @@ -2022,7 +1962,7 @@ func lbRuleConflictsWithPort(rule network.LoadBalancingRule, frontendIPConfigID *rule.FrontendPort == port.Port } -// buildHealthProbeRulesForPort builds the LoadBalancer probe rules for the given port. +// buildHealthProbeRulesForPort // for following sku: basic loadbalancer vs standard load balancer // for following protocols: TCP HTTP HTTPS(SLB only) func (az *Cloud) buildHealthProbeRulesForPort(annotations map[string]string, port v1.ServicePort, lbrule string) (*network.Probe, error) { @@ -2031,22 +1971,8 @@ func (az *Cloud) buildHealthProbeRulesForPort(annotations map[string]string, por } // protocol should be tcp, because sctp is handled in outer loop - // get request path for http/https probe - requestPath, err := consts.GetHealthProbeConfigOfPortFromK8sSvcAnnotation(annotations, port.Port, consts.HealthProbeParamsRequestPath) - if err != nil { - return nil, fmt.Errorf("failed to parse annotation %s: %w", consts.BuildHealthProbeAnnotationKeyForPort(port.Port, consts.HealthProbeParamsRequestPath), err) - } - if requestPath == nil { - if requestPath, err = consts.GetAttributeValueInSvcAnnotation(annotations, consts.ServiceAnnotationLoadBalancerHealthProbeRequestPath); err != nil { - return nil, fmt.Errorf("failed to parse annotation %s: %w", consts.ServiceAnnotationLoadBalancerHealthProbeRequestPath, err) - } - } - if requestPath == nil { - // TCP would be used as default probe protocol for backward compatibility when probe requestPath is not set. - port.AppProtocol = to.StringPtr(string(network.ProtocolTCP)) - } - properties := &network.ProbePropertiesFormat{} + var err error if port.AppProtocol == nil { if port.AppProtocol, err = consts.GetAttributeValueInSvcAnnotation(annotations, consts.ServiceAnnotationLoadBalancerHealthProbeProtocol); err != nil { return nil, fmt.Errorf("failed to parse annotation %s: %w", consts.ServiceAnnotationLoadBalancerHealthProbeProtocol, err) @@ -2060,8 +1986,8 @@ func (az *Cloud) buildHealthProbeRulesForPort(annotations map[string]string, por case strings.EqualFold(protocol, string(network.ProtocolTCP)): properties.Protocol = network.ProbeProtocolTCP case strings.EqualFold(protocol, string(network.ProtocolHTTPS)): - // HTTPS probe is only supported in standard loadbalancer - // For backward compatibility, fall back to TCP protocol for basic LoadBalancer. + //HTTPS probe is only supported in standard loadbalancer + //For backward compatibility,when unsupported protocol is used, fall back to tcp protocol in basic lb mode instead if !az.useStandardLoadBalancer() { properties.Protocol = network.ProbeProtocolTCP } else { @@ -2070,16 +1996,25 @@ func (az *Cloud) buildHealthProbeRulesForPort(annotations map[string]string, por case strings.EqualFold(protocol, string(network.ProtocolHTTP)): properties.Protocol = network.ProbeProtocolHTTP default: - // For backward compatibility, fall back to TCP protocol when unsupported protocol is used. + //For backward compatibility,when unsupported protocol is used, fall back to tcp protocol in basic lb mode instead properties.Protocol = network.ProbeProtocolTCP } if strings.EqualFold(string(properties.Protocol), string(network.ProtocolHTTPS)) || strings.EqualFold(string(properties.Protocol), string(network.ProtocolHTTP)) { - if requestPath == nil { - // "/" is the default request path for HTTP/HTTPS probe - requestPath = to.StringPtr(consts.HealthProbeDefaultRequestPath) + // get request path ,only used with http/https probe + path, err := consts.GetHealthProbeConfigOfPortFromK8sSvcAnnotation(annotations, port.Port, consts.HealthProbeParamsRequestPath) + if err != nil { + return nil, fmt.Errorf("failed to parse annotation %s: %w", consts.BuildHealthProbeAnnotationKeyForPort(port.Port, consts.HealthProbeParamsRequestPath), err) + } + if path == nil { + if path, err = consts.GetAttributeValueInSvcAnnotation(annotations, consts.ServiceAnnotationLoadBalancerHealthProbeRequestPath); err != nil { + return nil, fmt.Errorf("failed to parse annotation %s: %w", consts.ServiceAnnotationLoadBalancerHealthProbeRequestPath, err) + } } - properties.RequestPath = requestPath + if path == nil { + path = to.StringPtr(consts.HealthProbeDefaultRequestPath) + } + properties.RequestPath = path } // get number of probes var numOfProbeValidator = func(val *int32) error { @@ -2237,7 +2172,7 @@ func (az *Cloud) getExpectedLBRules( if err != nil { return expectedProbes, expectedRules, fmt.Errorf("failed to parse transport protocol: %w", err) } - props, err := az.getExpectedLoadBalancingRulePropertiesForPort(service, lbFrontendIPConfigID, lbBackendPoolID, to.Int32Ptr(port.Port), *transportProto) + props, err := az.getExpectedLoadBalancingRulePropertiesForPort(service, lbFrontendIPConfigID, lbBackendPoolID, port, *transportProto) if err != nil { return expectedProbes, expectedRules, fmt.Errorf("error generate lb rule for ha mod loadbalancer. err: %w", err) } @@ -2275,7 +2210,7 @@ func (az *Cloud) getExpectedLBRules( func (az *Cloud) getExpectedLoadBalancingRulePropertiesForPort( service *v1.Service, lbFrontendIPConfigID string, - lbBackendPoolID string, port *int32, transportProto network.TransportProtocol) (*network.LoadBalancingRulePropertiesFormat, error) { + lbBackendPoolID string, servicePort v1.ServicePort, transportProto network.TransportProtocol) (*network.LoadBalancingRulePropertiesFormat, error) { var err error loadDistribution := network.LoadDistributionDefault @@ -2301,8 +2236,8 @@ func (az *Cloud) getExpectedLoadBalancingRulePropertiesForPort( props := &network.LoadBalancingRulePropertiesFormat{ Protocol: transportProto, - FrontendPort: port, - BackendPort: port, + FrontendPort: to.Int32Ptr(servicePort.Port), + BackendPort: to.Int32Ptr(servicePort.Port), DisableOutboundSnat: to.BoolPtr(az.disableLoadBalancerOutboundSNAT()), EnableFloatingIP: to.BoolPtr(true), LoadDistribution: loadDistribution, @@ -2317,6 +2252,13 @@ func (az *Cloud) getExpectedLoadBalancingRulePropertiesForPort( if strings.EqualFold(string(transportProto), string(network.TransportProtocolTCP)) && az.useStandardLoadBalancer() { props.EnableTCPReset = to.BoolPtr(true) } + + // Azure ILB does not support secondary IPs as floating IPs on the LB. Therefore, floating IP needs to be turned + // off and the rule should point to the nodeIP:nodePort. + if consts.IsK8sServiceInternalIPv6(service) { + props.BackendPort = to.Int32Ptr(servicePort.NodePort) + props.EnableFloatingIP = to.BoolPtr(false) + } return props, nil } @@ -2325,7 +2267,7 @@ func (az *Cloud) getExpectedHAModeLoadBalancingRuleProperties( service *v1.Service, lbFrontendIPConfigID string, lbBackendPoolID string) (*network.LoadBalancingRulePropertiesFormat, error) { - props, err := az.getExpectedLoadBalancingRulePropertiesForPort(service, lbFrontendIPConfigID, lbBackendPoolID, to.Int32Ptr(0), network.TransportProtocolAll) + props, err := az.getExpectedLoadBalancingRulePropertiesForPort(service, lbFrontendIPConfigID, lbBackendPoolID, v1.ServicePort{}, network.TransportProtocolAll) if err != nil { return nil, fmt.Errorf("error generate lb rule for ha mod loadbalancer. err: %w", err) } @@ -2875,7 +2817,8 @@ func (az *Cloud) reconcilePublicIP(clusterName string, service *v1.Service, lbNa lb = &loadBalancer } - discoveredDesiredPublicIP, pipsToBeDeleted, deletedDesiredPublicIP, pipsToBeUpdated, err := az.getPublicIPUpdates(clusterName, service, pips, wantLb, isInternal, desiredPipName, serviceName, serviceIPTagRequest, shouldPIPExisted) + discoveredDesiredPublicIP, pipsToBeDeleted, deletedDesiredPublicIP, pipsToBeUpdated, err := az.getPublicIPUpdates( + clusterName, service, pips, wantLb, isInternal, desiredPipName, serviceName, serviceIPTagRequest, shouldPIPExisted) if err != nil { return nil, err } @@ -2918,7 +2861,17 @@ func (az *Cloud) reconcilePublicIP(clusterName string, service *v1.Service, lbNa return nil, nil } -func (az *Cloud) getPublicIPUpdates(clusterName string, service *v1.Service, pips []network.PublicIPAddress, wantLb bool, isInternal bool, desiredPipName string, serviceName string, serviceIPTagRequest serviceIPTagRequest, serviceAnnotationRequestsNamedPublicIP bool) (bool, []*network.PublicIPAddress, bool, []*network.PublicIPAddress, error) { +func (az *Cloud) getPublicIPUpdates( + clusterName string, + service *v1.Service, + pips []network.PublicIPAddress, + wantLb bool, + isInternal bool, + desiredPipName string, + serviceName string, + serviceIPTagRequest serviceIPTagRequest, + serviceAnnotationRequestsNamedPublicIP bool, +) (bool, []*network.PublicIPAddress, bool, []*network.PublicIPAddress, error) { var ( err error discoveredDesiredPublicIP bool @@ -3139,7 +3092,7 @@ func findSecurityRule(rules []network.SecurityRule, rule network.SecurityRule) b if !strings.EqualFold(to.String(existingRule.DestinationAddressPrefix), to.String(rule.DestinationAddressPrefix)) { continue } - if !reflect.DeepEqual(to.StringSlice(existingRule.DestinationAddressPrefixes), to.StringSlice(rule.DestinationAddressPrefixes)) { + if !slices.Equal(to.StringSlice(existingRule.DestinationAddressPrefixes), to.StringSlice(rule.DestinationAddressPrefixes)) { continue } } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_backendpool.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_backendpool.go index bf8c4d2c5218..f00db256972c 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_backendpool.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_backendpool.go @@ -23,7 +23,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/go-autorest/autorest/to" v1 "k8s.io/api/core/v1" @@ -286,6 +286,7 @@ func (bi *backendPoolTypeNodeIP) EnsureHostsInPool(service *v1.Service, nodes [] if strings.EqualFold(lbNamePrefix, clusterName) && strings.EqualFold(bi.LoadBalancerSku, consts.LoadBalancerSkuStandard) && bi.getVMSetNamesSharingPrimarySLB().Has(vmSetName) { + klog.V(4).Infof("bi.EnsureHostsInPool: the node %s in VMSet %s is supposed to share the primary SLB", node.Name, vmSetName) shouldSkip = false } } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_managedDiskController.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_managedDiskController.go index 92e33ca5dae8..e53eac1b2120 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_managedDiskController.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_managedDiskController.go @@ -66,6 +66,8 @@ type ManagedDiskOptions struct { SourceType string // ResourceId of the disk encryption set to use for enabling encryption at rest. DiskEncryptionSetID string + // DiskEncryption type, available values: EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformAndCustomerKeys + DiskEncryptionType string // The size in GB. SizeGB int // The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. @@ -80,10 +82,12 @@ type ManagedDiskOptions struct { DiskAccessID *string // BurstingEnabled - Set to true to enable bursting beyond the provisioned performance target of the disk. BurstingEnabled *bool + // SubscriptionID - specify a different SubscriptionID + SubscriptionID string } //CreateManagedDisk : create managed disk -func (c *ManagedDiskController) CreateManagedDisk(options *ManagedDiskOptions) (string, error) { +func (c *ManagedDiskController) CreateManagedDisk(ctx context.Context, options *ManagedDiskOptions) (string, error) { var err error klog.V(4).Infof("azureDisk - creating new managed Name:%s StorageAccountType:%s Size:%v", options.DiskName, options.StorageAccountType, options.SizeGB) @@ -111,7 +115,19 @@ func (c *ManagedDiskController) CreateManagedDisk(options *ManagedDiskOptions) ( diskSizeGB := int32(options.SizeGB) diskSku := options.StorageAccountType - creationData, err := getValidCreationData(c.common.subscriptionID, options.ResourceGroup, options.SourceResourceID, options.SourceType) + rg := c.common.resourceGroup + if options.ResourceGroup != "" { + rg = options.ResourceGroup + } + if options.SubscriptionID != "" && !strings.EqualFold(options.SubscriptionID, c.common.subscriptionID) && options.ResourceGroup == "" { + return "", fmt.Errorf("resourceGroup must be specified when subscriptionID(%s) is not empty", options.SubscriptionID) + } + subsID := c.common.subscriptionID + if options.SubscriptionID != "" { + subsID = options.SubscriptionID + } + + creationData, err := getValidCreationData(subsID, rg, options.SourceResourceID, options.SourceType) if err != nil { return "", err } @@ -176,9 +192,18 @@ func (c *ManagedDiskController) CreateManagedDisk(options *ManagedDiskOptions) ( if strings.Index(strings.ToLower(options.DiskEncryptionSetID), "/subscriptions/") != 0 { return "", fmt.Errorf("AzureDisk - format of DiskEncryptionSetID(%s) is incorrect, correct format: %s", options.DiskEncryptionSetID, consts.DiskEncryptionSetIDFormat) } + encryptionType := compute.EncryptionTypeEncryptionAtRestWithCustomerKey + if options.DiskEncryptionType != "" { + encryptionType = compute.EncryptionType(options.DiskEncryptionType) + klog.V(4).Infof("azureDisk - DiskEncryptionType: %s, DiskEncryptionSetID: %s", options.DiskEncryptionType, options.DiskEncryptionSetID) + } diskProperties.Encryption = &compute.Encryption{ DiskEncryptionSetID: &options.DiskEncryptionSetID, - Type: compute.EncryptionTypeEncryptionAtRestWithCustomerKey, + Type: encryptionType, + } + } else { + if options.DiskEncryptionType != "" { + return "", fmt.Errorf("AzureDisk - DiskEncryptionType(%s) should be empty when DiskEncryptionSetID is not set", options.DiskEncryptionType) } } @@ -206,25 +231,17 @@ func (c *ManagedDiskController) CreateManagedDisk(options *ManagedDiskOptions) ( model.Zones = &createZones } - if options.ResourceGroup == "" { - options.ResourceGroup = c.common.resourceGroup - } - - cloud := c.common.cloud - ctx, cancel := getContextWithCancel() - defer cancel() - rerr := cloud.DisksClient.CreateOrUpdate(ctx, options.ResourceGroup, options.DiskName, model) - if rerr != nil { + if rerr := c.common.cloud.DisksClient.CreateOrUpdate(ctx, subsID, rg, options.DiskName, model); rerr != nil { return "", rerr.Error() } - diskID := fmt.Sprintf(managedDiskPath, cloud.subscriptionID, options.ResourceGroup, options.DiskName) + diskID := fmt.Sprintf(managedDiskPath, subsID, rg, options.DiskName) if options.SkipGetDiskOperation { klog.Warningf("azureDisk - GetDisk(%s, StorageAccountType:%s) is throttled, unable to confirm provisioningState in poll process", options.DiskName, options.StorageAccountType) } else { err = kwait.ExponentialBackoff(defaultBackOff, func() (bool, error) { - provisionState, id, err := c.GetDisk(options.ResourceGroup, options.DiskName) + provisionState, id, err := c.GetDisk(ctx, subsID, rg, options.DiskName) if err == nil { if id != "" { diskID = id @@ -252,7 +269,7 @@ func (c *ManagedDiskController) CreateManagedDisk(options *ManagedDiskOptions) ( //DeleteManagedDisk : delete managed disk func (c *ManagedDiskController) DeleteManagedDisk(ctx context.Context, diskURI string) error { - resourceGroup, err := getResourceGroupFromDiskURI(diskURI) + resourceGroup, subsID, err := getInfoFromDiskURI(diskURI) if err != nil { return err } @@ -262,7 +279,7 @@ func (c *ManagedDiskController) DeleteManagedDisk(ctx context.Context, diskURI s } diskName := path.Base(diskURI) - disk, rerr := c.common.cloud.DisksClient.Get(ctx, resourceGroup, diskName) + disk, rerr := c.common.cloud.DisksClient.Get(ctx, subsID, resourceGroup, diskName) if rerr != nil { if rerr.HTTPStatusCode == http.StatusNotFound { klog.V(2).Infof("azureDisk - disk(%s) is already deleted", diskURI) @@ -277,7 +294,7 @@ func (c *ManagedDiskController) DeleteManagedDisk(ctx context.Context, diskURI s return fmt.Errorf("disk(%s) already attached to node(%s), could not be deleted", diskURI, *disk.ManagedBy) } - if rerr := c.common.cloud.DisksClient.Delete(ctx, resourceGroup, diskName); rerr != nil { + if rerr := c.common.cloud.DisksClient.Delete(ctx, subsID, resourceGroup, diskName); rerr != nil { return rerr.Error() } // We don't need poll here, k8s will immediately stop referencing the disk @@ -289,11 +306,8 @@ func (c *ManagedDiskController) DeleteManagedDisk(ctx context.Context, diskURI s } // GetDisk return: disk provisionState, diskID, error -func (c *ManagedDiskController) GetDisk(resourceGroup, diskName string) (string, string, error) { - ctx, cancel := getContextWithCancel() - defer cancel() - - result, rerr := c.common.cloud.DisksClient.Get(ctx, resourceGroup, diskName) +func (c *ManagedDiskController) GetDisk(ctx context.Context, subsID, resourceGroup, diskName string) (string, string, error) { + result, rerr := c.common.cloud.DisksClient.Get(ctx, subsID, resourceGroup, diskName) if rerr != nil { return "", "", rerr.Error() } @@ -301,22 +315,18 @@ func (c *ManagedDiskController) GetDisk(resourceGroup, diskName string) (string, if result.DiskProperties != nil && (*result.DiskProperties).ProvisioningState != nil { return *(*result.DiskProperties).ProvisioningState, *result.ID, nil } - return "", "", nil } // ResizeDisk Expand the disk to new size -func (c *ManagedDiskController) ResizeDisk(diskURI string, oldSize resource.Quantity, newSize resource.Quantity, supportOnlineResize bool) (resource.Quantity, error) { - ctx, cancel := getContextWithCancel() - defer cancel() - +func (c *ManagedDiskController) ResizeDisk(ctx context.Context, diskURI string, oldSize resource.Quantity, newSize resource.Quantity, supportOnlineResize bool) (resource.Quantity, error) { diskName := path.Base(diskURI) - resourceGroup, err := getResourceGroupFromDiskURI(diskURI) + resourceGroup, subsID, err := getInfoFromDiskURI(diskURI) if err != nil { return oldSize, err } - result, rerr := c.common.cloud.DisksClient.Get(ctx, resourceGroup, diskName) + result, rerr := c.common.cloud.DisksClient.Get(ctx, subsID, resourceGroup, diskName) if rerr != nil { return oldSize, rerr.Error() } @@ -349,26 +359,23 @@ func (c *ManagedDiskController) ResizeDisk(diskURI string, oldSize resource.Quan }, } - ctx, cancel = getContextWithCancel() - defer cancel() - if rerr := c.common.cloud.DisksClient.Update(ctx, resourceGroup, diskName, diskParameter); rerr != nil { + if rerr := c.common.cloud.DisksClient.Update(ctx, subsID, resourceGroup, diskName, diskParameter); rerr != nil { return oldSize, rerr.Error() } klog.V(2).Infof("azureDisk - resize disk(%s) with new size(%d) completed", diskName, requestGiB) - return newSizeQuant, nil } -// get resource group name from a managed disk URI, e.g. return {group-name} according to +// get resource group name, subs id from a managed disk URI, e.g. return {group-name}, {sub-id} according to // /subscriptions/{sub-id}/resourcegroups/{group-name}/providers/microsoft.compute/disks/{disk-id} // according to https://docs.microsoft.com/en-us/rest/api/compute/disks/get -func getResourceGroupFromDiskURI(diskURI string) (string, error) { +func getInfoFromDiskURI(diskURI string) (string, string, error) { fields := strings.Split(diskURI, "/") if len(fields) != 9 || strings.ToLower(fields[3]) != "resourcegroups" { - return "", fmt.Errorf("invalid disk URI: %s", diskURI) + return "", "", fmt.Errorf("invalid disk URI: %s", diskURI) } - return fields[4], nil + return fields[4], fields[2], nil } // GetLabelsForVolume implements PVLabeler.GetLabelsForVolume @@ -383,16 +390,16 @@ func (c *Cloud) GetLabelsForVolume(ctx context.Context, pv *v1.PersistentVolume) return nil, nil } - return c.GetAzureDiskLabels(pv.Spec.AzureDisk.DataDiskURI) + return c.GetAzureDiskLabels(ctx, pv.Spec.AzureDisk.DataDiskURI) } // GetAzureDiskLabels gets availability zone labels for Azuredisk. -func (c *Cloud) GetAzureDiskLabels(diskURI string) (map[string]string, error) { +func (c *Cloud) GetAzureDiskLabels(ctx context.Context, diskURI string) (map[string]string, error) { // Get disk's resource group. diskName := path.Base(diskURI) - resourceGroup, err := getResourceGroupFromDiskURI(diskURI) + resourceGroup, subsID, err := getInfoFromDiskURI(diskURI) if err != nil { - klog.Errorf("Failed to get resource group for AzureDisk %q: %v", diskName, err) + klog.Errorf("Failed to get resource group for AzureDisk %s: %v", diskName, err) return nil, err } @@ -403,18 +410,15 @@ func (c *Cloud) GetAzureDiskLabels(diskURI string) (map[string]string, error) { if c.DisksClient == nil { return labels, nil } - // Get information of the disk. - ctx, cancel := getContextWithCancel() - defer cancel() - disk, rerr := c.DisksClient.Get(ctx, resourceGroup, diskName) + disk, rerr := c.DisksClient.Get(ctx, subsID, resourceGroup, diskName) if rerr != nil { - klog.Errorf("Failed to get information for AzureDisk %q: %v", diskName, rerr) + klog.Errorf("Failed to get information for AzureDisk %s: %v", diskName, rerr) return nil, rerr.Error() } // Check whether availability zone is specified. if disk.Zones == nil || len(*disk.Zones) == 0 { - klog.V(4).Infof("Azure disk %q is not zoned", diskName) + klog.V(4).Infof("Azure disk %s is not zoned", diskName) return labels, nil } @@ -425,7 +429,7 @@ func (c *Cloud) GetAzureDiskLabels(diskURI string) (map[string]string, error) { } zone := c.makeZone(c.Location, zoneID) - klog.V(4).Infof("Got zone %q for Azure disk %q", zone, diskName) + klog.V(4).Infof("Got zone %s for Azure disk %s", zone, diskName) labels[consts.LabelFailureDomainBetaZone] = zone return labels, nil } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_loadbalancer_backendpool.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_loadbalancer_backendpool.go index d0611a98a510..7821dd81e11b 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_loadbalancer_backendpool.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_loadbalancer_backendpool.go @@ -19,7 +19,7 @@ package provider import ( reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" gomock "github.com/golang/mock/gomock" v1 "k8s.io/api/core/v1" diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_vmsets.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_vmsets.go index 1d0e2be10763..9af0bf47c183 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_vmsets.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_vmsets.go @@ -21,7 +21,7 @@ import ( reflect "reflect" compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-07-01/compute" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" azure "github.com/Azure/go-autorest/autorest/azure" gomock "github.com/golang/mock/gomock" v1 "k8s.io/api/core/v1" @@ -249,7 +249,7 @@ func (mr *MockVMSetMockRecorder) EnsureBackendPoolDeletedFromVMSets(vmSetNamesMa } // AttachDisk mocks base method -func (m *MockVMSet) AttachDisk(nodeName types.NodeName, diskMap map[string]*AttachDiskOptions) (*azure.Future, error) { +func (m *MockVMSet) AttachDisk(ctx context.Context, nodeName types.NodeName, diskMap map[string]*AttachDiskOptions) (*azure.Future, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AttachDisk", nodeName, diskMap) ret0, _ := ret[0].(*azure.Future) @@ -258,13 +258,13 @@ func (m *MockVMSet) AttachDisk(nodeName types.NodeName, diskMap map[string]*Atta } // AttachDisk indicates an expected call of AttachDisk -func (mr *MockVMSetMockRecorder) AttachDisk(nodeName, diskMap interface{}) *gomock.Call { +func (mr *MockVMSetMockRecorder) AttachDisk(ctx, nodeName, diskMap interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttachDisk", reflect.TypeOf((*MockVMSet)(nil).AttachDisk), nodeName, diskMap) } // DetachDisk mocks base method -func (m *MockVMSet) DetachDisk(nodeName types.NodeName, diskMap map[string]string) error { +func (m *MockVMSet) DetachDisk(ctx context.Context, nodeName types.NodeName, diskMap map[string]string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DetachDisk", nodeName, diskMap) ret0, _ := ret[0].(error) @@ -272,7 +272,7 @@ func (m *MockVMSet) DetachDisk(nodeName types.NodeName, diskMap map[string]strin } // DetachDisk indicates an expected call of DetachDisk -func (mr *MockVMSetMockRecorder) DetachDisk(nodeName, diskMap interface{}) *gomock.Call { +func (mr *MockVMSetMockRecorder) DetachDisk(ctx, nodeName, diskMap interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DetachDisk", reflect.TypeOf((*MockVMSet)(nil).DetachDisk), nodeName, diskMap) } @@ -308,7 +308,7 @@ func (mr *MockVMSetMockRecorder) GetDataDisks(nodeName, crt interface{}) *gomock } // UpdateVM mocks base method -func (m *MockVMSet) UpdateVM(nodeName types.NodeName) error { +func (m *MockVMSet) UpdateVM(ctx context.Context, nodeName types.NodeName) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpdateVM", nodeName) ret0, _ := ret[0].(error) @@ -316,7 +316,7 @@ func (m *MockVMSet) UpdateVM(nodeName types.NodeName) error { } // UpdateVM indicates an expected call of UpdateVM -func (mr *MockVMSetMockRecorder) UpdateVM(nodeName interface{}) *gomock.Call { +func (mr *MockVMSetMockRecorder) UpdateVM(ctx, nodeName interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateVM", reflect.TypeOf((*MockVMSet)(nil).UpdateVM), nodeName) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_privatelinkservice.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_privatelinkservice.go new file mode 100644 index 000000000000..a4a6d4f9ebce --- /dev/null +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_privatelinkservice.go @@ -0,0 +1,667 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package provider + +import ( + "fmt" + "net" + "strings" + + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/go-autorest/autorest/to" + + v1 "k8s.io/api/core/v1" + "k8s.io/klog/v2" + + azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" + "sigs.k8s.io/cloud-provider-azure/pkg/consts" + "sigs.k8s.io/cloud-provider-azure/pkg/retry" +) + +// reconcilePrivateLinkService() function makes sure a PLS is created or deleted on +// a Load Balancer frontend IP Configuration according to service spec and cluster operation +func (az *Cloud) reconcilePrivateLinkService( + clusterName string, + service *v1.Service, + fipConfig *network.FrontendIPConfiguration, + wantPLS bool, +) error { + createPLS := wantPLS && serviceRequiresPLS(service) + serviceName := getServiceName(service) + fipConfigID := fipConfig.ID + klog.V(2).Infof("reconcilePrivateLinkService for service(%s) - LB fipConfigID(%s) - wantPLS(%t) - createPLS(%t)", serviceName, to.String(fipConfig.Name), wantPLS, createPLS) + + if createPLS { + // Firstly, make sure it's internal service + if !requiresInternalLoadBalancer(service) { + return fmt.Errorf("reconcilePrivateLinkService for service(%s): service requiring private link service must be internal", serviceName) + } + + // Secondly, check if there is a private link service already created + existingPLS, err := az.getPrivateLinkService(fipConfigID, azcache.CacheReadTypeDefault) + if err != nil { + klog.Errorf("reconcilePrivateLinkService for service(%s): getPrivateLinkService(%s) failed: %v", serviceName, to.String(fipConfigID), err) + return err + } + + exists := !strings.EqualFold(to.String(existingPLS.ID), consts.PrivateLinkServiceNotExistID) + if exists { + klog.V(4).Infof("reconcilePrivateLinkService for service(%s): found existing private link service attached(%s)", serviceName, to.String(existingPLS.Name)) + if !isManagedPrivateLinkSerivce(&existingPLS, clusterName) { + return fmt.Errorf( + "reconcilePrivateLinkService for service(%s) failed: LB frontend(%s) already has unmanaged private link service(%s)", + serviceName, + to.String(fipConfigID), + to.String(existingPLS.ID), + ) + } + // If there is an existing private link service, only owner service can update its properties + ownerService := getPrivateLinkServiceOwner(&existingPLS) + if !strings.EqualFold(ownerService, serviceName) { + if serviceHasAdditionalConfigs(service) { + return fmt.Errorf( + "reconcilePrivateLinkService for service(%s) failed: LB frontend(%s) already has existing private link service(%s) owned by service(%s)", + serviceName, + to.String(fipConfigID), + to.String(existingPLS.Name), + ownerService, + ) + } + klog.V(2).Infof( + "reconcilePrivateLinkService for service(%s): automatically share private link service(%s) owned by service(%s)", + serviceName, + to.String(existingPLS.Name), + ownerService, + ) + return nil + } + } else { + existingPLS.ID = nil + existingPLS.Location = &az.Location + existingPLS.PrivateLinkServiceProperties = &network.PrivateLinkServiceProperties{} + if az.HasExtendedLocation() { + existingPLS.ExtendedLocation = &network.ExtendedLocation{ + Name: &az.ExtendedLocationName, + Type: getExtendedLocationTypeFromString(az.ExtendedLocationType), + } + } + } + + plsName, err := az.getPrivateLinkServiceName(&existingPLS, service, fipConfig) + if err != nil { + return err + } + + dirtyPLS, err := az.getExpectedPrivateLinkService(&existingPLS, &plsName, &clusterName, service, fipConfig) + if err != nil { + return err + } + + if dirtyPLS { + klog.V(2).Infof("reconcilePrivateLinkService for service(%s): pls(%s) - updating", serviceName, plsName) + err := az.disablePLSNetworkPolicy(service) + if err != nil { + klog.Errorf("reconcilePrivateLinkService for service(%s) disable PLS network policy failed for pls(%s): %v", serviceName, plsName, err.Error()) + return err + } + existingPLS.Etag = to.StringPtr("") + err = az.CreateOrUpdatePLS(service, existingPLS) + if err != nil { + klog.Errorf("reconcilePrivateLinkService for service(%s) abort backoff: pls(%s) - updating: %s", serviceName, plsName, err.Error()) + return err + } + } + } else if !wantPLS { + existingPLS, err := az.getPrivateLinkService(fipConfigID, azcache.CacheReadTypeDefault) + if err != nil { + klog.Errorf("reconcilePrivateLinkService for service(%s): getPrivateLinkService(%s) failed: %v", serviceName, to.String(fipConfigID), err) + return err + } + + exists := !strings.EqualFold(to.String(existingPLS.ID), consts.PrivateLinkServiceNotExistID) + if exists { + deleteErr := az.safeDeletePLS(&existingPLS, service) + if deleteErr != nil { + klog.Errorf("reconcilePrivateLinkService for service(%s): deletePLS for frontEnd(%s) failed: %v", serviceName, to.String(fipConfigID), err) + return deleteErr.Error() + } + } + } + + klog.V(2).Infof("reconcilePrivateLinkService for service(%s) finished", serviceName) + return nil +} + +func (az *Cloud) disablePLSNetworkPolicy(service *v1.Service) error { + serviceName := getServiceName(service) + subnetName := getPLSSubnetName(service) + if subnetName == nil { + subnetName = &az.SubnetName + } + + subnet, existsSubnet, err := az.getSubnet(az.VnetName, *subnetName) + if err != nil { + return err + } + if !existsSubnet { + return fmt.Errorf("disablePLSNetworkPolicy: failed to get private link service subnet(%s) for service(%s)", *subnetName, serviceName) + } + + // Policy already disabled + if subnet.PrivateLinkServiceNetworkPolicies == network.VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled { + return nil + } + + subnet.PrivateLinkServiceNetworkPolicies = network.VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled + err = az.CreateOrUpdateSubnet(service, subnet) + if err != nil { + return err + } + return nil +} + +func (az *Cloud) safeDeletePLS(pls *network.PrivateLinkService, service *v1.Service) *retry.Error { + if pls == nil { + return nil + } + + peConns := pls.PrivateEndpointConnections + if peConns != nil { + for _, peConn := range *peConns { + klog.V(2).Infof("deletePLS: deleting PEConnection %s", to.String(peConn.Name)) + rerr := az.DeletePEConn(service, to.String(pls.Name), to.String(peConn.Name)) + if rerr != nil { + return rerr + } + } + } + + rerr := az.DeletePLS(service, to.String(pls.Name), to.String((*pls.LoadBalancerFrontendIPConfigurations)[0].ID)) + if rerr != nil { + return rerr + } + klog.V(2).Infof("safeDeletePLS(%s) finished", to.String(pls.Name)) + return nil +} + +// getPrivateLinkServiceName() returns the name of private link service, or any error +func (az *Cloud) getPrivateLinkServiceName( + existingPLS *network.PrivateLinkService, + service *v1.Service, + fipConfig *network.FrontendIPConfiguration, +) (string, error) { + existingName := existingPLS.Name + serviceName := getServiceName(service) + + if nameFromService, found := service.Annotations[consts.ServiceAnnotationPLSName]; found { + nameFromService = strings.TrimSpace(nameFromService) + if existingName != nil && !strings.EqualFold(to.String(existingName), nameFromService) { + return "", fmt.Errorf( + "getPrivateLinkServiceName(%s) failed: cannot change existing private link service name (%s) to (%s)", + serviceName, + to.String(existingName), + nameFromService, + ) + } + return nameFromService, nil + } + + if existingName != nil { + return to.String(existingName), nil + } + + // default PLS name: pls- + return fmt.Sprintf("%s-%s", "pls", *fipConfig.Name), nil +} + +// getExpectedPrivateLinkService builds expected PLS object from service spec +func (az *Cloud) getExpectedPrivateLinkService( + existingPLS *network.PrivateLinkService, + plsName *string, + clusterName *string, + service *v1.Service, + fipConfig *network.FrontendIPConfiguration, +) (dirtyPLS bool, err error) { + dirtyPLS = false + + if existingPLS == nil { + return false, fmt.Errorf("getExpectedPrivateLinkService: existingPLS is nil (unexpected)") + } + + // This only happens for an empty + if existingPLS.Name == nil || !strings.EqualFold(*existingPLS.Name, *plsName) { + existingPLS.Name = plsName + dirtyPLS = true + } + + // Set failed PLS as dirty so that provision can be retried + if existingPLS.ProvisioningState == network.ProvisioningStateFailed { + dirtyPLS = true + } + + // Shadow copy properties to avoid changing pls cache + plsProperties := *existingPLS.PrivateLinkServiceProperties + existingPLS.PrivateLinkServiceProperties = &plsProperties + + // Set LBFrontendIpConfiguration + if existingPLS.LoadBalancerFrontendIPConfigurations == nil { + existingPLS.LoadBalancerFrontendIPConfigurations = &[]network.FrontendIPConfiguration{{ID: fipConfig.ID}} + dirtyPLS = true + } + + changed, err := az.reconcilePLSIpConfigs(existingPLS, service) + if err != nil { + return false, err + } + if changed { + dirtyPLS = true + } + + if reconcilePLSEnableProxyProtocol(existingPLS, service) { + dirtyPLS = true + } + + if reconcilePLSFqdn(existingPLS, service) { + dirtyPLS = true + } + + changed, err = reconcilePLSVisibility(existingPLS, service) + if err != nil { + return false, err + } + if changed { + dirtyPLS = true + } + + if az.reconcilePLSTags(existingPLS, clusterName, service) { + dirtyPLS = true + } + + return dirtyPLS, nil +} + +// reconcile Private link service's IP configurations +func (az *Cloud) reconcilePLSIpConfigs( + existingPLS *network.PrivateLinkService, + service *v1.Service, +) (bool, error) { + changed := false + serviceName := getServiceName(service) + + subnetName := getPLSSubnetName(service) + if subnetName == nil { + subnetName = &az.SubnetName + } + subnet, existsSubnet, err := az.getSubnet(az.VnetName, *subnetName) + if err != nil { + return false, err + } + if !existsSubnet { + return false, fmt.Errorf("checkAndUpdatePLSIPConfigs: failed to get private link service subnet(%s) for service(%s)", *subnetName, serviceName) + } + + ipConfigCount, err := getPLSIPConfigCount(service) + if err != nil { + return false, err + } + + staticIps, primaryIP, err := getPLSStaticIPs(service) + if err != nil { + return false, err + } + + if int(ipConfigCount) < len(staticIps) { + return false, fmt.Errorf("checkAndUpdatePLSIPConfigs: ipConfigCount(%d) must be no smaller than number of static IPs specified(%d)", ipConfigCount, len(staticIps)) + } + + if existingPLS.IPConfigurations == nil { + existingPLS.IPConfigurations = &[]network.PrivateLinkServiceIPConfiguration{} + changed = true + } + + if int32(len(*existingPLS.IPConfigurations)) != ipConfigCount { + changed = true + } + + existingStaticIps := make([]string, 0) + for _, ipConfig := range *existingPLS.IPConfigurations { + if !strings.EqualFold(to.String(subnet.ID), to.String(ipConfig.Subnet.ID)) { + changed = true + } + if strings.EqualFold(string(ipConfig.PrivateIPAllocationMethod), string(network.IPAllocationMethodStatic)) { + klog.V(10).Infof("Found static IP: %s", to.String(ipConfig.PrivateIPAddress)) + if _, found := staticIps[to.String(ipConfig.PrivateIPAddress)]; !found { + changed = true + } + existingStaticIps = append(existingStaticIps, to.String(ipConfig.PrivateIPAddress)) + } + if *ipConfig.Primary { + if strings.EqualFold(string(ipConfig.PrivateIPAllocationMethod), string(network.IPAllocationMethodStatic)) { + if !strings.EqualFold(primaryIP, to.String(ipConfig.PrivateIPAddress)) { + changed = true + } + } else { + // Dynamic + if primaryIP != "" { + changed = true + } + } + } + } + if len(existingStaticIps) != len(staticIps) { + changed = true + } + + if changed { + ipConfigs := []network.PrivateLinkServiceIPConfiguration{} + for k := range staticIps { + ip := k + isPrimary := strings.EqualFold(ip, primaryIP) + configName := fmt.Sprintf("%s-%s-static-%s", to.String(subnet.Name), to.String(existingPLS.Name), ip) + ipConfigs = append(ipConfigs, network.PrivateLinkServiceIPConfiguration{ + Name: &configName, + PrivateLinkServiceIPConfigurationProperties: &network.PrivateLinkServiceIPConfigurationProperties{ + PrivateIPAddress: &ip, + PrivateIPAllocationMethod: network.IPAllocationMethodStatic, + Subnet: &network.Subnet{ + ID: subnet.ID, + }, + Primary: &isPrimary, + PrivateIPAddressVersion: network.IPVersionIPv4, + }, + }) + } + for i := 0; i < int(ipConfigCount)-len(staticIps); i++ { + isPrimary := primaryIP == "" && i == 0 + configName := fmt.Sprintf("%s-%s-dynamic-%d", to.String(subnet.Name), to.String(existingPLS.Name), i) + ipConfigs = append(ipConfigs, network.PrivateLinkServiceIPConfiguration{ + Name: &configName, + PrivateLinkServiceIPConfigurationProperties: &network.PrivateLinkServiceIPConfigurationProperties{ + PrivateIPAllocationMethod: network.IPAllocationMethodDynamic, + Subnet: &network.Subnet{ + ID: subnet.ID, + }, + Primary: &isPrimary, + PrivateIPAddressVersion: network.IPVersionIPv4, + }, + }) + } + existingPLS.IPConfigurations = &ipConfigs + } + return changed, nil +} + +func serviceRequiresPLS(service *v1.Service) bool { + return getBoolValueFromServiceAnnotations(service, consts.ServiceAnnotationPLSCreation) +} + +func reconcilePLSEnableProxyProtocol( + existingPLS *network.PrivateLinkService, + service *v1.Service, +) bool { + changed := false + enableProxyProtocol := getBoolValueFromServiceAnnotations(service, consts.ServiceAnnotationPLSProxyProtocol) + if enableProxyProtocol && (existingPLS.EnableProxyProtocol == nil || !*existingPLS.EnableProxyProtocol) { + changed = true + } else if !enableProxyProtocol && (existingPLS.EnableProxyProtocol != nil && *existingPLS.EnableProxyProtocol) { + changed = true + } + if changed { + existingPLS.EnableProxyProtocol = &enableProxyProtocol + } + return changed +} + +func reconcilePLSFqdn( + existingPLS *network.PrivateLinkService, + service *v1.Service, +) bool { + changed := false + fqdns := getPLSFqdns(service) + if existingPLS.Fqdns == nil { + if len(fqdns) != 0 { + changed = true + } + } else if !sameContentInSlices(fqdns, *existingPLS.Fqdns) { + changed = true + } + + if changed { + existingPLS.Fqdns = &fqdns + } + return changed +} + +func reconcilePLSVisibility( + existingPLS *network.PrivateLinkService, + service *v1.Service, +) (bool, error) { + changed := false + visibilitySubs, _ := getPLSVisibility(service) + autoApprovalSubs := getPLSAutoApproval(service) + + if existingPLS.Visibility == nil || existingPLS.Visibility.Subscriptions == nil { + if len(visibilitySubs) != 0 { + changed = true + } + } else if !sameContentInSlices(visibilitySubs, *existingPLS.Visibility.Subscriptions) { + changed = true + } + + if existingPLS.AutoApproval == nil || existingPLS.AutoApproval.Subscriptions == nil { + if len(autoApprovalSubs) != 0 { + changed = true + } + } else if !sameContentInSlices(autoApprovalSubs, *existingPLS.AutoApproval.Subscriptions) { + changed = true + } + + if changed { + existingPLS.Visibility = &network.PrivateLinkServicePropertiesVisibility{ + Subscriptions: &visibilitySubs, + } + existingPLS.AutoApproval = &network.PrivateLinkServicePropertiesAutoApproval{ + Subscriptions: &autoApprovalSubs, + } + } + return changed, nil +} + +func (az *Cloud) reconcilePLSTags( + existingPLS *network.PrivateLinkService, + clusterName *string, + service *v1.Service, +) bool { + configTags := parseTags(az.Tags, az.TagsMap) + serviceName := getServiceName(service) + + if existingPLS.Tags == nil { + existingPLS.Tags = make(map[string]*string) + } + + tags := existingPLS.Tags + + // include the cluster name and service name tags when comparing + if v, ok := tags[consts.ClusterNameTagKey]; ok && v != nil { + configTags[consts.ClusterNameTagKey] = v + } else { + configTags[consts.ClusterNameTagKey] = clusterName + } + if v, ok := tags[consts.OwnerServiceTagKey]; ok && v != nil { + configTags[consts.OwnerServiceTagKey] = v + } else { + configTags[consts.OwnerServiceTagKey] = &serviceName + } + + tags, changed := az.reconcileTags(existingPLS.Tags, configTags) + existingPLS.Tags = tags + + return changed +} + +func getPLSSubnetName(service *v1.Service) *string { + if l, found := service.Annotations[consts.ServiceAnnotationPLSIpConfigurationSubnet]; found && strings.TrimSpace(l) != "" { + return &l + } + + if l, found := service.Annotations[consts.ServiceAnnotationLoadBalancerInternalSubnet]; found && strings.TrimSpace(l) != "" { + return &l + } + + return nil +} + +func getPLSIPConfigCount(service *v1.Service) (int32, error) { + ipConfigCnt, err := consts.Getint32ValueFromK8sSvcAnnotation( + service.Annotations, + consts.ServiceAnnotationPLSIpConfigurationIPAddressCount, + func(val *int32) error { + const ( + MinimumNumOfIPConfig = 1 + MaximumNumOfIPConfig = 8 + ) + if *val < MinimumNumOfIPConfig { + return fmt.Errorf("minimum number of private link service ipConfig is %d, %d provided", MinimumNumOfIPConfig, *val) + } + if *val > MaximumNumOfIPConfig { + return fmt.Errorf("maximum number of private link service ipConfig is %d, %d provided", MaximumNumOfIPConfig, *val) + } + return nil + }, + ) + if err != nil { + return 0, err + } + if ipConfigCnt != nil { + return *ipConfigCnt, nil + } + return consts.PLSDefaultNumOfIPConfig, nil +} + +func getPLSFqdns(service *v1.Service) []string { + fqdns := make([]string, 0) + if v, ok := service.Annotations[consts.ServiceAnnotationPLSFqdns]; ok { + fqdnList := strings.Split(strings.TrimSpace(v), " ") + for _, fqdn := range fqdnList { + fqdn = strings.TrimSpace(fqdn) + if fqdn == "" { + continue + } + fqdns = append(fqdns, fqdn) + } + } + return fqdns +} + +func getPLSVisibility(service *v1.Service) ([]string, bool) { + visibilityList := make([]string, 0) + if val, ok := service.Annotations[consts.ServiceAnnotationPLSVisibility]; ok { + visibilities := strings.Split(strings.TrimSpace(val), " ") + for _, vis := range visibilities { + vis = strings.TrimSpace(vis) + if vis == "" { + continue + } + if vis == "*" { + visibilityList = []string{"*"} + return visibilityList, true + } + visibilityList = append(visibilityList, vis) + } + } + return visibilityList, false +} + +func getPLSAutoApproval(service *v1.Service) []string { + autoApprovalList := make([]string, 0) + if val, ok := service.Annotations[consts.ServiceAnnotationPLSAutoApproval]; ok { + autoApprovals := strings.Split(strings.TrimSpace(val), " ") + for _, autoApp := range autoApprovals { + autoApp = strings.TrimSpace(autoApp) + if autoApp == "" { + continue + } + autoApprovalList = append(autoApprovalList, autoApp) + } + } + return autoApprovalList +} + +func getPLSStaticIPs(service *v1.Service) (map[string]bool, string, error) { + result := make(map[string]bool) + primaryIP := "" + if val, ok := service.Annotations[consts.ServiceAnnotationPLSIpConfigurationIPAddress]; ok { + ips := strings.Split(strings.TrimSpace(val), " ") + for _, ip := range ips { + ip = strings.TrimSpace(ip) + if ip == "" { + continue // skip empty string + } + + parsedIP := net.ParseIP(ip) + if parsedIP == nil { + return nil, "", fmt.Errorf("getPLSStaticIPs: %s is not a valid IP address", ip) + } + + if parsedIP.To4() == nil { + return nil, "", fmt.Errorf("getPLSStaticIPs: private link service ip config only supports IPv4, %s provided", ip) + } + + result[ip] = true + if primaryIP == "" { + primaryIP = ip + } + } + } + + return result, primaryIP, nil +} + +func isManagedPrivateLinkSerivce(existingPLS *network.PrivateLinkService, clusterName string) bool { + tags := existingPLS.Tags + v, ok := tags[consts.ClusterNameTagKey] + return ok && v != nil && strings.EqualFold(strings.TrimSpace(*v), clusterName) +} + +// find owner service for an existing private link service from its tags +func getPrivateLinkServiceOwner(existingPLS *network.PrivateLinkService) string { + tags := existingPLS.Tags + v, ok := tags[consts.OwnerServiceTagKey] + if ok && v != nil { + return *v + } + return "" +} + +// Return true if service has private link service config annotations +func serviceHasAdditionalConfigs(service *v1.Service) bool { + tagKeyList := []string{ + consts.ServiceAnnotationPLSName, + consts.ServiceAnnotationPLSIpConfigurationSubnet, + consts.ServiceAnnotationPLSIpConfigurationIPAddressCount, + consts.ServiceAnnotationPLSIpConfigurationIPAddress, + consts.ServiceAnnotationPLSFqdns, + consts.ServiceAnnotationPLSProxyProtocol, + consts.ServiceAnnotationPLSVisibility, + consts.ServiceAnnotationPLSAutoApproval} + for _, k := range tagKeyList { + if _, found := service.Annotations[k]; found { + return true + } + } + return false +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_routes.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_routes.go index a669e1be8f2c..d3d768b02e20 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_routes.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_routes.go @@ -23,7 +23,7 @@ import ( "sync" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/go-autorest/autorest/to" "k8s.io/apimachinery/pkg/types" @@ -383,10 +383,6 @@ func (az *Cloud) CreateRoute(ctx context.Context, clusterName string, nameHint s return err } if unmanaged { - if az.ipv6DualStackEnabled { - //TODO (khenidak) add support for unmanaged nodes when the feature reaches beta - return fmt.Errorf("unmanaged nodes are not supported in dual stack mode") - } klog.V(2).Infof("CreateRoute: omitting unmanaged node %q", kubeRoute.TargetNode) az.routeCIDRsLock.Lock() defer az.routeCIDRsLock.Unlock() diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_standard.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_standard.go index 6a39d6b9a1a6..66b40f33658c 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_standard.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_standard.go @@ -31,7 +31,7 @@ import ( "sigs.k8s.io/cloud-provider-azure/pkg/consts" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-07-01/compute" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/go-autorest/autorest/to" v1 "k8s.io/api/core/v1" @@ -322,7 +322,15 @@ func (az *Cloud) getRulePrefix(service *v1.Service) string { } func (az *Cloud) getPublicIPName(clusterName string, service *v1.Service) string { - return fmt.Sprintf("%s-%s", clusterName, az.GetLoadBalancerName(context.TODO(), clusterName, service)) + pipName := fmt.Sprintf("%s-%s", clusterName, az.GetLoadBalancerName(context.TODO(), clusterName, service)) + if prefixID, ok := service.Annotations[consts.ServiceAnnotationPIPPrefixID]; ok && prefixID != "" { + prefixName, err := getLastSegment(prefixID, "/") + if err != nil { + return pipName + } + pipName = fmt.Sprintf("%s-%s", pipName, prefixName) + } + return pipName } func (az *Cloud) serviceOwnsRule(service *v1.Service, rule string) bool { @@ -869,6 +877,16 @@ func (as *availabilitySet) getPrimaryInterfaceWithVMSet(nodeName, vmSetName stri } else if as.EnableMultipleStandardLoadBalancers { // need to check the vmSet name when using multiple standard LBs needCheck = true + + // ensure the vm that is supposed to share the primary SLB in the backendpool of the primary SLB + if machine.AvailabilitySet != nil { + vmasName, _ := getLastSegment(to.String(machine.AvailabilitySet.ID), "/") + if strings.EqualFold(as.GetPrimaryVMSetName(), vmSetName) && + as.getVMSetNamesSharingPrimarySLB().Has(strings.ToLower(vmasName)) { + klog.V(4).Infof("getPrimaryInterfaceWithVMSet: the vm %s in the vmSet %s is supposed to share the primary SLB", nodeName, vmasName) + needCheck = false + } + } } if vmSetName != "" && needCheck { expectedAvailabilitySetID := as.getAvailabilitySetID(nodeResourceGroup, vmSetName) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storageaccount.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storageaccount.go index 958c20062397..cc04f3e744fe 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storageaccount.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storageaccount.go @@ -22,7 +22,7 @@ import ( "strings" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-07-01/compute" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns" "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-02-01/storage" "github.com/Azure/go-autorest/autorest/to" @@ -41,6 +41,7 @@ const PrivateDNSZoneName = "privatelink.file.core.windows.net" // AccountOptions contains the fields which are used to create storage account. type AccountOptions struct { + SubscriptionID string Name, Type, Kind, ResourceGroup, Location string EnableHTTPSTrafficOnly bool // indicate whether create new account when Name is empty or when account does not exists @@ -53,6 +54,10 @@ type AccountOptions struct { AllowBlobPublicAccess *bool Tags map[string]string VirtualNetworkResourceIDs []string + VNetResourceGroup string + VNetName string + SubnetName string + MatchTags bool } type accountWithLocation struct { @@ -64,7 +69,7 @@ func (az *Cloud) getStorageAccounts(ctx context.Context, accountOptions *Account if az.StorageAccountClient == nil { return nil, fmt.Errorf("StorageAccountClient is nil") } - result, rerr := az.StorageAccountClient.ListByResourceGroup(ctx, accountOptions.ResourceGroup) + result, rerr := az.StorageAccountClient.ListByResourceGroup(ctx, accountOptions.SubscriptionID, accountOptions.ResourceGroup) if rerr != nil { return nil, rerr.Error() } @@ -77,6 +82,7 @@ func (az *Cloud) getStorageAccounts(ctx context.Context, accountOptions *Account isLocationEqual(acct, accountOptions) && AreVNetRulesEqual(acct, accountOptions) && isLargeFileSharesPropertyEqual(acct, accountOptions) && + isTagsEqual(acct, accountOptions) && isTaggedWithSkip(acct) && isHnsPropertyEqual(acct, accountOptions) && isEnableNfsV3PropertyEqual(acct, accountOptions) && @@ -90,12 +96,12 @@ func (az *Cloud) getStorageAccounts(ctx context.Context, accountOptions *Account } // GetStorageAccesskey gets the storage account access key -func (az *Cloud) GetStorageAccesskey(ctx context.Context, account, resourceGroup string) (string, error) { +func (az *Cloud) GetStorageAccesskey(ctx context.Context, subsID, account, resourceGroup string) (string, error) { if az.StorageAccountClient == nil { return "", fmt.Errorf("StorageAccountClient is nil") } - result, rerr := az.StorageAccountClient.ListKeys(ctx, resourceGroup, account) + result, rerr := az.StorageAccountClient.ListKeys(ctx, subsID, resourceGroup, account) if rerr != nil { return "", rerr.Error() } @@ -127,6 +133,31 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou resourceGroup := accountOptions.ResourceGroup location := accountOptions.Location enableHTTPSTrafficOnly := accountOptions.EnableHTTPSTrafficOnly + vnetResourceGroup := accountOptions.VNetResourceGroup + vnetName := accountOptions.VNetName + if vnetName == "" { + vnetName = az.VnetName + } + + subnetName := accountOptions.SubnetName + if subnetName == "" { + subnetName = az.SubnetName + } + + if accountOptions.SubscriptionID != "" && !strings.EqualFold(accountOptions.SubscriptionID, az.Config.SubscriptionID) && accountOptions.ResourceGroup == "" { + return "", "", fmt.Errorf("resourceGroup must be specified when subscriptionID(%s) is not empty", accountOptions.SubscriptionID) + } + + subsID := az.Config.SubscriptionID + if accountOptions.SubscriptionID != "" { + subsID = accountOptions.SubscriptionID + } + + if len(accountOptions.Tags) == 0 { + accountOptions.Tags = make(map[string]string) + } + // set built-in tags + accountOptions.Tags[consts.CreatedByTag] = "azure" var createNewAccount bool if len(accountName) == 0 { @@ -152,16 +183,18 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou createNewAccount = false if accountOptions.CreateAccount { // check whether account exists - if _, err := az.GetStorageAccesskey(ctx, accountName, resourceGroup); err != nil { + if _, err := az.GetStorageAccesskey(ctx, subsID, accountName, resourceGroup); err != nil { klog.V(2).Infof("get storage key for storage account %s returned with %v", accountName, err) createNewAccount = true } } } - vnetResourceGroup := az.ResourceGroup - if len(az.VnetResourceGroup) > 0 { - vnetResourceGroup = az.VnetResourceGroup + if vnetResourceGroup == "" { + vnetResourceGroup = az.ResourceGroup + if len(az.VnetResourceGroup) > 0 { + vnetResourceGroup = az.VnetResourceGroup + } } if accountOptions.CreatePrivateEndpoint { @@ -169,6 +202,12 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou if err := az.createPrivateDNSZone(ctx, vnetResourceGroup); err != nil { return "", "", fmt.Errorf("Failed to create private DNS zone(%s) in resourceGroup(%s), error: %v", PrivateDNSZoneName, vnetResourceGroup, err) } + + // Create virtual link to the private DNS zone + vNetLinkName := accountName + "-vnetlink" + if err := az.createVNetLink(ctx, vNetLinkName, vnetResourceGroup, vnetName); err != nil { + return "", "", fmt.Errorf("Failed to create virtual link for vnet(%s) and DNS Zone(%s) in resourceGroup(%s), error: %v", vnetName, PrivateDNSZoneName, vnetResourceGroup, err) + } } if createNewAccount { @@ -208,10 +247,6 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou if accountKind != "" { kind = storage.Kind(accountKind) } - if len(accountOptions.Tags) == 0 { - accountOptions.Tags = make(map[string]string) - } - accountOptions.Tags[consts.CreatedByTag] = "azure" tags := convertMapToMapPointer(accountOptions.Tags) klog.V(2).Infof("azure - no matching account found, begin to create a new account %s in resource group %s, location: %s, accountType: %s, accountKind: %s, tags: %+v", @@ -242,7 +277,7 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou return "", "", fmt.Errorf("StorageAccountClient is nil") } - if rerr := az.StorageAccountClient.Create(ctx, resourceGroup, accountName, cp); rerr != nil { + if rerr := az.StorageAccountClient.Create(ctx, subsID, resourceGroup, accountName, cp); rerr != nil { return "", "", fmt.Errorf("failed to create storage account %s, error: %v", accountName, rerr) } @@ -263,33 +298,27 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou if accountOptions.CreatePrivateEndpoint { // Get properties of the storageAccount - storageAccount, err := az.StorageAccountClient.GetProperties(ctx, resourceGroup, accountName) + storageAccount, err := az.StorageAccountClient.GetProperties(ctx, subsID, resourceGroup, accountName) if err != nil { return "", "", fmt.Errorf("Failed to get the properties of storage account(%s), resourceGroup(%s), error: %v", accountName, resourceGroup, err) } // Create private endpoint privateEndpointName := accountName + "-pvtendpoint" - if err := az.createPrivateEndpoint(ctx, accountName, storageAccount.ID, privateEndpointName, vnetResourceGroup); err != nil { + if err := az.createPrivateEndpoint(ctx, accountName, storageAccount.ID, privateEndpointName, vnetResourceGroup, vnetName, subnetName, location); err != nil { return "", "", fmt.Errorf("Failed to create private endpoint for storage account(%s), resourceGroup(%s), error: %v", accountName, vnetResourceGroup, err) } - // Create virtual link to the zone private DNS zone - vNetLinkName := accountName + "-vnetlink" - if err := az.createVNetLink(ctx, vNetLinkName, vnetResourceGroup); err != nil { - return "", "", fmt.Errorf("Failed to create virtual link for vnet(%s) and DNS Zone(%s) in resourceGroup(%s), error: %v", az.VnetName, PrivateDNSZoneName, vnetResourceGroup, err) - } - // Create dns zone group dnsZoneGroupName := accountName + "-dnszonegroup" - if err := az.createPrivateDNSZoneGroup(ctx, dnsZoneGroupName, privateEndpointName, vnetResourceGroup); err != nil { - return "", "", fmt.Errorf("Failed to create private DNS zone group - privateEndpoint(%s), vNetName(%s), resourceGroup(%s), error: %v", privateEndpointName, az.VnetName, vnetResourceGroup, err) + if err := az.createPrivateDNSZoneGroup(ctx, dnsZoneGroupName, privateEndpointName, vnetResourceGroup, vnetName); err != nil { + return "", "", fmt.Errorf("Failed to create private DNS zone group - privateEndpoint(%s), vNetName(%s), resourceGroup(%s), error: %v", privateEndpointName, vnetName, vnetResourceGroup, err) } } } // find the access key with this account - accountKey, err := az.GetStorageAccesskey(ctx, accountName, resourceGroup) + accountKey, err := az.GetStorageAccesskey(ctx, subsID, accountName, resourceGroup) if err != nil { return "", "", fmt.Errorf("could not get storage key for storage account %s: %w", accountName, err) } @@ -297,16 +326,20 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou return accountName, accountKey, nil } -func (az *Cloud) createPrivateEndpoint(ctx context.Context, accountName string, accountID *string, privateEndpointName, vnetResourceGroup string) error { +func (az *Cloud) createPrivateEndpoint(ctx context.Context, accountName string, accountID *string, privateEndpointName, vnetResourceGroup, vnetName, subnetName, location string) error { klog.V(2).Infof("Creating private endpoint(%s) for account (%s)", privateEndpointName, accountName) - subnet, _, err := az.getSubnet(az.VnetName, az.SubnetName) + subnet, _, err := az.getSubnet(vnetName, subnetName) if err != nil { return err } - // Disable the private endpoint network policies before creating private endpoint - subnet.SubnetPropertiesFormat.PrivateEndpointNetworkPolicies = network.VirtualNetworkPrivateEndpointNetworkPoliciesDisabled - if rerr := az.SubnetsClient.CreateOrUpdate(ctx, vnetResourceGroup, az.VnetName, az.SubnetName, subnet); rerr != nil { + if subnet.SubnetPropertiesFormat == nil { + klog.Errorf("SubnetPropertiesFormat of (%s, %s) is nil", vnetName, subnetName) + } else { + // Disable the private endpoint network policies before creating private endpoint + subnet.SubnetPropertiesFormat.PrivateEndpointNetworkPolicies = network.VirtualNetworkPrivateEndpointNetworkPoliciesDisabled + } + if rerr := az.SubnetsClient.CreateOrUpdate(ctx, vnetResourceGroup, vnetName, subnetName, subnet); rerr != nil { return rerr.Error() } @@ -321,41 +354,42 @@ func (az *Cloud) createPrivateEndpoint(ctx context.Context, accountName string, } privateLinkServiceConnections := []network.PrivateLinkServiceConnection{privateLinkServiceConnection} privateEndpoint := network.PrivateEndpoint{ - Location: &az.Location, + Location: &location, PrivateEndpointProperties: &network.PrivateEndpointProperties{Subnet: &subnet, PrivateLinkServiceConnections: &privateLinkServiceConnections}, } - return az.privateendpointclient.CreateOrUpdate(ctx, vnetResourceGroup, privateEndpointName, privateEndpoint, true) + + return az.privateendpointclient.CreateOrUpdate(ctx, vnetResourceGroup, privateEndpointName, privateEndpoint, "", true).Error() } func (az *Cloud) createPrivateDNSZone(ctx context.Context, vnetResourceGroup string) error { klog.V(2).Infof("Creating private dns zone(%s) in resourceGroup (%s)", PrivateDNSZoneName, vnetResourceGroup) location := LocationGlobal privateDNSZone := privatedns.PrivateZone{Location: &location} - if err := az.privatednsclient.CreateOrUpdate(ctx, vnetResourceGroup, PrivateDNSZoneName, privateDNSZone, true); err != nil { - if strings.Contains(err.Error(), "exists already") { + if err := az.privatednsclient.CreateOrUpdate(ctx, vnetResourceGroup, PrivateDNSZoneName, privateDNSZone, "", true); err != nil { + if strings.Contains(err.Error().Error(), "exists already") { klog.V(2).Infof("private dns zone(%s) in resourceGroup (%s) already exists", PrivateDNSZoneName, vnetResourceGroup) return nil } - return err + return err.Error() } return nil } -func (az *Cloud) createVNetLink(ctx context.Context, vNetLinkName, vnetResourceGroup string) error { +func (az *Cloud) createVNetLink(ctx context.Context, vNetLinkName, vnetResourceGroup, vnetName string) error { klog.V(2).Infof("Creating virtual link for vnet(%s) and DNS Zone(%s) in resourceGroup(%s)", vNetLinkName, PrivateDNSZoneName, vnetResourceGroup) location := LocationGlobal - vnetID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s", az.SubscriptionID, vnetResourceGroup, az.VnetName) + vnetID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s", az.SubscriptionID, vnetResourceGroup, vnetName) parameters := privatedns.VirtualNetworkLink{ Location: &location, VirtualNetworkLinkProperties: &privatedns.VirtualNetworkLinkProperties{ VirtualNetwork: &privatedns.SubResource{ID: &vnetID}, RegistrationEnabled: to.BoolPtr(true)}, } - return az.virtualNetworkLinksClient.CreateOrUpdate(ctx, vnetResourceGroup, PrivateDNSZoneName, vNetLinkName, parameters, false) + return az.virtualNetworkLinksClient.CreateOrUpdate(ctx, vnetResourceGroup, PrivateDNSZoneName, vNetLinkName, parameters, "", false).Error() } -func (az *Cloud) createPrivateDNSZoneGroup(ctx context.Context, dnsZoneGroupName, privateEndpointName, vnetResourceGroup string) error { - klog.V(2).Infof("Creating private DNS zone group(%s) with privateEndpoint(%s), vNetName(%s), resourceGroup(%s)", dnsZoneGroupName, privateEndpointName, az.VnetName, vnetResourceGroup) +func (az *Cloud) createPrivateDNSZoneGroup(ctx context.Context, dnsZoneGroupName, privateEndpointName, vnetResourceGroup, vnetName string) error { + klog.V(2).Infof("Creating private DNS zone group(%s) with privateEndpoint(%s), vNetName(%s), resourceGroup(%s)", dnsZoneGroupName, privateEndpointName, vnetName, vnetResourceGroup) privateDNSZoneID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateDnsZones/%s", az.SubscriptionID, vnetResourceGroup, PrivateDNSZoneName) dnsZoneName := PrivateDNSZoneName privateDNSZoneConfig := network.PrivateDNSZoneConfig{ @@ -369,17 +403,15 @@ func (az *Cloud) createPrivateDNSZoneGroup(ctx context.Context, dnsZoneGroupName PrivateDNSZoneConfigs: &privateDNSZoneConfigs, }, } - return az.privatednszonegroupclient.CreateOrUpdate(ctx, vnetResourceGroup, privateEndpointName, dnsZoneGroupName, privateDNSZoneGroup, false) + return az.privatednszonegroupclient.CreateOrUpdate(ctx, vnetResourceGroup, privateEndpointName, dnsZoneGroupName, privateDNSZoneGroup, "", false).Error() } // AddStorageAccountTags add tags to storage account -func (az *Cloud) AddStorageAccountTags(resourceGroup, account string, tags map[string]*string) *retry.Error { +func (az *Cloud) AddStorageAccountTags(ctx context.Context, subsID, resourceGroup, account string, tags map[string]*string) *retry.Error { if az.StorageAccountClient == nil { return retry.NewError(false, fmt.Errorf("StorageAccountClient is nil")) } - ctx, cancel := getContextWithCancel() - defer cancel() - result, rerr := az.StorageAccountClient.GetProperties(ctx, resourceGroup, account) + result, rerr := az.StorageAccountClient.GetProperties(ctx, subsID, resourceGroup, account) if rerr != nil { return rerr } @@ -395,17 +427,15 @@ func (az *Cloud) AddStorageAccountTags(resourceGroup, account string, tags map[s } updateParams := storage.AccountUpdateParameters{Tags: newTags} - return az.StorageAccountClient.Update(ctx, resourceGroup, account, updateParams) + return az.StorageAccountClient.Update(ctx, subsID, resourceGroup, account, updateParams) } // RemoveStorageAccountTag remove tag from storage account -func (az *Cloud) RemoveStorageAccountTag(resourceGroup, account, key string) *retry.Error { +func (az *Cloud) RemoveStorageAccountTag(ctx context.Context, subsID, resourceGroup, account, key string) *retry.Error { if az.StorageAccountClient == nil { return retry.NewError(false, fmt.Errorf("StorageAccountClient is nil")) } - ctx, cancel := getContextWithCancel() - defer cancel() - result, rerr := az.StorageAccountClient.GetProperties(ctx, resourceGroup, account) + result, rerr := az.StorageAccountClient.GetProperties(ctx, subsID, resourceGroup, account) if rerr != nil { return rerr } @@ -418,7 +448,7 @@ func (az *Cloud) RemoveStorageAccountTag(resourceGroup, account, key string) *re delete(result.Tags, key) if originalLen != len(result.Tags) { updateParams := storage.AccountUpdateParameters{Tags: result.Tags} - return az.StorageAccountClient.Update(ctx, resourceGroup, account, updateParams) + return az.StorageAccountClient.Update(ctx, subsID, resourceGroup, account, updateParams) } return nil } @@ -468,7 +498,7 @@ func AreVNetRulesEqual(account storage.Account, accountOptions *AccountOptions) } func isLargeFileSharesPropertyEqual(account storage.Account, accountOptions *AccountOptions) bool { - if account.Sku.Tier != storage.SkuTier(compute.DiskStorageAccountTypesPremiumLRS) && accountOptions.EnableLargeFileShare && (len(account.LargeFileSharesState) == 0 || account.LargeFileSharesState == storage.LargeFileSharesStateDisabled) { + if account.Sku.Tier != storage.SkuTier(compute.StorageAccountTypesPremiumLRS) && accountOptions.EnableLargeFileShare && (len(account.LargeFileSharesState) == 0 || account.LargeFileSharesState == storage.LargeFileSharesStateDisabled) { return false } return true @@ -485,6 +515,31 @@ func isTaggedWithSkip(account storage.Account) bool { return true } +func isTagsEqual(account storage.Account, accountOptions *AccountOptions) bool { + if !accountOptions.MatchTags { + // always return true when tags matching is false (by default) + return true + } + + // nil and empty map should be regarded as equal + if len(account.Tags) == 0 && len(accountOptions.Tags) == 0 { + return true + } + + for k, v := range account.Tags { + var value string + // nil and empty value should be regarded as equal + if v != nil { + value = *v + } + if accountOptions.Tags[k] != value { + return false + } + } + + return true +} + func isHnsPropertyEqual(account storage.Account, accountOptions *AccountOptions) bool { return to.Bool(account.IsHnsEnabled) == to.Bool(accountOptions.IsHnsEnabled) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_utils.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_utils.go index 9a5be2dae42a..3a17ac890681 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_utils.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_utils.go @@ -23,7 +23,7 @@ import ( "strings" "sync" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/go-autorest/autorest/to" v1 "k8s.io/api/core/v1" @@ -276,3 +276,27 @@ func isLBBackendPoolTypeIPConfig(service *v1.Service, lb *network.LoadBalancer, } return false } + +func getBoolValueFromServiceAnnotations(service *v1.Service, key string) bool { + if l, found := service.Annotations[key]; found { + return strings.EqualFold(strings.TrimSpace(l), consts.TrueAnnotationValue) + } + return false +} + +func sameContentInSlices(s1 []string, s2 []string) bool { + if len(s1) != len(s2) { + return false + } + map1 := make(map[string]int) + for _, s := range s1 { + map1[s]++ + } + for _, s := range s2 { + if v, ok := map1[s]; !ok || v <= 0 { + return false + } + map1[s]-- + } + return true +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmsets.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmsets.go index d9b2ec82374a..9ebe27533804 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmsets.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmsets.go @@ -20,7 +20,7 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-07-01/compute" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/go-autorest/autorest/azure" v1 "k8s.io/api/core/v1" @@ -76,9 +76,9 @@ type VMSet interface { EnsureBackendPoolDeletedFromVMSets(vmSetNamesMap map[string]bool, backendPoolID string) error // AttachDisk attaches a disk to vm - AttachDisk(nodeName types.NodeName, diskMap map[string]*AttachDiskOptions) (*azure.Future, error) + AttachDisk(ctx context.Context, nodeName types.NodeName, diskMap map[string]*AttachDiskOptions) (*azure.Future, error) // DetachDisk detaches a disk from vm - DetachDisk(nodeName types.NodeName, diskMap map[string]string) error + DetachDisk(ctx context.Context, nodeName types.NodeName, diskMap map[string]string) error // WaitForUpdateResult waits for the response of the update request WaitForUpdateResult(ctx context.Context, future *azure.Future, resourceGroupName, source string) error @@ -86,7 +86,7 @@ type VMSet interface { GetDataDisks(nodeName types.NodeName, crt azcache.AzureCacheReadType) ([]compute.DataDisk, *string, error) // UpdateVM updates a vm - UpdateVM(nodeName types.NodeName) error + UpdateVM(ctx context.Context, nodeName types.NodeName) error // GetPowerStatusByNodeName returns the powerState for the specified node. GetPowerStatusByNodeName(name string) (string, error) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss.go index 8f1358ebca6e..f4e26f6e5693 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss.go @@ -25,7 +25,7 @@ import ( "sync" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-07-01/compute" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/go-autorest/autorest/to" v1 "k8s.io/api/core/v1" @@ -38,6 +38,7 @@ import ( azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/consts" "sigs.k8s.io/cloud-provider-azure/pkg/metrics" + "sigs.k8s.io/cloud-provider-azure/pkg/provider/virtualmachine" ) var ( @@ -152,73 +153,78 @@ func (ss *ScaleSet) getVMSS(vmssName string, crt azcache.AzureCacheReadType) (*c // getVmssVMByNodeIdentity find virtualMachineScaleSetVM by nodeIdentity, using node's parent VMSS cache. // Returns cloudprovider.InstanceNotFound if the node does not belong to the scale set named in nodeIdentity. -func (ss *ScaleSet) getVmssVMByNodeIdentity(node *nodeIdentity, crt azcache.AzureCacheReadType) (string, string, *compute.VirtualMachineScaleSetVM, error) { +func (ss *ScaleSet) getVmssVMByNodeIdentity(node *nodeIdentity, crt azcache.AzureCacheReadType) (*virtualmachine.VirtualMachine, error) { cacheKey, cache, err := ss.getVMSSVMCache(node.resourceGroup, node.vmssName) if err != nil { - return "", "", nil, err + return nil, err } - getter := func(nodeName string, crt azcache.AzureCacheReadType) (string, string, *compute.VirtualMachineScaleSetVM, bool, error) { + getter := func(nodeName string, crt azcache.AzureCacheReadType) (*virtualmachine.VirtualMachine, bool, error) { var found bool cached, err := cache.Get(cacheKey, crt) if err != nil { - return "", "", nil, found, err + return nil, found, err } virtualMachines := cached.(*sync.Map) - if vm, ok := virtualMachines.Load(nodeName); ok { - result := vm.(*vmssVirtualMachinesEntry) + if entry, ok := virtualMachines.Load(nodeName); ok { + result := entry.(*vmssVirtualMachinesEntry) + if result.virtualMachine == nil { + klog.Warningf("failed to get VM with vmssVirtualMachinesEntry on Node %q", nodeName) + return nil, false, nil + } found = true - return result.vmssName, result.instanceID, result.virtualMachine, found, nil + return virtualmachine.FromVirtualMachineScaleSetVM(result.virtualMachine, virtualmachine.ByVMSS(result.vmssName)), found, nil } - return "", "", nil, found, nil + return nil, found, nil } + // FIXME(ccc): check only if vmss is uniform. _, err = getScaleSetVMInstanceID(node.nodeName) if err != nil { - return "", "", nil, err + return nil, err } - vmssName, instanceID, vm, found, err := getter(node.nodeName, crt) + vm, found, err := getter(node.nodeName, crt) if err != nil { - return "", "", nil, err + return nil, err } if !found { // lock and try find nodeName from cache again, refresh cache if still not found ss.lockMap.LockEntry(cacheKey) defer ss.lockMap.UnlockEntry(cacheKey) - vmssName, instanceID, vm, found, err = getter(node.nodeName, crt) + vm, found, err = getter(node.nodeName, crt) if err == nil && found && vm != nil { klog.V(2).Infof("found VMSS VM with nodeName %s after retry", node.nodeName) - return vmssName, instanceID, vm, nil + return vm, nil } klog.V(2).Infof("Couldn't find VMSS VM with nodeName %s, refreshing the cache(vmss: %s, rg: %s)", node.nodeName, node.vmssName, node.resourceGroup) - vmssName, instanceID, vm, found, err = getter(node.nodeName, azcache.CacheReadTypeForceRefresh) + vm, found, err = getter(node.nodeName, azcache.CacheReadTypeForceRefresh) if err != nil { - return "", "", nil, err + return nil, err } } if found && vm != nil { - return vmssName, instanceID, vm, nil + return vm, nil } if !found || vm == nil { klog.Warningf("Unable to find node %s: %v", node.nodeName, cloudprovider.InstanceNotFound) - return "", "", nil, cloudprovider.InstanceNotFound + return nil, cloudprovider.InstanceNotFound } - return vmssName, instanceID, vm, nil + return vm, nil } // getVmssVM gets virtualMachineScaleSetVM by nodeName from cache. // Returns cloudprovider.InstanceNotFound if nodeName does not belong to any scale set. -func (ss *ScaleSet) getVmssVM(nodeName string, crt azcache.AzureCacheReadType) (string, string, *compute.VirtualMachineScaleSetVM, error) { +func (ss *ScaleSet) getVmssVM(nodeName string, crt azcache.AzureCacheReadType) (*virtualmachine.VirtualMachine, error) { node, err := ss.getNodeIdentityByNodeName(nodeName, crt) if err != nil { - return "", "", nil, err + return nil, err } return ss.getVmssVMByNodeIdentity(node, crt) @@ -236,17 +242,20 @@ func (ss *ScaleSet) GetPowerStatusByNodeName(name string) (powerState string, er return ss.availabilitySet.GetPowerStatusByNodeName(name) } - _, _, vm, err := ss.getVmssVM(name, azcache.CacheReadTypeDefault) + vm, err := ss.getVmssVM(name, azcache.CacheReadTypeDefault) if err != nil { return powerState, err } - if vm.InstanceView != nil && vm.InstanceView.Statuses != nil { - statuses := *vm.InstanceView.Statuses - for _, status := range statuses { - state := to.String(status.Code) - if strings.HasPrefix(state, vmPowerStatePrefix) { - return strings.TrimPrefix(state, vmPowerStatePrefix), nil + if vm.IsVirtualMachineScaleSetVM() { + v := vm.AsVirtualMachineScaleSetVM() + if v.InstanceView != nil && v.InstanceView.Statuses != nil { + statuses := *v.InstanceView.Statuses + for _, status := range statuses { + state := to.String(status.Code) + if strings.HasPrefix(state, vmPowerStatePrefix) { + return strings.TrimPrefix(state, vmPowerStatePrefix), nil + } } } } @@ -268,7 +277,7 @@ func (ss *ScaleSet) GetProvisioningStateByNodeName(name string) (provisioningSta return ss.availabilitySet.GetProvisioningStateByNodeName(name) } - _, _, vm, err := ss.getVmssVM(name, azcache.CacheReadTypeDefault) + vm, err := ss.getVmssVM(name, azcache.CacheReadTypeDefault) if err != nil { return provisioningState, err } @@ -353,13 +362,13 @@ func (ss *ScaleSet) GetInstanceIDByNodeName(name string) (string, error) { return ss.availabilitySet.GetInstanceIDByNodeName(name) } - _, _, vm, err := ss.getVmssVM(name, azcache.CacheReadTypeUnsafe) + vm, err := ss.getVmssVM(name, azcache.CacheReadTypeUnsafe) if err != nil { klog.Errorf("Unable to find node %s: %v", name, err) return "", err } - resourceID := *vm.ID + resourceID := vm.ID convertedResourceID, err := convertResourceGroupNameToLower(resourceID) if err != nil { klog.Errorf("convertResourceGroupNameToLower failed with error: %v", err) @@ -427,13 +436,16 @@ func (ss *ScaleSet) GetInstanceTypeByNodeName(name string) (string, error) { return ss.availabilitySet.GetInstanceTypeByNodeName(name) } - _, _, vm, err := ss.getVmssVM(name, azcache.CacheReadTypeUnsafe) + vm, err := ss.getVmssVM(name, azcache.CacheReadTypeUnsafe) if err != nil { return "", err } - if vm.Sku != nil && vm.Sku.Name != nil { - return *vm.Sku.Name, nil + if vm.IsVirtualMachineScaleSetVM() { + v := vm.AsVirtualMachineScaleSetVM() + if v.Sku != nil && v.Sku.Name != nil { + return *v.Sku.Name, nil + } } return "", nil @@ -452,24 +464,26 @@ func (ss *ScaleSet) GetZoneByNodeName(name string) (cloudprovider.Zone, error) { return ss.availabilitySet.GetZoneByNodeName(name) } - _, _, vm, err := ss.getVmssVM(name, azcache.CacheReadTypeUnsafe) + vm, err := ss.getVmssVM(name, azcache.CacheReadTypeUnsafe) if err != nil { return cloudprovider.Zone{}, err } var failureDomain string - if vm.Zones != nil && len(*vm.Zones) > 0 { + if vm.Zones != nil && len(vm.Zones) > 0 { // Get availability zone for the node. - zones := *vm.Zones + zones := vm.Zones zoneID, err := strconv.Atoi(zones[0]) if err != nil { return cloudprovider.Zone{}, fmt.Errorf("failed to parse zone %q: %w", zones, err) } - failureDomain = ss.makeZone(to.String(vm.Location), zoneID) - } else if vm.InstanceView != nil && vm.InstanceView.PlatformFaultDomain != nil { + failureDomain = ss.makeZone(vm.Location, zoneID) + } else if vm.IsVirtualMachineScaleSetVM() && + vm.AsVirtualMachineScaleSetVM().InstanceView != nil && + vm.AsVirtualMachineScaleSetVM().InstanceView.PlatformFaultDomain != nil { // Availability zone is not used for the node, falling back to fault domain. - failureDomain = strconv.Itoa(int(*vm.InstanceView.PlatformFaultDomain)) + failureDomain = strconv.Itoa(int(*vm.AsVirtualMachineScaleSetVM().InstanceView.PlatformFaultDomain)) } else { err = fmt.Errorf("failed to get zone info") klog.Errorf("GetZoneByNodeName: got unexpected error %v", err) @@ -479,7 +493,7 @@ func (ss *ScaleSet) GetZoneByNodeName(name string) (cloudprovider.Zone, error) { return cloudprovider.Zone{ FailureDomain: strings.ToLower(failureDomain), - Region: strings.ToLower(to.String(vm.Location)), + Region: strings.ToLower(vm.Location), }, nil } @@ -574,7 +588,8 @@ func (ss *ScaleSet) GetPrivateIPsByNodeName(nodeName string) ([]string, error) { } // This returns the full identifier of the primary NIC for the given VM. -func (ss *ScaleSet) getPrimaryInterfaceID(machine compute.VirtualMachineScaleSetVM) (string, error) { +func (ss *ScaleSet) getPrimaryInterfaceID(vm *virtualmachine.VirtualMachine) (string, error) { + machine := vm.AsVirtualMachineScaleSetVM() if machine.NetworkProfile == nil || machine.NetworkProfile.NetworkInterfaces == nil { return "", fmt.Errorf("failed to find the network interfaces for vm %s", to.String(machine.Name)) } @@ -706,6 +721,7 @@ func (ss *ScaleSet) getNodeIdentityByNodeName(nodeName string, crt azcache.Azure return node, nil } + // FIXME(ccc): check only if vmss is uniform. if _, err := getScaleSetVMInstanceID(nodeName); err != nil { return nil, err } @@ -766,17 +782,17 @@ func (ss *ScaleSet) getAgentPoolScaleSets(nodes []*v1.Node) (*[]string, error) { continue } - ssName, _, _, err := ss.getVmssVM(nodeName, azcache.CacheReadTypeDefault) + vm, err := ss.getVmssVM(nodeName, azcache.CacheReadTypeDefault) if err != nil { return nil, err } - if ssName == "" { + if vm.VMSSName == "" { klog.V(3).Infof("Node %q is not belonging to any known scale sets", nodeName) continue } - *agentPoolScaleSets = append(*agentPoolScaleSets, ssName) + *agentPoolScaleSets = append(*agentPoolScaleSets, vm.VMSSName) } return agentPoolScaleSets, nil @@ -846,7 +862,7 @@ func (ss *ScaleSet) GetPrimaryInterface(nodeName string) (network.Interface, err return ss.availabilitySet.GetPrimaryInterface(nodeName) } - ssName, instanceID, vm, err := ss.getVmssVM(nodeName, azcache.CacheReadTypeDefault) + vm, err := ss.getVmssVM(nodeName, azcache.CacheReadTypeDefault) if err != nil { // VM is availability set, but not cached yet in availabilitySetNodesCache. if errors.Is(err, ErrorNotVmssInstance) { @@ -857,7 +873,7 @@ func (ss *ScaleSet) GetPrimaryInterface(nodeName string) (network.Interface, err return network.Interface{}, err } - primaryInterfaceID, err := ss.getPrimaryInterfaceID(*vm) + primaryInterfaceID, err := ss.getPrimaryInterfaceID(vm) if err != nil { klog.Errorf("error: ss.GetPrimaryInterface(%s), ss.getPrimaryInterfaceID(), err=%v", nodeName, err) return network.Interface{}, err @@ -875,11 +891,13 @@ func (ss *ScaleSet) GetPrimaryInterface(nodeName string) (network.Interface, err ctx, cancel := getContextWithCancel() defer cancel() - nic, rerr := ss.InterfacesClient.GetVirtualMachineScaleSetNetworkInterface(ctx, resourceGroup, ssName, instanceID, nicName, "") + nic, rerr := ss.InterfacesClient.GetVirtualMachineScaleSetNetworkInterface(ctx, resourceGroup, vm.VMSSName, + vm.InstanceID, + nicName, "") if rerr != nil { exists, realErr := checkResourceExistsFromError(rerr) if realErr != nil { - klog.Errorf("error: ss.GetPrimaryInterface(%s), ss.GetVirtualMachineScaleSetNetworkInterface.Get(%s, %s, %s), err=%v", nodeName, resourceGroup, ssName, nicName, realErr) + klog.Errorf("error: ss.GetPrimaryInterface(%s), ss.GetVirtualMachineScaleSetNetworkInterface.Get(%s, %s, %s), err=%v", nodeName, resourceGroup, vm.VMSSName, nicName, realErr) return network.Interface{}, realErr.Error() } @@ -891,7 +909,7 @@ func (ss *ScaleSet) GetPrimaryInterface(nodeName string) (network.Interface, err // Fix interface's location, which is required when updating the interface. // TODO: is this a bug of azure SDK? if nic.Location == nil || *nic.Location == "" { - nic.Location = vm.Location + nic.Location = &vm.Location } return nic, nil @@ -968,7 +986,7 @@ func (ss *ScaleSet) getConfigForScaleSetByIPFamily(config *compute.VirtualMachin // participating in the specified LoadBalancer Backend Pool, which returns (resourceGroup, vmasName, instanceID, vmssVM, error). func (ss *ScaleSet) EnsureHostInPool(service *v1.Service, nodeName types.NodeName, backendPoolID string, vmSetNameOfLB string) (string, string, string, *compute.VirtualMachineScaleSetVM, error) { vmName := mapNodeNameToVMName(nodeName) - ssName, instanceID, vm, err := ss.getVmssVM(vmName, azcache.CacheReadTypeDefault) + vm, err := ss.getVmssVM(vmName, azcache.CacheReadTypeDefault) if err != nil { if errors.Is(err, cloudprovider.InstanceNotFound) { klog.Infof("EnsureHostInPool: skipping node %s because it is not found", vmName) @@ -979,7 +997,7 @@ func (ss *ScaleSet) EnsureHostInPool(service *v1.Service, nodeName types.NodeNam return "", "", "", nil, err } - klog.V(2).Infof("ensuring node %q of scaleset %q in LB backendpool %q", nodeName, ssName, backendPoolID) + klog.V(2).Infof("ensuring node %q of scaleset %q in LB backendpool %q", nodeName, vm.VMSSName, backendPoolID) // Check scale set name: // - For basic SKU load balancer, return nil if the node's scale set is mismatched with vmSetNameOfLB. @@ -993,19 +1011,29 @@ func (ss *ScaleSet) EnsureHostInPool(service *v1.Service, nodeName types.NodeNam } else if ss.EnableMultipleStandardLoadBalancers { // need to check the vmSet name when using multiple standard LBs needCheck = true + + // ensure the vm that is supposed to share the primary SLB in the backendpool of the primary SLB + if strings.EqualFold(ss.GetPrimaryVMSetName(), vmSetNameOfLB) && + ss.getVMSetNamesSharingPrimarySLB().Has(strings.ToLower(vm.VMSSName)) { + klog.V(4).Infof("EnsureHostInPool: the vm %s in the vmSet %s is supposed to share the primary SLB", + nodeName, vm.VMSSName) + needCheck = false + } } - if vmSetNameOfLB != "" && needCheck && !strings.EqualFold(vmSetNameOfLB, ssName) { + + if vmSetNameOfLB != "" && needCheck && !strings.EqualFold(vmSetNameOfLB, vm.VMSSName) { klog.V(3).Infof("EnsureHostInPool skips node %s because it is not in the ScaleSet %s", vmName, vmSetNameOfLB) return "", "", "", nil, nil } // Find primary network interface configuration. - if vm.NetworkProfileConfiguration.NetworkInterfaceConfigurations == nil { - klog.V(4).Infof("EnsureHostInPool: cannot obtain the primary network interface configuration, of vm %s, probably because the vm's being deleted", vmName) + if vm.VirtualMachineScaleSetVMProperties.NetworkProfileConfiguration.NetworkInterfaceConfigurations == nil { + klog.V(4).Infof("EnsureHostInPool: cannot obtain the primary network interface configuration, of vm %s, "+ + "probably because the vm's being deleted", vmName) return "", "", "", nil, nil } - networkInterfaceConfigurations := *vm.NetworkProfileConfiguration.NetworkInterfaceConfigurations + networkInterfaceConfigurations := *vm.VirtualMachineScaleSetVMProperties.NetworkProfileConfiguration.NetworkInterfaceConfigurations primaryNetworkInterfaceConfiguration, err := ss.getPrimaryNetworkInterfaceConfiguration(networkInterfaceConfigurations, vmName) if err != nil { return "", "", "", nil, err @@ -1076,9 +1104,9 @@ func (ss *ScaleSet) EnsureHostInPool(service *v1.Service, nodeName types.NodeNam }) primaryIPConfiguration.LoadBalancerBackendAddressPools = &newBackendPools newVM := &compute.VirtualMachineScaleSetVM{ - Location: vm.Location, + Location: &vm.Location, VirtualMachineScaleSetVMProperties: &compute.VirtualMachineScaleSetVMProperties{ - HardwareProfile: vm.HardwareProfile, + HardwareProfile: vm.VirtualMachineScaleSetVMProperties.HardwareProfile, NetworkProfileConfiguration: &compute.VirtualMachineScaleSetVMNetworkProfileConfiguration{ NetworkInterfaceConfigurations: &networkInterfaceConfigurations, }, @@ -1091,7 +1119,7 @@ func (ss *ScaleSet) EnsureHostInPool(service *v1.Service, nodeName types.NodeNam return "", "", "", nil, err } - return nodeResourceGroup, ssName, instanceID, newVM, nil + return nodeResourceGroup, vm.VMSSName, vm.InstanceID, newVM, nil } func getVmssAndResourceGroupNameByVMProviderID(providerID string) (string, string, error) { @@ -1363,7 +1391,7 @@ func (ss *ScaleSet) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, bac // ensureBackendPoolDeletedFromNode ensures the loadBalancer backendAddressPools deleted // from the specified node, which returns (resourceGroup, vmasName, instanceID, vmssVM, error). func (ss *ScaleSet) ensureBackendPoolDeletedFromNode(nodeName, backendPoolID string) (string, string, string, *compute.VirtualMachineScaleSetVM, error) { - ssName, instanceID, vm, err := ss.getVmssVM(nodeName, azcache.CacheReadTypeDefault) + vm, err := ss.getVmssVM(nodeName, azcache.CacheReadTypeDefault) if err != nil { if errors.Is(err, cloudprovider.InstanceNotFound) { klog.Infof("ensureBackendPoolDeletedFromNode: skipping node %s because it is not found", nodeName) @@ -1374,11 +1402,12 @@ func (ss *ScaleSet) ensureBackendPoolDeletedFromNode(nodeName, backendPoolID str } // Find primary network interface configuration. - if vm.NetworkProfileConfiguration.NetworkInterfaceConfigurations == nil { - klog.V(4).Infof("EnsureHostInPool: cannot obtain the primary network interface configuration, of vm %s, probably because the vm's being deleted", nodeName) + if vm.VirtualMachineScaleSetVMProperties.NetworkProfileConfiguration.NetworkInterfaceConfigurations == nil { + klog.V(4).Infof("EnsureHostInPool: cannot obtain the primary network interface configuration, of vm %s, "+ + "probably because the vm's being deleted", nodeName) return "", "", "", nil, nil } - networkInterfaceConfigurations := *vm.NetworkProfileConfiguration.NetworkInterfaceConfigurations + networkInterfaceConfigurations := *vm.VirtualMachineScaleSetVMProperties.NetworkProfileConfiguration.NetworkInterfaceConfigurations primaryNetworkInterfaceConfiguration, err := ss.getPrimaryNetworkInterfaceConfiguration(networkInterfaceConfigurations, nodeName) if err != nil { return "", "", "", nil, err @@ -1414,9 +1443,9 @@ func (ss *ScaleSet) ensureBackendPoolDeletedFromNode(nodeName, backendPoolID str // Compose a new vmssVM with added backendPoolID. primaryIPConfiguration.LoadBalancerBackendAddressPools = &newBackendPools newVM := &compute.VirtualMachineScaleSetVM{ - Location: vm.Location, + Location: &vm.Location, VirtualMachineScaleSetVMProperties: &compute.VirtualMachineScaleSetVMProperties{ - HardwareProfile: vm.HardwareProfile, + HardwareProfile: vm.VirtualMachineScaleSetVMProperties.HardwareProfile, NetworkProfileConfiguration: &compute.VirtualMachineScaleSetVMNetworkProfileConfiguration{ NetworkInterfaceConfigurations: &networkInterfaceConfigurations, }, @@ -1429,7 +1458,7 @@ func (ss *ScaleSet) ensureBackendPoolDeletedFromNode(nodeName, backendPoolID str return "", "", "", nil, err } - return nodeResourceGroup, ssName, instanceID, newVM, nil + return nodeResourceGroup, vm.VMSSName, vm.InstanceID, newVM, nil } // GetNodeNameByIPConfigurationID gets the node name and the VMSS name by IP configuration ID. @@ -1545,7 +1574,8 @@ func (ss *ScaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, } if errors.Is(err, cloudprovider.InstanceNotFound) { - klog.Infof("EnsureBackendPoolDeleted(%s): skipping ip config %s because the corresponding vmss vm is not found", getServiceName(service), ipConfigurationID) + klog.Infof("EnsureBackendPoolDeleted(%s): skipping ip config %s because the corresponding vmss vm is not"+ + " found", getServiceName(service), ipConfigurationID) continue } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_wrap.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_wrap.go index ad73f398dd66..6f82d0c128db 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_wrap.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_wrap.go @@ -24,7 +24,7 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-07-01/compute" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-02-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" "github.com/Azure/go-autorest/autorest/to" "k8s.io/apimachinery/pkg/types" @@ -42,6 +42,7 @@ var ( nsgCacheTTLDefaultInSeconds = 120 routeTableCacheTTLDefaultInSeconds = 120 publicIPCacheTTLDefaultInSeconds = 120 + plsCacheTTLDefaultInSeconds = 120 azureNodeProviderIDRE = regexp.MustCompile(`^azure:///subscriptions/(?:.*)/resourceGroups/(?:.*)/providers/Microsoft.Compute/(?:.*)`) azureResourceGroupNameRE = regexp.MustCompile(`.*/subscriptions/(?:.*)/resourceGroups/(.+)/providers/(?:.*)`) @@ -175,6 +176,14 @@ func (az *Cloud) getSecurityGroup(crt azcache.AzureCacheReadType) (network.Secur return *(securityGroup.(*network.SecurityGroup)), nil } +func (az *Cloud) getPrivateLinkService(frontendIPConfigID *string, crt azcache.AzureCacheReadType) (pls network.PrivateLinkService, err error) { + cachedPLS, err := az.plsCache.Get(*frontendIPConfigID, crt) + if err != nil { + return pls, err + } + return *(cachedPLS.(*network.PrivateLinkService)), nil +} + func (az *Cloud) newVMCache() (*azcache.TimedCache, error) { getter := func(key string) (interface{}, error) { // Currently InstanceView request are used by azure_zones, while the calls come after non-InstanceView @@ -321,6 +330,47 @@ func (az *Cloud) newPIPCache() (*azcache.TimedCache, error) { return azcache.NewTimedcache(time.Duration(az.PublicIPCacheTTLInSeconds)*time.Second, getter) } +func (az *Cloud) newPLSCache() (*azcache.TimedCache, error) { + // for PLS cache, key is LBFrontendIPConfiguration ID + getter := func(key string) (interface{}, error) { + ctx, cancel := getContextWithCancel() + defer cancel() + plsList, err := az.PrivateLinkServiceClient.List(ctx, az.PrivateLinkServiceResourceGroup) + exists, rerr := checkResourceExistsFromError(err) + if rerr != nil { + return nil, rerr.Error() + } + + if exists { + for i := range plsList { + pls := plsList[i] + if pls.PrivateLinkServiceProperties == nil { + continue + } + fipConfigs := pls.PrivateLinkServiceProperties.LoadBalancerFrontendIPConfigurations + if fipConfigs == nil { + continue + } + for _, fipConfig := range *fipConfigs { + if strings.EqualFold(*fipConfig.ID, key) { + return &pls, nil + } + } + + } + } + + klog.V(2).Infof("No privateLinkService found for frontendIPConfig %q", key) + plsNotExistID := consts.PrivateLinkServiceNotExistID + return &network.PrivateLinkService{ID: &plsNotExistID}, nil + } + + if az.PlsCacheTTLInSeconds == 0 { + az.PlsCacheTTLInSeconds = plsCacheTTLDefaultInSeconds + } + return azcache.NewTimedcache(time.Duration(az.PlsCacheTTLInSeconds)*time.Second, getter) +} + func (az *Cloud) useStandardLoadBalancer() bool { return strings.EqualFold(az.LoadBalancerSku, consts.LoadBalancerSkuStandard) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/virtualmachine/virtualmachine.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/virtualmachine/virtualmachine.go new file mode 100644 index 000000000000..fc028ff790be --- /dev/null +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/virtualmachine/virtualmachine.go @@ -0,0 +1,146 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package virtualmachine + +import ( + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-07-01/compute" + "github.com/Azure/go-autorest/autorest/to" +) + +type Variant string + +const ( + VariantVirtualMachine Variant = "VirtualMachine" + VariantVirtualMachineScaleSetVM Variant = "VirtualMachineScaleSetVM" +) + +type Manage string + +const ( + VMSS Manage = "vmss" + VMAS Manage = "vmas" +) + +type ManageOption = func(*VirtualMachine) + +// ByVMSS specifies that the virtual machine is managed by a virtual machine scale set. +func ByVMSS(vmssName string) ManageOption { + return func(vm *VirtualMachine) { + vm.Manage = VMSS + vm.VMSSName = vmssName + } +} + +type VirtualMachine struct { + Variant Variant + vm *compute.VirtualMachine + vmssVM *compute.VirtualMachineScaleSetVM + + Manage Manage + VMSSName string + + // re-export fields + // common fields + ID string + Name string + Location string + Tags map[string]string + Zones []string + Type string + Plan *compute.Plan + Resources *[]compute.VirtualMachineExtension + + // fields of VirtualMachine + Identity *compute.VirtualMachineIdentity + VirtualMachineProperties *compute.VirtualMachineProperties + + // fields of VirtualMachineScaleSetVM + InstanceID string + SKU *compute.Sku + VirtualMachineScaleSetVMProperties *compute.VirtualMachineScaleSetVMProperties +} + +func FromVirtualMachine(vm *compute.VirtualMachine, opt ...ManageOption) *VirtualMachine { + v := &VirtualMachine{ + vm: vm, + Variant: VariantVirtualMachine, + + ID: to.String(vm.ID), + Name: to.String(vm.Name), + Type: to.String(vm.Type), + Location: to.String(vm.Location), + Tags: to.StringMap(vm.Tags), + Zones: to.StringSlice(vm.Zones), + Plan: vm.Plan, + Resources: vm.Resources, + + Identity: vm.Identity, + VirtualMachineProperties: vm.VirtualMachineProperties, + } + + for _, opt := range opt { + opt(v) + } + + return v +} + +func FromVirtualMachineScaleSetVM(vm *compute.VirtualMachineScaleSetVM, opt ManageOption) *VirtualMachine { + v := &VirtualMachine{ + Variant: VariantVirtualMachineScaleSetVM, + vmssVM: vm, + + ID: to.String(vm.ID), + Name: to.String(vm.Name), + Type: to.String(vm.Type), + Location: to.String(vm.Location), + Tags: to.StringMap(vm.Tags), + Zones: to.StringSlice(vm.Zones), + Plan: vm.Plan, + Resources: vm.Resources, + + SKU: vm.Sku, + InstanceID: to.String(vm.InstanceID), + VirtualMachineScaleSetVMProperties: vm.VirtualMachineScaleSetVMProperties, + } + + // TODO: should validate manage option + // VirtualMachineScaleSetVM should always be managed by VMSS + opt(v) + + return v +} + +func (vm *VirtualMachine) IsVirtualMachine() bool { + return vm.Variant == VariantVirtualMachine +} + +func (vm *VirtualMachine) IsVirtualMachineScaleSetVM() bool { + return vm.Variant == VariantVirtualMachineScaleSetVM +} + +func (vm *VirtualMachine) ManagedByVMSS() bool { + return vm.Manage == VMSS +} + +func (vm *VirtualMachine) AsVirtualMachine() *compute.VirtualMachine { + return vm.vm +} + +func (vm *VirtualMachine) AsVirtualMachineScaleSetVM() *compute.VirtualMachineScaleSetVM { + return vm.vmssVM +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/retry/azure_retry.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/retry/azure_retry.go index 903782c5074a..c2238b5e97e6 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/retry/azure_retry.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/retry/azure_retry.go @@ -17,6 +17,7 @@ limitations under the License. package retry import ( + "html" "math/rand" "net/http" "strings" @@ -185,7 +186,7 @@ func doBackoffRetry(s autorest.Sender, r *http.Request, backoff Backoff) (resp * return resp, rerr.RawError } - klog.V(3).Infof("Backoff retrying %s %q with error %v", r.Method, r.URL.String(), rerr) + klog.V(3).Infof("Backoff retrying %s %q with error %v", r.Method, html.EscapeString(r.URL.String()), rerr) } return resp, err