Skip to content

Commit

Permalink
[azclients] Add method for deleting PLS private endpoint connection (#…
Browse files Browse the repository at this point in the history
…7443)

* Add method for deleting PLS private endpoint connection

* Add license header
  • Loading branch information
zarvd authored Oct 30, 2024
1 parent 93ffd31 commit 13a8c27
Show file tree
Hide file tree
Showing 38 changed files with 122 additions and 28 deletions.
1 change: 1 addition & 0 deletions pkg/azclient/accountclient/mock_accountclient/interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/azclient/diskclient/mock_diskclient/interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/azclient/ipgroupclient/mock_ipgroupclient/interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 29 additions & 28 deletions pkg/azclient/mock_azclient/interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions pkg/azclient/privatelinkserviceclient/custom.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
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.
*/

package privatelinkserviceclient

import (
"context"

"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"

"sigs.k8s.io/cloud-provider-azure/pkg/azclient/metrics"
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils"
)

const DeletePEConnectionOperationName = "PrivateLinkServicesClient.DeletePrivateEndpointConnection"

func (client *Client) DeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string) (err error) {
metricsCtx := metrics.BeginARMRequest(client.subscriptionID, resourceGroupName, "PrivateLinkService", "deletePrivateEndpointConnection")
defer func() { metricsCtx.Observe(ctx, err) }()
ctx, endSpan := runtime.StartSpan(ctx, DeletePEConnectionOperationName, client.tracer, nil)
defer endSpan(err)

_, err = utils.NewPollerWrapper(
client.BeginDeletePrivateEndpointConnection(ctx, resourceGroupName, serviceName, peConnectionName, nil),
).WaitforPollerResp(ctx)

return err
}
3 changes: 3 additions & 0 deletions pkg/azclient/privatelinkserviceclient/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ limitations under the License.
package privatelinkserviceclient

import (
"context"

armnetwork "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"

"sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils"
Expand All @@ -29,4 +31,5 @@ type Interface interface {
utils.CreateOrUpdateFunc[armnetwork.PrivateLinkService]
utils.DeleteFunc[armnetwork.PrivateLinkService]
utils.ListFunc[armnetwork.PrivateLinkService]
DeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string) error
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 13a8c27

Please sign in to comment.