Skip to content

Commit

Permalink
fix typo (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
naka-gawa authored May 14, 2021
1 parent 684ed7f commit 1ae92fe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
17 changes: 9 additions & 8 deletions pkg/resource/cluster/cluster_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ package cluster
import (
"bytes"
"fmt"
"github.com/mumoshu/terraform-provider-eksctl/pkg/sdk"
"github.com/mumoshu/terraform-provider-eksctl/pkg/sdk/api"
"github.com/mumoshu/terraform-provider-eksctl/pkg/sdk/tfsdk"
"io/ioutil"
"log"
"os"
"os/exec"
"strings"
"time"

"github.com/mumoshu/terraform-provider-eksctl/pkg/sdk"
"github.com/mumoshu/terraform-provider-eksctl/pkg/sdk/api"
"github.com/mumoshu/terraform-provider-eksctl/pkg/sdk/tfsdk"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

Expand Down Expand Up @@ -159,11 +160,11 @@ func createIAMIdentityMapping(ctx *sdk.Context, d api.ReadWrite, cluster *Cluste
if d.Get(KeyIAMIdentityMapping) != nil {
values := d.Get(KeyIAMIdentityMapping).(*schema.Set)
if err := runCreateIAMIdentityMapping(ctx, d, values, cluster); err != nil {
return fmt.Errorf("creating create imaidentitymapping command: %w", err)
return fmt.Errorf("creating create iamidentitymapping command: %w", err)
}

if err := d.Set(KeyIAMIdentityMapping, values); err != nil {
return fmt.Errorf("set imaidentitymapping : %w", err)
return fmt.Errorf("set iamidentitymapping : %w", err)
}
}

Expand Down Expand Up @@ -196,12 +197,12 @@ func runCreateIAMIdentityMapping(ctx *sdk.Context, d api.Getter, s *schema.Set,
cmd, err := newEksctlCommandFromResourceWithRegionAndProfile(d, args...)

if err != nil {
return fmt.Errorf("creating create imaidentitymapping command: %w", err)
return fmt.Errorf("creating create iamidentitymapping command: %w", err)
}

res, err := ctx.Run(cmd)
if err != nil {
return fmt.Errorf("running create imaidentitymapping command: %w", err)
return fmt.Errorf("running create iamidentitymapping command: %w", err)
}

log.Printf("eksctl creat iamidentitymapping response: %v", res)
Expand All @@ -225,7 +226,7 @@ func runDeleteIAMIdentityMapping(ctx *sdk.Context, d api.Getter, s *schema.Set,
cmd, err := newEksctlCommandFromResourceWithRegionAndProfile(d, args...)

if err != nil {
return fmt.Errorf("creating create imaidentitymapping command: %w", err)
return fmt.Errorf("creating create iamidentitymapping command: %w", err)
}

res, err := ctx.Run(cmd)
Expand Down
13 changes: 7 additions & 6 deletions pkg/resource/cluster/cluster_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ package cluster
import (
"encoding/json"
"fmt"
"github.com/mumoshu/terraform-provider-eksctl/pkg/sdk"
"github.com/mumoshu/terraform-provider-eksctl/pkg/sdk/api"
"github.com/mumoshu/terraform-provider-eksctl/pkg/sdk/tfsdk"
"golang.org/x/xerrors"
"log"
"os"
"sort"
"strings"

"github.com/mumoshu/terraform-provider-eksctl/pkg/sdk"
"github.com/mumoshu/terraform-provider-eksctl/pkg/sdk/api"
"github.com/mumoshu/terraform-provider-eksctl/pkg/sdk/tfsdk"
"golang.org/x/xerrors"

"github.com/google/go-cmp/cmp"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)
Expand Down Expand Up @@ -137,7 +138,7 @@ func runGetIAMIdentityMapping(ctx *sdk.Context, d api.Getter, cluster *Cluster)
cmd, err := newEksctlCommandFromResourceWithRegionAndProfile(d, args...)

if err != nil {
return nil, fmt.Errorf("creating get imaidentitymapping command: %w", err)
return nil, fmt.Errorf("creating get iamidentitymapping command: %w", err)
}

iamJson, err := ctx.Run(cmd)
Expand Down Expand Up @@ -235,7 +236,7 @@ func runGetCluster(d api.Getter, cluster *Cluster) (*ClusterState, error) {
cmd, err := newEksctlCommandFromResourceWithRegionAndProfile(d, args...)

if err != nil {
return nil, fmt.Errorf("creating get imaidentitymapping command: %w", err)
return nil, fmt.Errorf("creating get iamidentitymapping command: %w", err)
}

ctx := mustNewContext(cluster)
Expand Down

0 comments on commit 1ae92fe

Please sign in to comment.