-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FFM-9404: harness_platform_feature_flag cannot add targeting rules #699
Conversation
c4c01bd
to
5248fec
Compare
I took my flag resource that was working before (working as in the flag was created, but the targeting rules were not working) and I am getting an error when now trying to create the flag with this patch. tf debug logs```details 2023-09-19T07:47:49.970-0500 [INFO] Terraform version: 1.4.6 2023-09-19T07:47:49.971-0500 [DEBUG] using github.com/hashicorp/go-tfe v1.21.0 2023-09-19T07:47:49.971-0500 [DEBUG] using github.com/hashicorp/hcl/v2 v2.16.2 2023-09-19T07:47:49.971-0500 [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2 2023-09-19T07:47:49.971-0500 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.0 2023-09-19T07:47:49.971-0500 [DEBUG] using github.com/zclconf/go-cty v1.12.1 2023-09-19T07:47:49.971-0500 [INFO] Go runtime version: go1.19.6 2023-09-19T07:47:49.971-0500 [INFO] CLI args: []string{"/opt/homebrew/Cellar/tfenv/3.0.0/versions/1.4.6/terraform", "apply"} 2023-09-19T07:47:49.971-0500 [DEBUG] Attempting to open CLI config file: /Users/rileysnyder/.terraformrc 2023-09-19T07:47:49.971-0500 [INFO] Loading CLI configuration from /Users/rileysnyder/.terraformrc 2023-09-19T07:47:49.971-0500 [DEBUG] checking for credentials in "/Users/rileysnyder/.terraform.d/plugins" 2023-09-19T07:47:49.971-0500 [DEBUG] Explicit provider installation configuration is set 2023-09-19T07:47:49.972-0500 [INFO] CLI command args: []string{"apply"} 2023-09-19T07:47:49.973-0500 [DEBUG] New state was assigned lineage "42ab36b3-9471-13d6-02b2-f6e374c4ce6f" 2023-09-19T07:47:49.973-0500 [DEBUG] Provider registry.terraform.io/harness/harness is overridden by dev_overrides 2023-09-19T07:47:49.973-0500 [DEBUG] Provider registry.terraform.io/harness/harness is overridden to load from /Users/rileysnyder/git/terraform-provider-harness 2023-09-19T07:47:49.973-0500 [DEBUG] checking for provisioner in "." 2023-09-19T07:47:49.973-0500 [DEBUG] checking for provisioner in "/opt/homebrew/Cellar/tfenv/3.0.0/versions/1.4.6" 2023-09-19T07:47:49.973-0500 [DEBUG] checking for provisioner in "/Users/rileysnyder/.terraform.d/plugins" 2023-09-19T07:47:49.973-0500 [DEBUG] Provider registry.terraform.io/harness/harness is overridden by dev_overrides ╷ │ Warning: Provider development overrides are in effect │ │ The following provider development overrides are set in the CLI configuration: │ - harness/harness in /Users/rileysnyder/git/terraform-provider-harness │ │ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with published releases. ╵ 2023-09-19T07:47:49.974-0500 [INFO] backend/local: starting Apply operation 2023-09-19T07:47:49.977-0500 [DEBUG] Config.VerifyDependencySelections: skipping registry.terraform.io/harness/harness because it's overridden by a special configuration setting 2023-09-19T07:47:49.978-0500 [DEBUG] created provider logger: level=debug 2023-09-19T07:47:49.978-0500 [INFO] provider: configuring client automatic mTLS 2023-09-19T07:47:49.988-0500 [DEBUG] provider: starting plugin: path=/Users/rileysnyder/git/terraform-provider-harness/terraform-provider-harness_v0.0.1 args=[/Users/rileysnyder/git/terraform-provider-harness/terraform-provider-harness_v0.0.1] 2023-09-19T07:47:49.991-0500 [DEBUG] provider: plugin started: path=/Users/rileysnyder/git/terraform-provider-harness/terraform-provider-harness_v0.0.1 pid=54131 2023-09-19T07:47:49.991-0500 [DEBUG] provider: waiting for RPC address: path=/Users/rileysnyder/git/terraform-provider-harness/terraform-provider-harness_v0.0.1 2023-09-19T07:47:50.001-0500 [INFO] provider.terraform-provider-harness_v0.0.1: configuring server automatic mTLS: timestamp=2023-09-19T07:47:50.001-0500 2023-09-19T07:47:50.013-0500 [DEBUG] provider: using plugin: version=5 2023-09-19T07:47:50.013-0500 [DEBUG] provider.terraform-provider-harness_v0.0.1: plugin address: address=/var/folders/54/4rq2vpp528scs1vqrd8485rh0000gp/T/plugin340928087 network=unix timestamp=2023-09-19T07:47:50.013-0500 2023-09-19T07:47:50.037-0500 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF" 2023-09-19T07:47:50.038-0500 [DEBUG] provider: plugin process exited: path=/Users/rileysnyder/git/terraform-provider-harness/terraform-provider-harness_v0.0.1 pid=54131 2023-09-19T07:47:50.038-0500 [DEBUG] provider: plugin exited 2023-09-19T07:47:50.038-0500 [DEBUG] Building and walking validate graph 2023-09-19T07:47:50.038-0500 [DEBUG] ProviderTransformer: "harness_platform_project.test" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.038-0500 [DEBUG] ProviderTransformer: "harness_platform_environment.dev" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.038-0500 [DEBUG] ProviderTransformer: "harness_platform_feature_flag_target.target1" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.038-0500 [DEBUG] ProviderTransformer: "harness_platform_feature_flag.flag2" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.038-0500 [DEBUG] ProviderTransformer: "harness_platform_feature_flag_target_group.targetgroup" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.038-0500 [DEBUG] ProviderTransformer: "harness_platform_feature_flag_target.target" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.038-0500 [DEBUG] ProviderTransformer: "data.harness_current_account.current" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.038-0500 [DEBUG] ProviderTransformer: "data.harness_platform_organization.test" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.038-0500 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/harness/harness\"]" references: [] 2023-09-19T07:47:50.038-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag_target.target" references: [data.harness_platform_organization.test harness_platform_project.test data.harness_current_account.current harness_platform_environment.dev] 2023-09-19T07:47:50.038-0500 [DEBUG] ReferenceTransformer: "data.harness_current_account.current" references: [] 2023-09-19T07:47:50.038-0500 [DEBUG] ReferenceTransformer: "data.harness_platform_organization.test" references: [] 2023-09-19T07:47:50.038-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag.flag2" references: [harness_platform_project.test data.harness_platform_organization.test harness_platform_feature_flag_target.target harness_platform_feature_flag_target.target1] 2023-09-19T07:47:50.038-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag_target_group.targetgroup" references: [harness_platform_project.test harness_platform_feature_flag_target.target1 harness_platform_environment.dev data.harness_platform_organization.test data.harness_current_account.current harness_platform_feature_flag_target.target] 2023-09-19T07:47:50.038-0500 [DEBUG] ReferenceTransformer: "harness_platform_project.test" references: [data.harness_platform_organization.test] 2023-09-19T07:47:50.038-0500 [DEBUG] ReferenceTransformer: "harness_platform_environment.dev" references: [data.harness_platform_organization.test harness_platform_project.test data.harness_platform_organization.test harness_platform_project.test] 2023-09-19T07:47:50.038-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag_target.target1" references: [data.harness_platform_organization.test harness_platform_project.test data.harness_current_account.current harness_platform_environment.dev] 2023-09-19T07:47:50.039-0500 [DEBUG] Starting graph walk: walkValidate 2023-09-19T07:47:50.039-0500 [DEBUG] created provider logger: level=debug 2023-09-19T07:47:50.039-0500 [INFO] provider: configuring client automatic mTLS 2023-09-19T07:47:50.043-0500 [DEBUG] provider: starting plugin: path=/Users/rileysnyder/git/terraform-provider-harness/terraform-provider-harness_v0.0.1 args=[/Users/rileysnyder/git/terraform-provider-harness/terraform-provider-harness_v0.0.1] 2023-09-19T07:47:50.046-0500 [DEBUG] provider: plugin started: path=/Users/rileysnyder/git/terraform-provider-harness/terraform-provider-harness_v0.0.1 pid=54132 2023-09-19T07:47:50.046-0500 [DEBUG] provider: waiting for RPC address: path=/Users/rileysnyder/git/terraform-provider-harness/terraform-provider-harness_v0.0.1 2023-09-19T07:47:50.060-0500 [INFO] provider.terraform-provider-harness_v0.0.1: configuring server automatic mTLS: timestamp=2023-09-19T07:47:50.060-0500 2023-09-19T07:47:50.072-0500 [DEBUG] provider: using plugin: version=5 2023-09-19T07:47:50.072-0500 [DEBUG] provider.terraform-provider-harness_v0.0.1: plugin address: address=/var/folders/54/4rq2vpp528scs1vqrd8485rh0000gp/T/plugin2977832583 network=unix timestamp=2023-09-19T07:47:50.072-0500 2023-09-19T07:47:50.098-0500 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF" 2023-09-19T07:47:50.099-0500 [DEBUG] provider: plugin process exited: path=/Users/rileysnyder/git/terraform-provider-harness/terraform-provider-harness_v0.0.1 pid=54132 2023-09-19T07:47:50.099-0500 [DEBUG] provider: plugin exited 2023-09-19T07:47:50.099-0500 [INFO] backend/local: apply calling Plan 2023-09-19T07:47:50.099-0500 [DEBUG] Building and walking plan graph for NormalMode 2023-09-19T07:47:50.099-0500 [DEBUG] ProviderTransformer: "data.harness_platform_organization.test (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.099-0500 [DEBUG] ProviderTransformer: "harness_platform_feature_flag.flag2 (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.099-0500 [DEBUG] ProviderTransformer: "harness_platform_feature_flag_target.target1 (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.099-0500 [DEBUG] ProviderTransformer: "harness_platform_project.test (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.099-0500 [DEBUG] ProviderTransformer: "harness_platform_feature_flag_target.target (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.099-0500 [DEBUG] ProviderTransformer: "harness_platform_feature_flag_target_group.targetgroup (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.099-0500 [DEBUG] ProviderTransformer: "harness_platform_environment.dev (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.099-0500 [DEBUG] ProviderTransformer: "data.harness_current_account.current (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.099-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag.flag2 (expand)" references: [harness_platform_project.test (expand) data.harness_platform_organization.test (expand) harness_platform_feature_flag_target.target (expand) harness_platform_feature_flag_target.target1 (expand)] 2023-09-19T07:47:50.099-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag_target_group.targetgroup (expand)" references: [data.harness_current_account.current (expand) harness_platform_feature_flag_target.target (expand) harness_platform_project.test (expand) harness_platform_environment.dev (expand) data.harness_platform_organization.test (expand) harness_platform_feature_flag_target.target1 (expand)] 2023-09-19T07:47:50.099-0500 [DEBUG] ReferenceTransformer: "harness_platform_environment.dev (expand)" references: [data.harness_platform_organization.test (expand) harness_platform_project.test (expand) data.harness_platform_organization.test (expand) harness_platform_project.test (expand)] 2023-09-19T07:47:50.099-0500 [DEBUG] ReferenceTransformer: "data.harness_current_account.current (expand)" references: [] 2023-09-19T07:47:50.099-0500 [DEBUG] ReferenceTransformer: "data.harness_platform_organization.test (expand)" references: [] 2023-09-19T07:47:50.099-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag_target.target (expand)" references: [data.harness_current_account.current (expand) harness_platform_environment.dev (expand) data.harness_platform_organization.test (expand) harness_platform_project.test (expand)] 2023-09-19T07:47:50.099-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag_target.target1 (expand)" references: [harness_platform_environment.dev (expand) data.harness_platform_organization.test (expand) harness_platform_project.test (expand) data.harness_current_account.current (expand)] 2023-09-19T07:47:50.099-0500 [DEBUG] ReferenceTransformer: "harness_platform_project.test (expand)" references: [data.harness_platform_organization.test (expand)] 2023-09-19T07:47:50.099-0500 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/harness/harness\"]" references: [] 2023-09-19T07:47:50.100-0500 [DEBUG] Starting graph walk: walkPlan 2023-09-19T07:47:50.100-0500 [DEBUG] created provider logger: level=debug 2023-09-19T07:47:50.100-0500 [INFO] provider: configuring client automatic mTLS 2023-09-19T07:47:50.104-0500 [DEBUG] provider: starting plugin: path=/Users/rileysnyder/git/terraform-provider-harness/terraform-provider-harness_v0.0.1 args=[/Users/rileysnyder/git/terraform-provider-harness/terraform-provider-harness_v0.0.1] 2023-09-19T07:47:50.107-0500 [DEBUG] provider: plugin started: path=/Users/rileysnyder/git/terraform-provider-harness/terraform-provider-harness_v0.0.1 pid=54133 2023-09-19T07:47:50.107-0500 [DEBUG] provider: waiting for RPC address: path=/Users/rileysnyder/git/terraform-provider-harness/terraform-provider-harness_v0.0.1 2023-09-19T07:47:50.118-0500 [INFO] provider.terraform-provider-harness_v0.0.1: configuring server automatic mTLS: timestamp=2023-09-19T07:47:50.117-0500 2023-09-19T07:47:50.130-0500 [DEBUG] provider: using plugin: version=5 2023-09-19T07:47:50.130-0500 [DEBUG] provider.terraform-provider-harness_v0.0.1: plugin address: address=/var/folders/54/4rq2vpp528scs1vqrd8485rh0000gp/T/plugin2795307447 network=unix timestamp=2023-09-19T07:47:50.130-0500 2023-09-19T07:47:50.153-0500 [WARN] ValidateProviderConfig from "provider[\"registry.terraform.io/harness/harness\"]" changed the config value, but that value is unused 2023-09-19T07:47:50.154-0500 [DEBUG] ReferenceTransformer: "data.harness_platform_organization.test" references: [] 2023-09-19T07:47:50.154-0500 [DEBUG] ReferenceTransformer: "data.harness_current_account.current" references: [] data.harness_current_account.current: Reading... data.harness_platform_organization.test: Reading... 2023-09-19T07:47:50.155-0500 [DEBUG] provider.terraform-provider-harness_v0.0.1: 2023/09/19 07:47:50 [DEBUG] GET https://app.harness.io/gateway/ng/api/organizations/test?accountIdentifier=wlgELJ0TTre5aZhzpt8gVA data.harness_current_account.current: Read complete after 0s [id=wlgELJ0TTre5aZhzpt8gVA] data.harness_platform_organization.test: Read complete after 0s [id=test] 2023-09-19T07:47:50.363-0500 [DEBUG] ReferenceTransformer: "harness_platform_project.test" references: [] harness_platform_project.test: Refreshing state... [id=testproject] 2023-09-19T07:47:50.366-0500 [DEBUG] provider.terraform-provider-harness_v0.0.1: 2023/09/19 07:47:50 [DEBUG] GET https://app.harness.io/gateway/ng/api/projects/testproject?accountIdentifier=wlgELJ0TTre5aZhzpt8gVA&orgIdentifier=test 2023-09-19T07:47:50.481-0500 [WARN] Provider "registry.terraform.io/harness/harness" produced an invalid plan for harness_platform_project.test, but we are tolerating it because it is using the legacy plugin SDK. The following problems may be the cause of any confusing errors from downstream operations: - .description: planned value cty.StringVal("") for a non-computed attribute - .tags: planned value cty.SetValEmpty(cty.String) for a non-computed attribute 2023-09-19T07:47:50.482-0500 [DEBUG] ReferenceTransformer: "harness_platform_environment.dev" references: [] harness_platform_environment.dev: Refreshing state... [id=dev1] 2023-09-19T07:47:50.484-0500 [DEBUG] provider.terraform-provider-harness_v0.0.1: 2023/09/19 07:47:50 [DEBUG] GET https://app.harness.io/gateway/ng/api/environmentsV2/dev1?accountIdentifier=wlgELJ0TTre5aZhzpt8gVA&orgIdentifier=test&projectIdentifier=testproject 2023-09-19T07:47:50.591-0500 [WARN] Provider "registry.terraform.io/harness/harness" produced an invalid plan for harness_platform_environment.dev, but we are tolerating it because it is using the legacy plugin SDK. The following problems may be the cause of any confusing errors from downstream operations: - .description: planned value cty.StringVal("") for a non-computed attribute - .tags: planned value cty.SetValEmpty(cty.String) for a non-computed attribute 2023-09-19T07:47:50.591-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag_target.target" references: [] 2023-09-19T07:47:50.591-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag_target.target1" references: [] harness_platform_feature_flag_target.target1: Refreshing state... [id=target1] harness_platform_feature_flag_target.target: Refreshing state... [id=target] 2023-09-19T07:47:50.593-0500 [DEBUG] provider.terraform-provider-harness_v0.0.1: 2023/09/19 07:47:50 [DEBUG] GET https://app.harness.io/gateway/cf/admin/targets/target?accountIdentifier=wlgELJ0TTre5aZhzpt8gVA&environmentIdentifier=dev1&orgIdentifier=test&projectIdentifier=testproject 2023-09-19T07:47:50.593-0500 [DEBUG] provider.terraform-provider-harness_v0.0.1: 2023/09/19 07:47:50 [DEBUG] GET https://app.harness.io/gateway/cf/admin/targets/target1?accountIdentifier=wlgELJ0TTre5aZhzpt8gVA&environmentIdentifier=dev1&orgIdentifier=test&projectIdentifier=testproject 2023-09-19T07:47:50.753-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag_target_group.targetgroup" references: [] 2023-09-19T07:47:50.753-0500 [DEBUG] Resource instance state not found for node "harness_platform_feature_flag.flag2", instance harness_platform_feature_flag.flag2 2023-09-19T07:47:50.754-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag.flag2" references: [] 2023-09-19T07:47:50.754-0500 [DEBUG] refresh: harness_platform_feature_flag.flag2: no state, so not refreshing harness_platform_feature_flag_target_group.targetgroup: Refreshing state... [id=targetgroup] 2023-09-19T07:47:50.756-0500 [DEBUG] provider.terraform-provider-harness_v0.0.1: 2023/09/19 07:47:50 [DEBUG] GET https://app.harness.io/gateway/cf/admin/segments/targetgroup?accountIdentifier=wlgELJ0TTre5aZhzpt8gVA&environmentIdentifier=dev1&orgIdentifier=test&projectIdentifier=testproject 2023-09-19T07:47:50.858-0500 [INFO] provider.terraform-provider-harness_v0.0.1: 2023/09/19 07:47:50 [ERROR] setting state: Invalid address to set: []string{"project"}: timestamp=2023-09-19T07:47:50.858-0500 2023-09-19T07:47:50.859-0500 [INFO] provider.terraform-provider-harness_v0.0.1: 2023/09/19 07:47:50 [ERROR] setting state: included.0: '' expected type 'string', got unconvertible type 'nextgen.Target', value: '{ false 0 target target []}': timestamp=2023-09-19T07:47:50.858-0500 2023-09-19T07:47:50.859-0500 [INFO] provider.terraform-provider-harness_v0.0.1: 2023/09/19 07:47:50 [ERROR] setting state: excluded.0: '' expected type 'string', got unconvertible type 'nextgen.Target', value: '{ false 0 target1 target1 []}': timestamp=2023-09-19T07:47:50.858-0500 2023-09-19T07:47:50.859-0500 [INFO] provider.terraform-provider-harness_v0.0.1: 2023/09/19 07:47:50 [ERROR] setting state: Invalid address to set: []string{"rules"}: timestamp=2023-09-19T07:47:50.858-0500 2023-09-19T07:47:50.862-0500 [WARN] Provider "registry.terraform.io/harness/harness" produced an invalid plan for harness_platform_feature_flag_target_group.targetgroup, but we are tolerating it because it is using the legacy plugin SDK. The following problems may be the cause of any confusing errors from downstream operations: - .rule[0].negate: planned value cty.False for a non-computed attribute - .rule[1].negate: planned value cty.False for a non-computed attribute 2023-09-19T07:47:50.864-0500 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF" 2023-09-19T07:47:50.867-0500 [DEBUG] provider: plugin process exited: path=/Users/rileysnyder/git/terraform-provider-harness/terraform-provider-harness_v0.0.1 pid=54133 2023-09-19T07:47:50.867-0500 [DEBUG] provider: plugin exited 2023-09-19T07:47:50.867-0500 [DEBUG] building apply graph to check for errors 2023-09-19T07:47:50.867-0500 [DEBUG] Resource state not found for node "harness_platform_feature_flag.flag2", instance harness_platform_feature_flag.flag2 2023-09-19T07:47:50.867-0500 [DEBUG] ProviderTransformer: "harness_platform_project.test (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.867-0500 [DEBUG] ProviderTransformer: "harness_platform_feature_flag_target.target1 (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.867-0500 [DEBUG] ProviderTransformer: "data.harness_platform_organization.test (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.867-0500 [DEBUG] ProviderTransformer: "harness_platform_environment.dev (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.867-0500 [DEBUG] ProviderTransformer: "harness_platform_feature_flag_target.target (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.867-0500 [DEBUG] ProviderTransformer: "harness_platform_feature_flag_target_group.targetgroup (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.867-0500 [DEBUG] ProviderTransformer: "harness_platform_feature_flag.flag2" (*terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.867-0500 [DEBUG] ProviderTransformer: "harness_platform_feature_flag.flag2 (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.868-0500 [DEBUG] ProviderTransformer: "data.harness_current_account.current (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/harness/harness"] 2023-09-19T07:47:50.868-0500 [DEBUG] ReferenceTransformer: "harness_platform_environment.dev (expand)" references: [] 2023-09-19T07:47:50.868-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag_target.target (expand)" references: [] 2023-09-19T07:47:50.868-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag_target_group.targetgroup (expand)" references: [] 2023-09-19T07:47:50.868-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag.flag2" references: [harness_platform_project.test (expand) data.harness_platform_organization.test (expand) harness_platform_feature_flag_target.target (expand) harness_platform_feature_flag_target.target1 (expand)] 2023-09-19T07:47:50.868-0500 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/harness/harness\"]" references: [] 2023-09-19T07:47:50.868-0500 [DEBUG] ReferenceTransformer: "harness_platform_project.test (expand)" references: [] 2023-09-19T07:47:50.868-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag_target.target1 (expand)" references: [] 2023-09-19T07:47:50.868-0500 [DEBUG] ReferenceTransformer: "harness_platform_feature_flag.flag2 (expand)" references: [] 2023-09-19T07:47:50.868-0500 [DEBUG] ReferenceTransformer: "data.harness_current_account.current (expand)" references: [] 2023-09-19T07:47:50.868-0500 [DEBUG] ReferenceTransformer: "data.harness_platform_organization.test (expand)" references: [] 2023-09-19T07:47:50.868-0500 [DEBUG] pruneUnusedNodes: harness_platform_environment.dev (expand) is no longer needed, removing 2023-09-19T07:47:50.868-0500 [DEBUG] pruneUnusedNodes: harness_platform_feature_flag_target_group.targetgroup (expand) is no longer needed, removing 2023-09-19T07:47:50.868-0500 [DEBUG] pruneUnusedNodes: data.harness_current_account.current (expand) is no longer needed, removingTerraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
Terraform will perform the following actions: harness_platform_feature_flag.flag2 will be created
Plan: 1 to add, 0 to change, 0 to destroy. Do you want to perform these actions? Enter a value: yes 2023-09-19T07:47:52.373-0500 [INFO] backend/local: apply calling Apply
|
@rssnyder I'm not certain, but is the environment here in the resource? If we add a rule it has to apply to an environment. I figure if its not supplied somewhere its likely to result in an error. |
Great point, I didn't even realize I wasn't referencing the environment anywhere. @ribeirophillipe it seems that the add_target_rule schema probably needs an environment reference somewhere, I am curious how you are getting this to work without it? |
@rssnyder I've added an "environment" to the schema for the target_flag... |
* Enable feature flags to configure targets * Update test cases * Fix bug in the distribution
5248fec
to
8ad3de2
Compare
internal/service/platform/feature_flag/resource_feature_flag.go
Outdated
Show resolved
Hide resolved
trigger subcategoryfieldcheck |
trigger gitleaks |
trigger build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. Distribution and Serve are now pointers. I understand that with this we can only add rules to a single env and the follow up PR will provide support for multiple envs.
Describe your changes
With this change, it is now possible to assign targets and target groups to feature flags on creation. Updates are still limited to the issue in FFM-9600, however, previously we failed to create rules due to an issue in the schema. This change fixes the schema for rules configuration during feature flag creation.
The test cases for this change include:
Comment Triggers
PR Check triggers
trigger build
trigger subcategoryfieldcheck
trigger gitleaks