From d850f561f27733b66fab068d57bdaee3472fde66 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:04:02 +0000 Subject: [PATCH] build(deps): bump sigs.k8s.io/cloud-provider-azure/pkg/azclient (#7782) Bumps the all group with 1 update: [sigs.k8s.io/cloud-provider-azure/pkg/azclient](https://github.com/kubernetes-sigs/cloud-provider-azure). Updates `sigs.k8s.io/cloud-provider-azure/pkg/azclient` from 0.2.5 to 0.2.7 - [Release notes](https://github.com/kubernetes-sigs/cloud-provider-azure/releases) - [Changelog](https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/docs/release-versioning.md) - [Commits](https://github.com/kubernetes-sigs/cloud-provider-azure/compare/pkg/azclient/v0.2.5...pkg/azclient/v0.2.7) --- updated-dependencies: - dependency-name: sigs.k8s.io/cloud-provider-azure/pkg/azclient dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 +- vendor/modules.txt | 4 +- .../pkg/azclient/Makefile | 1 + .../backendaddresspoolclient/interface.go | 32 +++ .../interface_gomock.go | 25 ++ .../interface.go | 216 ++++++++++++++++++ .../zz_generated_client.go | 120 ++++++++++ .../pkg/azclient/factory.go | 2 + .../pkg/azclient/factory_gen.go | 33 +++ .../pkg/azclient/mock_azclient/interface.go | 15 ++ .../publicipaddressclient/interface.go | 3 + .../mock_publicipaddressclient/interface.go | 39 ++++ 13 files changed, 492 insertions(+), 4 deletions(-) create mode 100644 vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/interface.go create mode 100644 vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/interface_gomock.go create mode 100644 vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/mock_backendaddresspoolclient/interface.go create mode 100644 vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/zz_generated_client.go diff --git a/go.mod b/go.mod index 73e3e0f0f7..b919d7d5a1 100644 --- a/go.mod +++ b/go.mod @@ -53,7 +53,7 @@ require ( k8s.io/klog/v2 v2.130.1 k8s.io/kubelet v0.30.7 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 - sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.2.5 + sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.2.7 sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader v0.1.8 sigs.k8s.io/yaml v1.4.0 ) diff --git a/go.sum b/go.sum index 330b95d327..ee05468a5b 100644 --- a/go.sum +++ b/go.sum @@ -454,8 +454,8 @@ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 h1:/U5vjBbQn3RChhv7P11uhYvCSm5G2GaIi5AIGBS6r4c= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0/go.mod h1:z7+wmGM2dfIiLRfrC6jb5kV2Mq/sK1ZP303cxzkV5Y4= -sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.2.5 h1:9zIJ4kZcR0iRg424y7LFy0Wc7LcpLOdObQWy3aMhZ5Q= -sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.2.5/go.mod h1:i/hFmBZ8SSJxneGtIfWKU3HTzqumpOU0WjJVeaWupUs= +sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.2.7 h1:dgpy4qVuTsrgtjg0ZHcXll8DUe/aYTNBY01CpqG7qQ0= +sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.2.7/go.mod h1:i/hFmBZ8SSJxneGtIfWKU3HTzqumpOU0WjJVeaWupUs= sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader v0.1.8 h1:fwg1J+nRRXkcA0lIJ/a4fJPg7tNggRH1pPOukthuAGw= sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader v0.1.8/go.mod h1:kUW9qMqi412c5+nXdYA00oSudWC9nVUCM4v1k3HtgZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/vendor/modules.txt b/vendor/modules.txt index f0d699070f..ad4dccfef9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1507,7 +1507,7 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/common/metrics sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client -# sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.2.5 +# sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.2.7 ## explicit; go 1.23.1 sigs.k8s.io/cloud-provider-azure/pkg/azclient sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient @@ -1515,6 +1515,8 @@ sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient/mock_accountclient sigs.k8s.io/cloud-provider-azure/pkg/azclient/armauth sigs.k8s.io/cloud-provider-azure/pkg/azclient/availabilitysetclient sigs.k8s.io/cloud-provider-azure/pkg/azclient/availabilitysetclient/mock_availabilitysetclient +sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient +sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/mock_backendaddresspoolclient sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient/mock_blobcontainerclient sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/Makefile b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/Makefile index 5b19682d4c..e10a44c897 100644 --- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/Makefile +++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/Makefile @@ -91,6 +91,7 @@ generatecode: build ## Generate client $(TYPESCAFFOLD) --package github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6 --package-alias armnetwork --resource VirtualNetwork --client-name VirtualNetworksClient --verbs get,createorupdate,delete,list --expand $(TYPESCAFFOLD) --package github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6 --package-alias armnetwork --resource Interface --client-name InterfacesClient --verbs get,createorupdate,delete,list --expand --ratelimitkey interfaceRateLimit $(TYPESCAFFOLD) --package github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6 --package-alias armnetwork --resource LoadBalancer --client-name LoadBalancersClient --verbs get,createorupdate,delete,list --expand --ratelimitkey loadBalancerRateLimit + $(TYPESCAFFOLD) --package github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6 --package-alias armnetwork --resource LoadBalancer --subresource BackendAddressPool --client-name LoadBalancerBackendAddressPoolsClient --verbs get,createorupdate,delete,list --ratelimitkey loadBalancerRateLimit $(TYPESCAFFOLD) --package github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6 --package-alias armnetwork --resource PrivateEndpoint --client-name PrivateEndpointsClient --verbs get,createorupdate --expand --ratelimitkey privateEndpointRateLimit $(TYPESCAFFOLD) --package github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6 --package-alias armnetwork --resource PrivateEndpoint --subresource PrivateDNSZoneGroup --client-name PrivateDNSZoneGroupsClient --verbs get,createorupdate,delete $(TYPESCAFFOLD) --package github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6 --package-alias armnetwork --resource PublicIPAddress --client-name PublicIPAddressesClient --verbs get,createorupdate,delete,list --expand --ratelimitkey publicIPAddressRateLimit diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/interface.go new file mode 100644 index 0000000000..63b2ebf918 --- /dev/null +++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/interface.go @@ -0,0 +1,32 @@ +/* +Copyright 2024 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. +*/ + +// +azure:enableclientgen:=true +package backendaddresspoolclient + +import ( + armnetwork "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + + "sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils" +) + +// +azure:client:verbs=get;createorupdate;delete;list,resource=LoadBalancer,subResource=BackendAddressPool,packageName=github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6,packageAlias=armnetwork,clientName=LoadBalancerBackendAddressPoolsClient,rateLimitKey=loadBalancerRateLimit +type Interface interface { + utils.SubResourceGetFunc[armnetwork.BackendAddressPool] + utils.SubResourceCreateOrUpdateFunc[armnetwork.BackendAddressPool] + utils.SubResourceDeleteFunc[armnetwork.BackendAddressPool] + utils.SubResourceListFunc[armnetwork.BackendAddressPool] +} diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/interface_gomock.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/interface_gomock.go new file mode 100644 index 0000000000..ba6953f02a --- /dev/null +++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/interface_gomock.go @@ -0,0 +1,25 @@ +// /* +// 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 client-gen. DO NOT EDIT. +package backendaddresspoolclient + +import ( + "sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/mock_backendaddresspoolclient" +) + +// Code generated by MockGen. DO NOT EDIT. +var _ Interface = &mock_backendaddresspoolclient.MockInterface{} diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/mock_backendaddresspoolclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/mock_backendaddresspoolclient/interface.go new file mode 100644 index 0000000000..45e95dbfca --- /dev/null +++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/mock_backendaddresspoolclient/interface.go @@ -0,0 +1,216 @@ +// /* +// 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: backendaddresspoolclient/interface.go +// +// Generated by this command: +// +// mockgen -package mock_backendaddresspoolclient -source backendaddresspoolclient/interface.go -typed -write_generate_directive -copyright_file ../../hack/boilerplate/boilerplate.generatego.txt +// + +// Package mock_backendaddresspoolclient is a generated GoMock package. +package mock_backendaddresspoolclient + +import ( + context "context" + reflect "reflect" + + armnetwork "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + gomock "go.uber.org/mock/gomock" +) + +//go:generate mockgen -package mock_backendaddresspoolclient -source backendaddresspoolclient/interface.go -typed -write_generate_directive -copyright_file ../../hack/boilerplate/boilerplate.generatego.txt + +// MockInterface is a mock of Interface interface. +type MockInterface struct { + ctrl *gomock.Controller + recorder *MockInterfaceMockRecorder + isgomock struct{} +} + +// 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, parentResourceName, resourceName string, resourceParam armnetwork.BackendAddressPool) (*armnetwork.BackendAddressPool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateOrUpdate", ctx, resourceGroupName, parentResourceName, resourceName, resourceParam) + ret0, _ := ret[0].(*armnetwork.BackendAddressPool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateOrUpdate indicates an expected call of CreateOrUpdate. +func (mr *MockInterfaceMockRecorder) CreateOrUpdate(ctx, resourceGroupName, parentResourceName, resourceName, resourceParam any) *MockInterfaceCreateOrUpdateCall { + mr.mock.ctrl.T.Helper() + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdate", reflect.TypeOf((*MockInterface)(nil).CreateOrUpdate), ctx, resourceGroupName, parentResourceName, resourceName, resourceParam) + return &MockInterfaceCreateOrUpdateCall{Call: call} +} + +// MockInterfaceCreateOrUpdateCall wrap *gomock.Call +type MockInterfaceCreateOrUpdateCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfaceCreateOrUpdateCall) Return(arg0 *armnetwork.BackendAddressPool, arg1 error) *MockInterfaceCreateOrUpdateCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfaceCreateOrUpdateCall) Do(f func(context.Context, string, string, string, armnetwork.BackendAddressPool) (*armnetwork.BackendAddressPool, error)) *MockInterfaceCreateOrUpdateCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfaceCreateOrUpdateCall) DoAndReturn(f func(context.Context, string, string, string, armnetwork.BackendAddressPool) (*armnetwork.BackendAddressPool, error)) *MockInterfaceCreateOrUpdateCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + +// Delete mocks base method. +func (m *MockInterface) Delete(ctx context.Context, resourceGroupName, parentResourceName, resourceName string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Delete", ctx, resourceGroupName, parentResourceName, resourceName) + ret0, _ := ret[0].(error) + return ret0 +} + +// Delete indicates an expected call of Delete. +func (mr *MockInterfaceMockRecorder) Delete(ctx, resourceGroupName, parentResourceName, resourceName any) *MockInterfaceDeleteCall { + mr.mock.ctrl.T.Helper() + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockInterface)(nil).Delete), ctx, resourceGroupName, parentResourceName, resourceName) + return &MockInterfaceDeleteCall{Call: call} +} + +// MockInterfaceDeleteCall wrap *gomock.Call +type MockInterfaceDeleteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfaceDeleteCall) Return(arg0 error) *MockInterfaceDeleteCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfaceDeleteCall) Do(f func(context.Context, string, string, string) error) *MockInterfaceDeleteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfaceDeleteCall) DoAndReturn(f func(context.Context, string, string, string) error) *MockInterfaceDeleteCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + +// Get mocks base method. +func (m *MockInterface) Get(ctx context.Context, resourceGroupName, parentResourceName, resourceName string) (*armnetwork.BackendAddressPool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Get", ctx, resourceGroupName, parentResourceName, resourceName) + ret0, _ := ret[0].(*armnetwork.BackendAddressPool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Get indicates an expected call of Get. +func (mr *MockInterfaceMockRecorder) Get(ctx, resourceGroupName, parentResourceName, resourceName any) *MockInterfaceGetCall { + mr.mock.ctrl.T.Helper() + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockInterface)(nil).Get), ctx, resourceGroupName, parentResourceName, resourceName) + return &MockInterfaceGetCall{Call: call} +} + +// MockInterfaceGetCall wrap *gomock.Call +type MockInterfaceGetCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfaceGetCall) Return(result *armnetwork.BackendAddressPool, rerr error) *MockInterfaceGetCall { + c.Call = c.Call.Return(result, rerr) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfaceGetCall) Do(f func(context.Context, string, string, string) (*armnetwork.BackendAddressPool, error)) *MockInterfaceGetCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfaceGetCall) DoAndReturn(f func(context.Context, string, string, string) (*armnetwork.BackendAddressPool, error)) *MockInterfaceGetCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + +// List mocks base method. +func (m *MockInterface) List(ctx context.Context, resourceGroupName, parentResourceName string) ([]*armnetwork.BackendAddressPool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "List", ctx, resourceGroupName, parentResourceName) + ret0, _ := ret[0].([]*armnetwork.BackendAddressPool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// List indicates an expected call of List. +func (mr *MockInterfaceMockRecorder) List(ctx, resourceGroupName, parentResourceName any) *MockInterfaceListCall { + mr.mock.ctrl.T.Helper() + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockInterface)(nil).List), ctx, resourceGroupName, parentResourceName) + return &MockInterfaceListCall{Call: call} +} + +// MockInterfaceListCall wrap *gomock.Call +type MockInterfaceListCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfaceListCall) Return(result []*armnetwork.BackendAddressPool, rerr error) *MockInterfaceListCall { + c.Call = c.Call.Return(result, rerr) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfaceListCall) Do(f func(context.Context, string, string) ([]*armnetwork.BackendAddressPool, error)) *MockInterfaceListCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfaceListCall) DoAndReturn(f func(context.Context, string, string) ([]*armnetwork.BackendAddressPool, error)) *MockInterfaceListCall { + c.Call = c.Call.DoAndReturn(f) + return c +} diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/zz_generated_client.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/zz_generated_client.go new file mode 100644 index 0000000000..381eb87f0d --- /dev/null +++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient/zz_generated_client.go @@ -0,0 +1,120 @@ +// /* +// 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 client-gen. DO NOT EDIT. +package backendaddresspoolclient + +import ( + "context" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing" + armnetwork "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + + "sigs.k8s.io/cloud-provider-azure/pkg/azclient/metrics" + "sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils" +) + +type Client struct { + *armnetwork.LoadBalancerBackendAddressPoolsClient + subscriptionID string + tracer tracing.Tracer +} + +func New(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (Interface, error) { + if options == nil { + options = utils.GetDefaultOption() + } + tr := options.TracingProvider.NewTracer(utils.ModuleName, utils.ModuleVersion) + + client, err := armnetwork.NewLoadBalancerBackendAddressPoolsClient(subscriptionID, credential, options) + if err != nil { + return nil, err + } + return &Client{ + LoadBalancerBackendAddressPoolsClient: client, + subscriptionID: subscriptionID, + tracer: tr, + }, nil +} + +const GetOperationName = "LoadBalancerBackendAddressPoolsClient.Get" + +// Get gets the BackendAddressPool +func (client *Client) Get(ctx context.Context, resourceGroupName string, loadbalancerName string, backendaddresspoolName string) (result *armnetwork.BackendAddressPool, err error) { + + metricsCtx := metrics.BeginARMRequest(client.subscriptionID, resourceGroupName, "BackendAddressPool", "get") + defer func() { metricsCtx.Observe(ctx, err) }() + ctx, endSpan := runtime.StartSpan(ctx, GetOperationName, client.tracer, nil) + defer endSpan(err) + resp, err := client.LoadBalancerBackendAddressPoolsClient.Get(ctx, resourceGroupName, loadbalancerName, backendaddresspoolName, nil) + if err != nil { + return nil, err + } + //handle statuscode + return &resp.BackendAddressPool, nil +} + +const CreateOrUpdateOperationName = "LoadBalancerBackendAddressPoolsClient.Create" + +// CreateOrUpdate creates or updates a BackendAddressPool. +func (client *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, loadbalancerName string, backendaddresspoolName string, resource armnetwork.BackendAddressPool) (result *armnetwork.BackendAddressPool, err error) { + metricsCtx := metrics.BeginARMRequest(client.subscriptionID, resourceGroupName, "BackendAddressPool", "create_or_update") + defer func() { metricsCtx.Observe(ctx, err) }() + ctx, endSpan := runtime.StartSpan(ctx, CreateOrUpdateOperationName, client.tracer, nil) + defer endSpan(err) + resp, err := utils.NewPollerWrapper(client.LoadBalancerBackendAddressPoolsClient.BeginCreateOrUpdate(ctx, resourceGroupName, loadbalancerName, backendaddresspoolName, resource, nil)).WaitforPollerResp(ctx) + if err != nil { + return nil, err + } + if resp != nil { + return &resp.BackendAddressPool, nil + } + return nil, nil +} + +const DeleteOperationName = "LoadBalancerBackendAddressPoolsClient.Delete" + +// Delete deletes a BackendAddressPool by name. +func (client *Client) Delete(ctx context.Context, resourceGroupName string, loadbalancerName string, backendaddresspoolName string) (err error) { + metricsCtx := metrics.BeginARMRequest(client.subscriptionID, resourceGroupName, "BackendAddressPool", "delete") + defer func() { metricsCtx.Observe(ctx, err) }() + ctx, endSpan := runtime.StartSpan(ctx, DeleteOperationName, client.tracer, nil) + defer endSpan(err) + _, err = utils.NewPollerWrapper(client.BeginDelete(ctx, resourceGroupName, loadbalancerName, backendaddresspoolName, nil)).WaitforPollerResp(ctx) + return err +} + +const ListOperationName = "LoadBalancerBackendAddressPoolsClient.List" + +// List gets a list of BackendAddressPool in the resource group. +func (client *Client) List(ctx context.Context, resourceGroupName string, loadbalancerName string) (result []*armnetwork.BackendAddressPool, err error) { + metricsCtx := metrics.BeginARMRequest(client.subscriptionID, resourceGroupName, "BackendAddressPool", "list") + defer func() { metricsCtx.Observe(ctx, err) }() + ctx, endSpan := runtime.StartSpan(ctx, ListOperationName, client.tracer, nil) + defer endSpan(err) + pager := client.LoadBalancerBackendAddressPoolsClient.NewListPager(resourceGroupName, loadbalancerName, nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + return nil, err + } + result = append(result, nextResult.Value...) + } + return result, nil +} diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/factory.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/factory.go index d648910681..93e8cc8644 100644 --- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/factory.go +++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/factory.go @@ -20,6 +20,7 @@ package azclient import ( "sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient" "sigs.k8s.io/cloud-provider-azure/pkg/azclient/availabilitysetclient" + "sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient" "sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient" "sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient" "sigs.k8s.io/cloud-provider-azure/pkg/azclient/deploymentclient" @@ -59,6 +60,7 @@ type ClientFactory interface { GetAccountClient() accountclient.Interface GetAccountClientForSub(subscriptionID string) (accountclient.Interface, error) GetAvailabilitySetClient() availabilitysetclient.Interface + GetBackendAddressPoolClient() backendaddresspoolclient.Interface GetBlobContainerClient() blobcontainerclient.Interface GetBlobContainerClientForSub(subscriptionID string) (blobcontainerclient.Interface, error) GetBlobServicePropertiesClient() blobservicepropertiesclient.Interface diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/factory_gen.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/factory_gen.go index 435fde8019..138d3f24ca 100644 --- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/factory_gen.go +++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/factory_gen.go @@ -27,6 +27,7 @@ import ( "sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient" "sigs.k8s.io/cloud-provider-azure/pkg/azclient/availabilitysetclient" + "sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient" "sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient" "sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient" "sigs.k8s.io/cloud-provider-azure/pkg/azclient/deploymentclient" @@ -71,6 +72,7 @@ type ClientFactoryImpl struct { clientOptionsMutFn []func(option *arm.ClientOptions) accountclientInterface sync.Map availabilitysetclientInterface availabilitysetclient.Interface + backendaddresspoolclientInterface backendaddresspoolclient.Interface blobcontainerclientInterface sync.Map blobservicepropertiesclientInterface sync.Map deploymentclientInterface deploymentclient.Interface @@ -135,6 +137,12 @@ func NewClientFactory(config *ClientFactoryConfig, armConfig *ARMClientConfig, c return nil, err } + //initialize backendaddresspoolclient + factory.backendaddresspoolclientInterface, err = factory.createBackendAddressPoolClient(config.SubscriptionID) + if err != nil { + return nil, err + } + //initialize blobcontainerclient _, err = factory.GetBlobContainerClientForSub(config.SubscriptionID) if err != nil { @@ -410,6 +418,31 @@ func (factory *ClientFactoryImpl) GetAvailabilitySetClient() availabilitysetclie return factory.availabilitysetclientInterface } +func (factory *ClientFactoryImpl) createBackendAddressPoolClient(subscription string) (backendaddresspoolclient.Interface, error) { + //initialize backendaddresspoolclient + options, err := GetDefaultResourceClientOption(factory.armConfig, factory.facotryConfig) + if err != nil { + return nil, err + } + + //add ratelimit policy + ratelimitOption := factory.facotryConfig.GetRateLimitConfig("loadBalancerRateLimit") + rateLimitPolicy := ratelimit.NewRateLimitPolicy(ratelimitOption) + if rateLimitPolicy != nil { + options.ClientOptions.PerCallPolicies = append(options.ClientOptions.PerCallPolicies, rateLimitPolicy) + } + for _, optionMutFn := range factory.clientOptionsMutFn { + if optionMutFn != nil { + optionMutFn(options) + } + } + return backendaddresspoolclient.New(subscription, factory.cred, options) +} + +func (factory *ClientFactoryImpl) GetBackendAddressPoolClient() backendaddresspoolclient.Interface { + return factory.backendaddresspoolclientInterface +} + func (factory *ClientFactoryImpl) createBlobContainerClient(subscription string) (blobcontainerclient.Interface, error) { //initialize blobcontainerclient options, err := GetDefaultResourceClientOption(factory.armConfig, factory.facotryConfig) diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/mock_azclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/mock_azclient/interface.go index f79f885c0d..336607306f 100644 --- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/mock_azclient/interface.go +++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/mock_azclient/interface.go @@ -33,6 +33,7 @@ import ( accountclient "sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient" availabilitysetclient "sigs.k8s.io/cloud-provider-azure/pkg/azclient/availabilitysetclient" + backendaddresspoolclient "sigs.k8s.io/cloud-provider-azure/pkg/azclient/backendaddresspoolclient" blobcontainerclient "sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobcontainerclient" blobservicepropertiesclient "sigs.k8s.io/cloud-provider-azure/pkg/azclient/blobservicepropertiesclient" deploymentclient "sigs.k8s.io/cloud-provider-azure/pkg/azclient/deploymentclient" @@ -135,6 +136,20 @@ func (mr *MockClientFactoryMockRecorder) GetAvailabilitySetClient() *gomock.Call return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAvailabilitySetClient", reflect.TypeOf((*MockClientFactory)(nil).GetAvailabilitySetClient)) } +// GetBackendAddressPoolClient mocks base method. +func (m *MockClientFactory) GetBackendAddressPoolClient() backendaddresspoolclient.Interface { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBackendAddressPoolClient") + ret0, _ := ret[0].(backendaddresspoolclient.Interface) + return ret0 +} + +// GetBackendAddressPoolClient indicates an expected call of GetBackendAddressPoolClient. +func (mr *MockClientFactoryMockRecorder) GetBackendAddressPoolClient() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBackendAddressPoolClient", reflect.TypeOf((*MockClientFactory)(nil).GetBackendAddressPoolClient)) +} + // GetBlobContainerClient mocks base method. func (m *MockClientFactory) GetBlobContainerClient() blobcontainerclient.Interface { m.ctrl.T.Helper() diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/publicipaddressclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/publicipaddressclient/interface.go index a0bef32f1c..71499a9487 100644 --- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/publicipaddressclient/interface.go +++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/publicipaddressclient/interface.go @@ -18,6 +18,8 @@ limitations under the License. package publicipaddressclient import ( + "context" + armnetwork "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" "sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils" @@ -29,4 +31,5 @@ type Interface interface { utils.CreateOrUpdateFunc[armnetwork.PublicIPAddress] utils.DeleteFunc[armnetwork.PublicIPAddress] utils.ListFunc[armnetwork.PublicIPAddress] + GetVirtualMachineScaleSetPublicIPAddress(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, ipConfigurationName string, publicIPAddressName string, options *armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions) (armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse, error) } diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/publicipaddressclient/mock_publicipaddressclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/publicipaddressclient/mock_publicipaddressclient/interface.go index 593ba718dd..b339aaf950 100644 --- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/publicipaddressclient/mock_publicipaddressclient/interface.go +++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/publicipaddressclient/mock_publicipaddressclient/interface.go @@ -176,6 +176,45 @@ func (c *MockInterfaceGetCall) DoAndReturn(f func(context.Context, string, strin return c } +// GetVirtualMachineScaleSetPublicIPAddress mocks base method. +func (m *MockInterface) GetVirtualMachineScaleSetPublicIPAddress(ctx context.Context, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIPAddressName string, options *armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions) (armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetVirtualMachineScaleSetPublicIPAddress", ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIPAddressName, options) + ret0, _ := ret[0].(armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetVirtualMachineScaleSetPublicIPAddress indicates an expected call of GetVirtualMachineScaleSetPublicIPAddress. +func (mr *MockInterfaceMockRecorder) GetVirtualMachineScaleSetPublicIPAddress(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIPAddressName, options any) *MockInterfaceGetVirtualMachineScaleSetPublicIPAddressCall { + mr.mock.ctrl.T.Helper() + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVirtualMachineScaleSetPublicIPAddress", reflect.TypeOf((*MockInterface)(nil).GetVirtualMachineScaleSetPublicIPAddress), ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIPAddressName, options) + return &MockInterfaceGetVirtualMachineScaleSetPublicIPAddressCall{Call: call} +} + +// MockInterfaceGetVirtualMachineScaleSetPublicIPAddressCall wrap *gomock.Call +type MockInterfaceGetVirtualMachineScaleSetPublicIPAddressCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfaceGetVirtualMachineScaleSetPublicIPAddressCall) Return(arg0 armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse, arg1 error) *MockInterfaceGetVirtualMachineScaleSetPublicIPAddressCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfaceGetVirtualMachineScaleSetPublicIPAddressCall) Do(f func(context.Context, string, string, string, string, string, string, *armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions) (armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse, error)) *MockInterfaceGetVirtualMachineScaleSetPublicIPAddressCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfaceGetVirtualMachineScaleSetPublicIPAddressCall) DoAndReturn(f func(context.Context, string, string, string, string, string, string, *armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions) (armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse, error)) *MockInterfaceGetVirtualMachineScaleSetPublicIPAddressCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + // List mocks base method. func (m *MockInterface) List(ctx context.Context, resourceGroupName string) ([]*armnetwork.PublicIPAddress, error) { m.ctrl.T.Helper()