From 52bb9eb1fd0b259bc77ed08c144d51ecc1cf82bf Mon Sep 17 00:00:00 2001 From: Gagan Trivedi Date: Tue, 30 Jan 2024 08:28:26 +0530 Subject: [PATCH] fix(67): Add Tags resource (#122) * Add Tags resource * Add tags support to feature resource * Add docs * update changelog * bump plugin-docs --- CHANGELOG.md | 12 ++ docs/resources/feature.md | 1 + docs/resources/tag.md | 32 ++++ flagsmith/models.go | 63 ++++++- flagsmith/provider.go | 1 + flagsmith/provider_test.go | 16 ++ flagsmith/resource_feature.go | 5 + flagsmith/resource_feature_state_test.go | 14 +- flagsmith/resource_feature_test.go | 33 ++-- flagsmith/resource_segment_test.go | 52 ++---- flagsmith/resource_tag.go | 211 +++++++++++++++++++++++ flagsmith/resource_tag_test.go | 118 +++++++++++++ go.mod | 33 ++-- go.sum | 92 +++++----- 14 files changed, 568 insertions(+), 115 deletions(-) create mode 100644 docs/resources/tag.md create mode 100644 flagsmith/resource_tag.go create mode 100644 flagsmith/resource_tag_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d7ba09..d036b55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 0.7.0 +FEATURES: +* Add resource `flagsmith_tag` +* Update resource `flagsmith_feature` to add support for tags + +BUG FIXES +fix https://github.com/Flagsmith/terraform-provider-flagsmith/issues/67 + +## 0.6.0 +NOTES: +* This Go module(and related dependencies) has been updated to GO 1.20 as per the Go Support policy + ## 0.5.1 BUG FIXES fix https://github.com/Flagsmith/terraform-provider-flagsmith/issues/81 diff --git a/docs/resources/feature.md b/docs/resources/feature.md index e0c459c..c5fc134 100644 --- a/docs/resources/feature.md +++ b/docs/resources/feature.md @@ -43,6 +43,7 @@ resource "flagsmith_feature" "new_standard_feature" { - `initial_value` (String) Determines the initial value of the feature. - `is_archived` (Boolean) Can be used to archive/unarchive a feature. If unspecified, it will default to false - `owners` (Set of Number) List of user IDs representing the owners of the feature. +- `tags` (Set of Number) List of tag IDs representing the tags attached to the feature. - `type` (String) Type of the feature, can be STANDARD, or MULTIVARIATE. if unspecified, it will default to STANDARD ### Read-Only diff --git a/docs/resources/tag.md b/docs/resources/tag.md new file mode 100644 index 0000000..4f7cfe9 --- /dev/null +++ b/docs/resources/tag.md @@ -0,0 +1,32 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "flagsmith_tag Resource - terraform-provider-flagsmith" +subcategory: "" +description: |- + Flagsmith Tag +--- + +# flagsmith_tag (Resource) + +Flagsmith Tag + + + + +## Schema + +### Required + +- `project_uuid` (String) UUID of project the tag belongs to +- `tag_colour` (String) Hexadecimal value of the tag color +- `tag_name` (String) Name of the tag + +### Optional + +- `description` (String) Description of the feature + +### Read-Only + +- `id` (Number) ID of the tag +- `project_id` (Number) ID of the project +- `uuid` (String) UUID of the tag diff --git a/flagsmith/models.go b/flagsmith/models.go index 07706cc..0e8f788 100644 --- a/flagsmith/models.go +++ b/flagsmith/models.go @@ -222,6 +222,7 @@ type FeatureResourceData struct { DefaultEnabled types.Bool `tfsdk:"default_enabled"` IsArchived types.Bool `tfsdk:"is_archived"` Owners *[]types.Int64 `tfsdk:"owners"` + Tags *[]types.Int64 `tfsdk:"tags"` ProjectID types.Int64 `tfsdk:"project_id"` ProjectUUID types.String `tfsdk:"project_uuid"` } @@ -241,6 +242,7 @@ func (f *FeatureResourceData) ToClientFeature() *flagsmithapi.Feature { DefaultEnabled: f.DefaultEnabled.ValueBool(), IsArchived: f.IsArchived.ValueBool(), ProjectUUID: f.ProjectUUID.ValueString(), + Tags: []int64{}, Owners: &[]int64{}, } if !f.ID.IsNull() && !f.ID.IsUnknown() { @@ -259,7 +261,12 @@ func (f *FeatureResourceData) ToClientFeature() *flagsmithapi.Feature { for _, owner := range *f.Owners { ownerID := owner.ValueInt64() *feature.Owners = append(*feature.Owners, ownerID) - + } + } + if f.Tags != nil { + for _, tag := range *f.Tags { + tagID := tag.ValueInt64() + feature.Tags = append(feature.Tags, tagID) } } return &feature @@ -292,6 +299,12 @@ func MakeFeatureResourceDataFromClientFeature(clientFeature *flagsmithapi.Featur *resourceData.Owners = append(*resourceData.Owners, types.Int64Value(owner)) } } + if clientFeature.Tags != nil && len(clientFeature.Tags) > 0 { + resourceData.Tags = &[]types.Int64{} + for _, tag := range clientFeature.Tags { + *resourceData.Tags = append(*resourceData.Tags, types.Int64Value(tag)) + } + } return resourceData } @@ -439,3 +452,51 @@ func MakeSegmentResourceDataFromClientSegment(clientSegment *flagsmithapi.Segmen } return resourceData } + +type TagResourceData struct { + ID types.Int64 `tfsdk:"id"` + UUID types.String `tfsdk:"uuid"` + Name types.String `tfsdk:"tag_name"` + Description types.String `tfsdk:"description"` + ProjectID types.Int64 `tfsdk:"project_id"` + ProjectUUID types.String `tfsdk:"project_uuid"` + Colour types.String `tfsdk:"tag_colour"` +} + +func (t *TagResourceData) ToClientTag() *flagsmithapi.Tag { + tag := flagsmithapi.Tag{ + UUID: t.UUID.ValueString(), + Name: t.Name.ValueString(), + ProjectUUID: t.ProjectUUID.ValueString(), + Colour: t.Colour.ValueString(), + } + if t.Description.ValueString() != "" { + value := t.Description.ValueString() + tag.Description = &value + } + if !t.ID.IsNull() && !t.ID.IsUnknown() { + tagID := t.ID.ValueInt64() + tag.ID = &tagID + } + if !t.ProjectID.IsNull() && !t.ProjectID.IsUnknown() { + projectID := t.ProjectID.ValueInt64() + tag.ProjectID = &projectID + } + return &tag +} + +func MakeTagResourceDataFromClientTag(clientTag *flagsmithapi.Tag) TagResourceData { + resourceData := TagResourceData{ + ID: types.Int64Value(*clientTag.ID), + UUID: types.StringValue(clientTag.UUID), + Name: types.StringValue(clientTag.Name), + ProjectID: types.Int64Value(*clientTag.ProjectID), + ProjectUUID: types.StringValue(clientTag.ProjectUUID), + Colour: types.StringValue(clientTag.Colour), + } + if clientTag.Description != nil { + resourceData.Description = types.StringValue(*clientTag.Description) + } + + return resourceData +} diff --git a/flagsmith/provider.go b/flagsmith/provider.go index f8b2d71..d089eff 100644 --- a/flagsmith/provider.go +++ b/flagsmith/provider.go @@ -79,6 +79,7 @@ func (p *fsProvider) Resources(ctx context.Context) []func() resource.Resource { newFeatureStateResource, newSegmentResource, newMultivariateResource, + newTagResource, } } diff --git a/flagsmith/provider_test.go b/flagsmith/provider_test.go index d22600e..1ec0d21 100644 --- a/flagsmith/provider_test.go +++ b/flagsmith/provider_test.go @@ -5,9 +5,12 @@ import ( "github.com/Flagsmith/terraform-provider-flagsmith/flagsmith" "github.com/hashicorp/terraform-plugin-framework/providerserver" "github.com/hashicorp/terraform-plugin-go/tfprotov6" + + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "os" "strconv" "testing" + "fmt" ) // Create provider factories - to be used by resource tests @@ -68,3 +71,16 @@ func testClient() *flagsmithapi.Client { return tc } +func getAttributefromState(s *terraform.State, resourceName , attribute string) (string, error) { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return "", fmt.Errorf("not found: %s", resourceName) + } + + uuid := rs.Primary.Attributes[attribute] + + if uuid == "" { + return "", fmt.Errorf("no uuid is set") + } + return uuid, nil +} diff --git a/flagsmith/resource_feature.go b/flagsmith/resource_feature.go index 35eb0de..6fd722a 100644 --- a/flagsmith/resource_feature.go +++ b/flagsmith/resource_feature.go @@ -115,6 +115,11 @@ func (t *featureResource) Schema(ctx context.Context, req resource.SchemaRequest ElementType: types.Int64Type, MarkdownDescription: "List of user IDs representing the owners of the feature.", }, + "tags": schema.SetAttribute{ + Optional: true, + ElementType: types.Int64Type, + MarkdownDescription: "List of tag IDs representing the tags attached to the feature.", + }, "project_uuid": schema.StringAttribute{ MarkdownDescription: "UUID of project the feature belongs to", Required: true, diff --git a/flagsmith/resource_feature_state_test.go b/flagsmith/resource_feature_state_test.go index 7be9a9c..6a8640f 100644 --- a/flagsmith/resource_feature_state_test.go +++ b/flagsmith/resource_feature_state_test.go @@ -7,9 +7,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "regexp" "strconv" "testing" - "regexp" ) func TestAccEnvironmentFeatureStateResource(t *testing.T) { @@ -19,15 +19,13 @@ func TestAccEnvironmentFeatureStateResource(t *testing.T) { Steps: []resource.TestStep{ // Test feature State value validator { - Config: testAccInvalidFeatureStateValueConfig(), + Config: testAccInvalidFeatureStateValueConfig(), ExpectError: regexp.MustCompile(`Exactly one of these attributes must be configured:\n\[feature_state_value.string_value,feature_state_value.integer_value,feature_state_value.boolean_value\]`), - }, // Test feature State string value validator { - Config: testAccEnvironmentFeatureStateResourceConfig(" some_value ", true), + Config: testAccEnvironmentFeatureStateResourceConfig(" some_value ", true), ExpectError: regexp.MustCompile(`Attribute feature_state_value.string_value Leading and trailing whitespace is\n.*not allowed`), - }, // Create and Read testing @@ -134,7 +132,7 @@ func TestAccSegmentFeatureStateResource(t *testing.T) { func getFeatureStateImportID(n string) resource.ImportStateIdFunc { return func(s *terraform.State) (string, error) { - uuid, err := getUUIDfromState(s, n) + uuid, err := getAttributefromState(s, n, "uuid") if err != nil { return "", err } @@ -144,7 +142,7 @@ func getFeatureStateImportID(n string) resource.ImportStateIdFunc { } func testAccCheckSegmentFeatureStateDestroy(s *terraform.State) error { - uuid, err := getUUIDfromState(s, "flagsmith_feature_state.dummy_environment_feature_x_segment_override") + uuid, err := getAttributefromState(s, "flagsmith_feature_state.dummy_environment_feature_x_segment_override", "uuid") if err != nil { return err } @@ -237,5 +235,5 @@ resource "flagsmith_feature_state" "dummy_environment_feature_x" { } } -`, environmentKey(), featureID()) +`, environmentKey(), featureID()) } diff --git a/flagsmith/resource_feature_test.go b/flagsmith/resource_feature_test.go index 6d990aa..54da7e7 100644 --- a/flagsmith/resource_feature_test.go +++ b/flagsmith/resource_feature_test.go @@ -36,6 +36,8 @@ func TestAccFeatureResource(t *testing.T) { resource.TestCheckResourceAttr("flagsmith_feature.test_feature", "owners.0", fmt.Sprintf("%d", firstUserID)), resource.TestCheckResourceAttr("flagsmith_feature.test_feature", "owners.1", fmt.Sprintf("%d", secondUserID)), + resource.TestCheckResourceAttrSet("flagsmith_feature.test_feature", "tags.0"), + resource.TestCheckResourceAttrSet("flagsmith_feature.test_feature", "id"), resource.TestCheckResourceAttrSet("flagsmith_feature.test_feature", "uuid"), resource.TestCheckResourceAttrSet("flagsmith_feature.test_feature", "project_id"), @@ -56,6 +58,8 @@ func TestAccFeatureResource(t *testing.T) { resource.TestCheckResourceAttr("flagsmith_feature.test_feature", "owners.0", fmt.Sprintf("%d", firstUserID)), resource.TestCheckResourceAttr("flagsmith_feature.test_feature", "owners.1", fmt.Sprintf("%d", secondUserID)), + resource.TestCheckResourceAttrSet("flagsmith_feature.test_feature", "tags.0"), + resource.TestCheckResourceAttrSet("flagsmith_feature.test_feature", "id"), resource.TestCheckResourceAttrSet("flagsmith_feature.test_feature", "uuid"), resource.TestCheckResourceAttrSet("flagsmith_feature.test_feature", "project_id"), @@ -70,6 +74,8 @@ func TestAccFeatureResource(t *testing.T) { resource.TestCheckResourceAttr("flagsmith_feature.test_feature", "description", "feature description updated"), resource.TestCheckResourceAttr("flagsmith_feature.test_feature", "project_uuid", projectUUID()), + resource.TestCheckResourceAttrSet("flagsmith_feature.test_feature", "tags.0"), + resource.TestCheckResourceAttr("flagsmith_feature.test_feature", "owners.0", fmt.Sprintf("%d", firstUserID)), resource.TestCheckResourceAttr("flagsmith_feature.test_feature", "owners.1", fmt.Sprintf("%d", thirdUserID)), ), @@ -136,14 +142,15 @@ func TestAccFeatureResourceOwners(t *testing.T) { }, }) } + func getFeatureImportID(n string) resource.ImportStateIdFunc { return func(s *terraform.State) (string, error) { - return getUUIDfromState(s, n) + return getAttributefromState(s, n, "uuid") } } func testAccCheckFeatureResourceDestroy(s *terraform.State) error { - uuid, err := getUUIDfromState(s, "flagsmith_feature.test_feature") + uuid, err := getAttributefromState(s, "flagsmith_feature.test_feature", "uuid") if err != nil { return err } @@ -156,25 +163,16 @@ func testAccCheckFeatureResourceDestroy(s *terraform.State) error { } -func getUUIDfromState(s *terraform.State, resourceName string) (string, error) { - rs, ok := s.RootModule().Resources[resourceName] - if !ok { - return "", fmt.Errorf("not found: %s", resourceName) - } - - uuid := rs.Primary.Attributes["uuid"] - - if uuid == "" { - return "", fmt.Errorf("no uuid is set") - } - return uuid, nil -} - func testAccFeatureResourceConfig(featureName, description string, owners []int) string { return fmt.Sprintf(` provider "flagsmith" { } +resource "flagsmith_tag" "test_tag" { + tag_name = "feature_acc_test_tag" + tag_colour = "#000000" + project_uuid = "%s" +} resource "flagsmith_feature" "test_feature" { feature_name = "%s" @@ -182,7 +180,8 @@ resource "flagsmith_feature" "test_feature" { project_uuid = "%s" type = "STANDARD" owners = %s + tags = [flagsmith_tag.test_tag.id] } -`, featureName, description, projectUUID(), strings.Join(strings.Fields(fmt.Sprint(owners)), ",")) +`, projectUUID(), featureName, description, projectUUID(), strings.Join(strings.Fields(fmt.Sprint(owners)), ",")) } diff --git a/flagsmith/resource_segment_test.go b/flagsmith/resource_segment_test.go index 19046e5..450190e 100644 --- a/flagsmith/resource_segment_test.go +++ b/flagsmith/resource_segment_test.go @@ -3,16 +3,14 @@ package flagsmith_test import ( "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "testing" ) - - func TestAccSegmentResource(t *testing.T) { - segmentName := acctest.RandString(16) + segmentName := acctest.RandString(16) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -27,17 +25,16 @@ func TestAccSegmentResource(t *testing.T) { resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "description", "new segment description"), resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "project_uuid", projectUUID()), - resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.type","ALL"), - resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.type","ANY"), - resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.operator","EQUAL"), - resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.property","device_type"), - resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.value","mobile"), + resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.type", "ALL"), + resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.type", "ANY"), + resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.operator", "EQUAL"), + resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.property", "device_type"), + resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.value", "mobile"), resource.TestCheckResourceAttrSet("flagsmith_segment.test_segment", "id"), resource.TestCheckResourceAttrSet("flagsmith_segment.test_segment", "uuid"), resource.TestCheckResourceAttrSet("flagsmith_segment.test_segment", "project_id"), resource.TestCheckNoResourceAttr("flagsmith_segment.test_segment", "feature_id"), - ), }, @@ -53,18 +50,16 @@ func TestAccSegmentResource(t *testing.T) { resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "description", "new segment description"), resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "project_uuid", projectUUID()), - resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.type","ALL"), - resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.type","ANY"), - resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.operator","EQUAL"), - resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.property","device_type"), - resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.value","mobile"), - + resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.type", "ALL"), + resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.type", "ANY"), + resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.operator", "EQUAL"), + resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.property", "device_type"), + resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.value", "mobile"), resource.TestCheckResourceAttrSet("flagsmith_segment.test_segment", "id"), resource.TestCheckResourceAttrSet("flagsmith_segment.test_segment", "uuid"), resource.TestCheckResourceAttrSet("flagsmith_segment.test_segment", "project_id"), resource.TestCheckNoResourceAttr("flagsmith_segment.test_segment", "feature_id"), - ), }, @@ -76,34 +71,30 @@ func TestAccSegmentResource(t *testing.T) { resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "description", "segment description updated"), resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "project_uuid", projectUUID()), - resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.type","ALL"), - resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.type","ANY"), - resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.operator","EQUAL"), - resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.property","device_type"), - resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.value","mobile"), + resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.type", "ALL"), + resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.type", "ANY"), + resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.operator", "EQUAL"), + resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.property", "device_type"), + resource.TestCheckResourceAttr("flagsmith_segment.test_segment", "rules.0.rules.0.conditions.0.value", "mobile"), resource.TestCheckResourceAttrSet("flagsmith_segment.test_segment", "id"), resource.TestCheckResourceAttrSet("flagsmith_segment.test_segment", "uuid"), resource.TestCheckResourceAttrSet("flagsmith_segment.test_segment", "project_id"), resource.TestCheckNoResourceAttr("flagsmith_segment.test_segment", "feature_id"), - - ), }, }, }) } - - func getSegmentImportID(n string) resource.ImportStateIdFunc { return func(s *terraform.State) (string, error) { - return getUUIDfromState(s, n) + return getAttributefromState(s, n, "uuid") } } func testAccCheckSegmentResourceDestroy(s *terraform.State) error { - uuid, err := getUUIDfromState(s, "flagsmith_segment.test_segment") + uuid, err := getAttributefromState(s, "flagsmith_segment.test_segment", "uuid") if err != nil { return err } @@ -114,11 +105,8 @@ func testAccCheckSegmentResourceDestroy(s *terraform.State) error { } return nil - - } - func testAccSegmentResourceConfig(segmentName, description string) string { return fmt.Sprintf(` provider "flagsmith" { @@ -149,5 +137,3 @@ resource "flagsmith_segment" "test_segment" { `, segmentName, description, projectUUID()) } - - diff --git a/flagsmith/resource_tag.go b/flagsmith/resource_tag.go new file mode 100644 index 0000000..83eff9e --- /dev/null +++ b/flagsmith/resource_tag.go @@ -0,0 +1,211 @@ +package flagsmith + +import ( + "context" + "fmt" + "github.com/Flagsmith/flagsmith-go-api-client" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "strings" + + "github.com/hashicorp/terraform-plugin-framework/resource/schema/int64planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-log/tflog" +) + +// Ensure provider defined types fully satisfy framework interfaces +var _ resource.Resource = &tagResource{} +var _ resource.ResourceWithImportState = &tagResource{} + +func newTagResource() resource.Resource { + return &tagResource{} +} + +type tagResource struct { + client *flagsmithapi.Client +} + +func (r *tagResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_tag" +} + +func (r *tagResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + // Prevent panic if the provider has not been configured. + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(*flagsmithapi.Client) + if !ok { + resp.Diagnostics.AddError( + "Unexpected Resource Configure Type", + fmt.Sprintf("Expected *flagsmithapi.Client, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + return + } + + r.client = client +} + +func (t *tagResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + // This description is used by the documentation generator and the language server. + MarkdownDescription: "Flagsmith Tag", + + Attributes: map[string]schema.Attribute{ + "id": schema.Int64Attribute{ + Computed: true, + MarkdownDescription: "ID of the tag", + PlanModifiers: []planmodifier.Int64{int64planmodifier.UseStateForUnknown()}, + }, + "uuid": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UUID of the tag", + PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, + }, + "project_id": schema.Int64Attribute{ + Computed: true, + MarkdownDescription: "ID of the project", + PlanModifiers: []planmodifier.Int64{int64planmodifier.UseStateForUnknown()}, + }, + "tag_name": schema.StringAttribute{ + Required: true, + MarkdownDescription: "Name of the tag", + }, + "tag_colour": schema.StringAttribute{ + Required: true, + MarkdownDescription: "Hexadecimal value of the tag color", + }, + "description": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Description of the feature", + }, + "project_uuid": schema.StringAttribute{ + MarkdownDescription: "UUID of project the tag belongs to", + Required: true, + PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, + }, + }, + } +} + +func (r *tagResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var data TagResourceData + + diags := req.Config.Get(ctx, &data) + resp.Diagnostics.Append(diags...) + + if resp.Diagnostics.HasError() { + return + } + + clientTag := data.ToClientTag() + + err := r.client.CreateTag(clientTag) + + if err != nil { + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to create tag, got error: %s", err)) + return + } + resourceData := MakeTagResourceDataFromClientTag(clientTag) + + diags = resp.State.Set(ctx, &resourceData) + resp.Diagnostics.Append(diags...) +} + +func (r *tagResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var data TagResourceData + diags := req.State.Get(ctx, &data) + resp.Diagnostics.Append(diags...) + + // Early return if the state is wrong + if diags.HasError() { + return + } + + tag, err := r.client.GetTag(data.ProjectUUID.ValueString(), data.UUID.ValueString()) + if err != nil { + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to read tag, got error: %s", err)) + return + + } + resourceData := MakeTagResourceDataFromClientTag(tag) + + diags = resp.State.Set(ctx, &resourceData) + resp.Diagnostics.Append(diags...) + +} +func (r *tagResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + //Get plan values + var plan TagResourceData + diags := req.Plan.Get(ctx, &plan) + resp.Diagnostics.Append(diags...) + + if resp.Diagnostics.HasError() { + tflog.Error(ctx, "Update: Error reading plan data") + return + } + + // Get current state + var state TagResourceData + diags = req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + + if resp.Diagnostics.HasError() { + tflog.Error(ctx, "Update: Error reading state data") + return + } + // Generate API request body from plan + clientTag := plan.ToClientTag() + + err := r.client.UpdateTag(clientTag) + if err != nil { + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to update tag, got error: %s", err)) + return + } + + resourceData := MakeTagResourceDataFromClientTag(clientTag) + + // Update the state with the new values + diags = resp.State.Set(ctx, &resourceData) + + resp.Diagnostics.Append(diags...) + +} + +func (r *tagResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + // Get current state + var state TagResourceData + diags := req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + + if resp.Diagnostics.HasError() { + tflog.Error(ctx, "Delete: Error reading state data") + return + } + // Generate API request body from plan + clientFeature := state.ToClientTag() + + err := r.client.DeleteTag(*clientFeature.ProjectID, *clientFeature.ID) + if err != nil { + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to delete tag, got error: %s", err)) + return + } + resp.State.RemoveResource(ctx) + +} +func (r *tagResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + importKey := strings.Split(req.ID, ",") + if len(importKey) != 2 || importKey[0] == "" || importKey[1] == "" { + resp.Diagnostics.AddError( + "Unexpected Import Identifier", + fmt.Sprintf("Expected import identifier with format: project_uuid,tag_uuid Got: %q", req.ID), + ) + return + } + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("project_uuid"), importKey[0])...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("uuid"), importKey[1])...) + +} diff --git a/flagsmith/resource_tag_test.go b/flagsmith/resource_tag_test.go new file mode 100644 index 0000000..bb4f958 --- /dev/null +++ b/flagsmith/resource_tag_test.go @@ -0,0 +1,118 @@ +package flagsmith_test + +import ( + "fmt" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "testing" +) + +func TestAccTagResource(t *testing.T) { + tagName := acctest.RandString(16) + tagColour := "#f1d502" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + CheckDestroy: testAccCheckTagResourceDestroy, + Steps: []resource.TestStep{ + // Create and Read testing + { + Config: testAccTagResourceConfig(tagName, tagColour, "tag description"), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("flagsmith_tag.test_tag", "tag_name", tagName), + resource.TestCheckResourceAttr("flagsmith_tag.test_tag", "description", "tag description"), + resource.TestCheckResourceAttr("flagsmith_tag.test_tag", "tag_colour", tagColour), + resource.TestCheckResourceAttr("flagsmith_tag.test_tag", "project_uuid", projectUUID()), + + resource.TestCheckResourceAttrSet("flagsmith_tag.test_tag", "id"), + resource.TestCheckResourceAttrSet("flagsmith_tag.test_tag", "uuid"), + resource.TestCheckResourceAttrSet("flagsmith_tag.test_tag", "project_id"), + ), + }, + + // ImportState testing + { + ResourceName: "flagsmith_tag.test_tag", + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: getTagImportID("flagsmith_tag.test_tag"), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("flagsmith_tag.test_tag", "tag_name", tagName), + resource.TestCheckResourceAttr("flagsmith_tag.test_tag", "tag_colour", tagColour), + resource.TestCheckResourceAttr("flagsmith_tag.test_tag", "description", "new tag descriptionnnnn"), + resource.TestCheckResourceAttr("flagsmith_tag.test_tag", "project_uuid", projectUUID()), + + resource.TestCheckResourceAttrSet("flagsmith_tag.test_tag", "id"), + resource.TestCheckResourceAttrSet("flagsmith_tag.test_tag", "uuid"), + resource.TestCheckResourceAttrSet("flagsmith_tag.test_tag", "project_id"), + ), + }, + + // Update testing + { + Config: testAccTagResourceConfig(tagName, tagColour, "updated tag description"), + Check: resource.ComposeAggregateTestCheckFunc( + + resource.TestCheckResourceAttr("flagsmith_tag.test_tag", "tag_name", tagName), + resource.TestCheckResourceAttr("flagsmith_tag.test_tag", "description", "updated tag description"), + resource.TestCheckResourceAttr("flagsmith_tag.test_tag", "tag_colour", tagColour), + resource.TestCheckResourceAttr("flagsmith_tag.test_tag", "project_uuid", projectUUID()), + + resource.TestCheckResourceAttrSet("flagsmith_tag.test_tag", "id"), + resource.TestCheckResourceAttrSet("flagsmith_tag.test_tag", "uuid"), + resource.TestCheckResourceAttrSet("flagsmith_tag.test_tag", "project_id"), + ), + }, + }, + }) +} + +func testAccTagResourceConfig(tagName, tagColour, description string) string { + return fmt.Sprintf(` +provider "flagsmith" { + +} + +resource "flagsmith_tag" "test_tag" { + tag_name = "%s" + tag_colour = "%s" + description = "%s" + project_uuid = "%s" +} + +`, tagName, tagColour, description, projectUUID()) +} + +func testAccCheckTagResourceDestroy(s *terraform.State) error { + uuid, err := getAttributefromState(s, "flagsmith_tag.test_tag", "uuid") + projectUUID, err := getAttributefromState(s, "flagsmith_tag.test_tag", "project_uuid") + + if err != nil { + return err + } + + _, err = testClient().GetTag(projectUUID, uuid) + if err == nil { + return fmt.Errorf("tag still exists") + } + return nil + +} +func getTagImportID(n string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + // return a string in the format of projectUUID,tagUUID + projectUUID, err := getAttributefromState(s, n, "project_uuid") + if err != nil { + return "", err + } + tagUUID, err := getAttributefromState(s, n, "uuid") + if err != nil { + return "", err + } + return fmt.Sprintf("%s,%s", projectUUID, tagUUID), nil + + } +} diff --git a/go.mod b/go.mod index 6b4edc5..bfdeeba 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/Flagsmith/terraform-provider-flagsmith go 1.20 require ( - github.com/Flagsmith/flagsmith-go-api-client v0.7.1 - github.com/hashicorp/terraform-plugin-docs v0.16.0 + github.com/Flagsmith/flagsmith-go-api-client v0.8.0 + github.com/hashicorp/terraform-plugin-docs v0.18.0 github.com/hashicorp/terraform-plugin-framework v1.5.0 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 github.com/hashicorp/terraform-plugin-go v0.21.0 @@ -15,21 +15,23 @@ require ( ) require ( + github.com/Kunde21/markdownfmt/v3 v3.1.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.1.1 // indirect - github.com/Masterminds/sprig/v3 v3.2.2 // indirect + github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect github.com/agext/levenshtein v1.2.2 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/armon/go-radix v1.0.0 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect - github.com/cloudflare/circl v1.3.3 // indirect + github.com/cloudflare/circl v1.3.7 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fatih/color v1.13.0 // indirect - github.com/go-resty/resty/v2 v2.7.0 // indirect + github.com/fatih/color v1.16.0 // indirect + github.com/go-resty/resty/v2 v2.11.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/uuid v1.4.0 // indirect + github.com/hashicorp/cli v1.1.6 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -42,16 +44,16 @@ require ( github.com/hashicorp/hc-install v0.6.2 // indirect github.com/hashicorp/hcl/v2 v2.19.1 // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-exec v0.19.0 // indirect - github.com/hashicorp/terraform-json v0.18.0 // indirect + github.com/hashicorp/terraform-exec v0.20.0 // indirect + github.com/hashicorp/terraform-json v0.21.0 // indirect github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect - github.com/huandu/xstrings v1.3.2 // indirect + github.com/huandu/xstrings v1.3.3 // indirect github.com/imdario/mergo v0.3.15 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect - github.com/mitchellh/cli v1.1.5 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect @@ -66,16 +68,19 @@ require ( github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + github.com/yuin/goldmark v1.6.0 // indirect + github.com/yuin/goldmark-meta v1.1.0 // indirect github.com/zclconf/go-cty v1.14.1 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.18.0 // indirect + golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect google.golang.org/grpc v1.61.0 // indirect google.golang.org/protobuf v1.32.0 // indirect + gopkg.in/yaml.v2 v2.3.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 9d053a9..0a127a8 100644 --- a/go.sum +++ b/go.sum @@ -1,13 +1,14 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= -github.com/Flagsmith/flagsmith-go-api-client v0.7.1 h1:JV5L9MOP0xSpvdJ/kFslHD5giHoLhF500Hw02V8IN7M= -github.com/Flagsmith/flagsmith-go-api-client v0.7.1/go.mod h1:rXk/ipXHVus0dvFrnhpYlbrCERpgY8UBhdLfOwpFwWo= +github.com/Flagsmith/flagsmith-go-api-client v0.8.0 h1:IUHzsUEQjb0+XvrJiVQZj86vRJlhZUmhHO5tGOFDzcI= +github.com/Flagsmith/flagsmith-go-api-client v0.8.0/go.mod h1:T+Vcd9tL6TxqHovTzoy9V1rGS7cKrM9u6XntK+7gh8Q= +github.com/Kunde21/markdownfmt/v3 v3.1.0 h1:KiZu9LKs+wFFBQKhrZJrFZwtLnCCWJahL+S+E/3VnM0= +github.com/Kunde21/markdownfmt/v3 v3.1.0/go.mod h1:tPXN1RTyOzJwhfHoon9wUr4HGYmWgVxSQN6VBJDkrVc= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= -github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= -github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= +github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= +github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= @@ -16,29 +17,29 @@ github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= github.com/go-git/go-git/v5 v5.10.1 h1:tu8/D8i+TWxgKpzQ3Vc43e+kkhXqtsZCKI/egajKnxk= -github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= -github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= +github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqxT/8= +github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -51,9 +52,10 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/cli v1.1.6 h1:CMOV+/LJfL1tXCOKrgAX0uRKnzjj/mpmqNXloRSy2K8= +github.com/hashicorp/cli v1.1.6/go.mod h1:MPon5QYlgjjo0BSoAiN0ESeT5fRzDjVRp+uioJ0piz4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -82,12 +84,12 @@ github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5R github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-exec v0.19.0 h1:FpqZ6n50Tk95mItTSS9BjeOVUb4eg81SpgVtZNNtFSM= -github.com/hashicorp/terraform-exec v0.19.0/go.mod h1:tbxUpe3JKruE9Cuf65mycSIT8KiNPZ0FkuTE3H4urQg= -github.com/hashicorp/terraform-json v0.18.0 h1:pCjgJEqqDESv4y0Tzdqfxr/edOIGkjs8keY42xfNBwU= -github.com/hashicorp/terraform-json v0.18.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= -github.com/hashicorp/terraform-plugin-docs v0.16.0 h1:UmxFr3AScl6Wged84jndJIfFccGyBZn52KtMNsS12dI= -github.com/hashicorp/terraform-plugin-docs v0.16.0/go.mod h1:M3ZrlKBJAbPMtNOPwHicGi1c+hZUh7/g0ifT/z7TVfA= +github.com/hashicorp/terraform-exec v0.20.0 h1:DIZnPsqzPGuUnq6cH8jWcPunBfY+C+M8JyYF3vpnuEo= +github.com/hashicorp/terraform-exec v0.20.0/go.mod h1:ckKGkJWbsNqFKV1itgMnE0hY9IYf1HoiekpuN0eWoDw= +github.com/hashicorp/terraform-json v0.21.0 h1:9NQxbLNqPbEMze+S6+YluEdXgJmhQykRyRNd+zTI05U= +github.com/hashicorp/terraform-json v0.21.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= +github.com/hashicorp/terraform-plugin-docs v0.18.0 h1:2bINhzXc+yDeAcafurshCrIjtdu1XHn9zZ3ISuEhgpk= +github.com/hashicorp/terraform-plugin-docs v0.18.0/go.mod h1:iIUfaJpdUmpi+rI42Kgq+63jAjI8aZVTyxp3Bvk9Hg8= github.com/hashicorp/terraform-plugin-framework v1.5.0 h1:8kcvqJs/x6QyOFSdeAyEgsenVOUeC/IyKpi2ul4fjTg= github.com/hashicorp/terraform-plugin-framework v1.5.0/go.mod h1:6waavirukIlFpVpthbGd2PUNYaFedB0RwW3MDzJ/rtc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= @@ -104,9 +106,8 @@ github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= -github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= +github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= @@ -119,18 +120,17 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng= -github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= @@ -148,10 +148,9 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= @@ -166,7 +165,6 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= @@ -179,16 +177,20 @@ github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAh github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/goldmark v1.6.0 h1:boZcn2GTjpsynOsC0iJHnBWa4Bi0qzfJjthwauItG68= +github.com/yuin/goldmark v1.6.0/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= +github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA= github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -198,23 +200,22 @@ golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -226,6 +227,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -233,18 +236,23 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= @@ -268,7 +276,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=