Skip to content

Commit

Permalink
Fix agent pool allowed workspace data source test
Browse files Browse the repository at this point in the history
Fix error checking lint
  • Loading branch information
Karl Kirch committed Jun 23, 2023
1 parent 5c3b5d0 commit d1ef6a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tfe/data_source_agent_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ resource "tfe_agent_pool" "foobar" {
resource "tfe_agent_pool_allowed_workspaces" "foobar" {
agent_pool_id = tfe_agent_pool.foobar.id
allowed_workspace_ids = ["%s"]
allowed_workspace_ids = ["%s"]
}
data "tfe_agent_pool" "foobar" {
Expand Down
6 changes: 4 additions & 2 deletions tfe/resource_tfe_agent_pool_allowed_workspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
package tfe

import (
"errors"
"fmt"
"log"

"github.com/hashicorp/go-tfe"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"log"
)

func resourceTFEAgentPoolAllowedWorkspaces() *schema.Resource {
Expand Down Expand Up @@ -69,7 +71,7 @@ func resourceTFEAgentPoolAllowedWorkspacesRead(d *schema.ResourceData, meta inte

agentPool, err := config.Client.AgentPools.Read(ctx, d.Id())
if err != nil {
if err == tfe.ErrResourceNotFound {
if errors.Is(err, tfe.ErrResourceNotFound) {
log.Printf("[DEBUG] agent pool %s no longer exists", d.Id())
d.SetId("")
return nil
Expand Down

0 comments on commit d1ef6a5

Please sign in to comment.