Use IsNotFoundError helper function to identify FIC not found error

This commit is contained in:
Tanmay Satam 2024-10-22 08:38:35 -04:00
Родитель e208003497
Коммит 5942190f72
1 изменённых файлов: 1 добавлений и 4 удалений

Просмотреть файл

@ -6,14 +6,12 @@ package cluster
import (
"context"
"encoding/json"
"errors"
"fmt"
"net/http"
"sort"
"strings"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/msi/armmsi"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"
mgmtnetwork "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-08-01/network"
@ -427,8 +425,7 @@ func (m *manager) deleteFederatedCredentials(ctx context.Context) error {
&armmsi.FederatedIdentityCredentialsClientDeleteOptions{},
)
if err != nil {
var respErr *azcore.ResponseError
if errors.As(err, &respErr); respErr.StatusCode == http.StatusNotFound {
if azuresdkerrors.IsNotFoundError(err) {
m.log.Errorf("federated identity credentials not found for %s: %v", identity.ResourceID, err.Error())
continue
} else {