Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
freeznet committed Nov 15, 2024
1 parent facf322 commit 968336c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cloud/data_source_service_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package cloud
import (
"context"
"fmt"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"strings"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
Expand Down Expand Up @@ -76,6 +77,10 @@ func DataSourceServiceAccountRead(ctx context.Context, d *schema.ResourceData, m
}
serviceAccount, err := clientSet.CloudV1alpha1().ServiceAccounts(namespace).Get(ctx, name, metav1.GetOptions{})
if err != nil {
if apierrors.IsNotFound(err) {
d.SetId("")
return nil
}
return diag.FromErr(fmt.Errorf("ERROR_READ_SERVICE_ACCOUNT: %w", err))
}
_ = d.Set("name", serviceAccount.Name)
Expand Down

0 comments on commit 968336c

Please sign in to comment.