From 1ae92fefbf8b6a5199bd78e5fe1bba49c5053bac Mon Sep 17 00:00:00 2001 From: Tomoaki Nakagawa Date: Fri, 14 May 2021 18:48:36 +0900 Subject: [PATCH] fix typo (#50) --- pkg/resource/cluster/cluster_create.go | 17 +++++++++-------- pkg/resource/cluster/cluster_read.go | 13 +++++++------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/pkg/resource/cluster/cluster_create.go b/pkg/resource/cluster/cluster_create.go index f8fe418..485d3a7 100644 --- a/pkg/resource/cluster/cluster_create.go +++ b/pkg/resource/cluster/cluster_create.go @@ -3,9 +3,6 @@ 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" @@ -13,6 +10,10 @@ import ( "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" ) @@ -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) } } @@ -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) @@ -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) diff --git a/pkg/resource/cluster/cluster_read.go b/pkg/resource/cluster/cluster_read.go index b3928f8..e6d123a 100644 --- a/pkg/resource/cluster/cluster_read.go +++ b/pkg/resource/cluster/cluster_read.go @@ -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" ) @@ -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) @@ -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)