Fix ecs.Service resource's external name configuration and update loop issue - #1950
Merged
sergenyalcin merged 1 commit intoJan 20, 2026
Merged
Conversation
…p issue Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
Collaborator
Author
|
/test-examples="examples/ecs/cluster/v1beta1/service.yaml" |
sergenyalcin
marked this pull request as ready for review
January 15, 2026 14:02
sergenyalcin
requested review from
erhancagirici,
jastang,
turkenf and
ulucinar
as code owners
January 15, 2026 14:02
erhancagirici
approved these changes
Jan 20, 2026
pyrex41
pushed a commit
to pyrex41/provider-upjet-aws
that referenced
this pull request
Feb 14, 2026
… a plain family name The TerraformCustomDiff handler for aws_ecs_service assumes taskDefinition is always an ARN containing "/". When set to a plain family name (e.g. "my-service"), strings.Split returns a single-element slice and tdParts[1] panics with index out of range. This panic is caught by controller-runtime's global recover, which silently prevents ALL drift detection on the resource while leaving the Synced condition at its previous value (True). No error is reported, no conditions are updated, and no reconciliation occurs — the resource appears healthy but is completely unmanaged. Add a bounds check on tdParts before accessing index 1. When taskDefinition is a plain family name (no "/"), the diff is passed through unchanged, letting Terraform handle the comparison normally. Fixes the panic introduced in crossplane-contrib#1950.
This was referenced Feb 14, 2026
Closed
erhancagirici
pushed a commit
to pyrex41/provider-upjet-aws
that referenced
this pull request
Mar 10, 2026
… a plain family name The TerraformCustomDiff handler for aws_ecs_service assumes taskDefinition is always an ARN containing "/". When set to a plain family name (e.g. "my-service"), strings.Split returns a single-element slice and tdParts[1] panics with index out of range. This panic is caught by controller-runtime's global recover, which silently prevents ALL drift detection on the resource while leaving the Synced condition at its previous value (True). No error is reported, no conditions are updated, and no reconciliation occurs — the resource appears healthy but is completely unmanaged. Add a bounds check on tdParts before accessing index 1. When taskDefinition is a plain family name (no "/"), the diff is passed through unchanged, letting Terraform handle the comparison normally. Fixes the panic introduced in crossplane-contrib#1950.
pyrex41
pushed a commit
to pyrex41/provider-upjet-aws
that referenced
this pull request
Mar 10, 2026
… a plain family name The TerraformCustomDiff handler for aws_ecs_service assumes taskDefinition is always an ARN containing "/". When set to a plain family name (e.g. "my-service"), strings.Split returns a single-element slice and tdParts[1] panics with index out of range. This panic is caught by controller-runtime's global recover, which silently prevents ALL drift detection on the resource while leaving the Synced condition at its previous value (True). No error is reported, no conditions are updated, and no reconciliation occurs — the resource appears healthy but is completely unmanaged. Add a bounds check on tdParts before accessing index 1 in both config/cluster/ecs/config.go and config/namespaced/ecs/config.go. When taskDefinition is a plain family name (no "/"), the diff is passed through unchanged, letting Terraform handle the comparison normally. Fixes the panic introduced in crossplane-contrib#1950. Signed-off-by: Reuben Brooks <reuben.brooks@facilitygrid.com>
erhancagirici
pushed a commit
to pyrex41/provider-upjet-aws
that referenced
this pull request
Mar 10, 2026
… a plain family name The TerraformCustomDiff handler for aws_ecs_service assumes taskDefinition is always an ARN containing "/". When set to a plain family name (e.g. "my-service"), strings.Split returns a single-element slice and tdParts[1] panics with index out of range. This panic is caught by controller-runtime's global recover, which silently prevents ALL drift detection on the resource while leaving the Synced condition at its previous value (True). No error is reported, no conditions are updated, and no reconciliation occurs — the resource appears healthy but is completely unmanaged. Add a bounds check on tdParts before accessing index 1 in both config/cluster/ecs/config.go and config/namespaced/ecs/config.go. When taskDefinition is a plain family name (no "/"), the diff is passed through unchanged, letting Terraform handle the comparison normally. Fixes the panic introduced in crossplane-contrib#1950. Signed-off-by: Reuben Brooks <reuben.brooks@facilitygrid.com>
erikmiller-gusto
pushed a commit
to erikmiller-gusto/provider-upjet-aws
that referenced
this pull request
Mar 25, 2026
… a plain family name The TerraformCustomDiff handler for aws_ecs_service assumes taskDefinition is always an ARN containing "/". When set to a plain family name (e.g. "my-service"), strings.Split returns a single-element slice and tdParts[1] panics with index out of range. This panic is caught by controller-runtime's global recover, which silently prevents ALL drift detection on the resource while leaving the Synced condition at its previous value (True). No error is reported, no conditions are updated, and no reconciliation occurs — the resource appears healthy but is completely unmanaged. Add a bounds check on tdParts before accessing index 1 in both config/cluster/ecs/config.go and config/namespaced/ecs/config.go. When taskDefinition is a plain family name (no "/"), the diff is passed through unchanged, letting Terraform handle the comparison normally. Fixes the panic introduced in crossplane-contrib#1950. Signed-off-by: Reuben Brooks <reuben.brooks@facilitygrid.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of your changes
This PR fixes the
ecs.Serviceresource's external name configuration and resolves an update loop issue caused by incorrect task definition reference handling.Problem
The ECS Service resource had two critical issues:
parameters.cluster+parameters.namefor ID construction. This didn't match the actual AWS resource ID format (the full ARN).Changes
External Name Configuration
GetExternalNameFnandGetIDFnfunctionsTemplatedStringAsIdentifierexisted, essentially mimicking what that function doesTemplatedStringAsIdentifierusing the proper ARN template:arn:aws:ecs:<region>:<account_id>:service/{{ .parameters.cluster }}/{{ .external_name }}GetIDFn):Task Definition Reference
reference.ExternalName()tocommon.ARNExtractor()in both ForProvider and InitProvider for v1beta1, v1beta2, and namespaced APIsI have:
make generateand committed the results (ideally in a separate commit).make check-diff.How has this code been tested
Tested locally via uptest.
https://github.com/crossplane-contrib/provider-upjet-aws/actions/runs/21032450859