Skip to content

Commit

Permalink
use v16 client.Expiry() function
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoShaka authored and marcoandredinis committed Aug 26, 2024
1 parent b447a14 commit 62844ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions integrations/terraform/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ require (
github.com/gravitational/trace v1.4.0
github.com/hashicorp/terraform-plugin-framework v0.10.0
github.com/hashicorp/terraform-plugin-go v0.18.0
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1
github.com/jonboulle/clockwork v0.4.0
github.com/sirupsen/logrus v1.9.3
Expand All @@ -26,8 +27,6 @@ require (
google.golang.org/protobuf v1.34.2
)

require github.com/hashicorp/terraform-plugin-log v0.9.0

require (
cloud.google.com/go v0.112.2 // indirect
cloud.google.com/go/auth v0.3.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion integrations/terraform/provider/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (s CredentialSources) BuildClient(ctx context.Context, clientCfg client.Con
}

now := time.Now()
if expiry, ok := creds.Expiry(); ok && !expiry.IsZero() && expiry.Before(now) {
if expiry, ok := client.Expiry(creds); ok && !expiry.IsZero() && expiry.Before(now) {
diags.AddWarning(
fmt.Sprintf("Teleport credentials %s are expired", source.Name()),
fmt.Sprintf(`The credentials %s are expired. Expiration is %q while current time is %q). You might need to refresh them. The provider will not attempt to use those credentials.`,
Expand Down

0 comments on commit 62844ea

Please sign in to comment.