Skip to content

fix[credentialsfetcher]: Assign gMSA leasId to CredentialSpecResource - #4490

Merged
as14692 merged 1 commit into
aws:devfrom
as14692:dev
Feb 7, 2025
Merged

as14692 merged 1 commit into
aws:devfrom
as14692:dev

Conversation

@as14692

@as14692 as14692 commented Feb 6, 2025 •

Copy link
Copy Markdown
Contributor

Summary

Fix gMSA on Linux credentialSpec container cleanup for credentialfetcher tasks by properly assigning leaseId to taskResource, ensuring ticket cleanup when tasks are stopped.

Implementation details

  • Assigned leaseId from gMSA client response to credentialSpec taskResource object
  • This enables the task resource cleanup method to properly delete tickets using leaseId during task cleanup
  • Previously, tickets remained after task stopping due to missing leaseId assignment in taskResource

Testing

Unit Test

  • make test

Function Test

/var/log/ecs/ecs-agent.log.2025-02-06-01:level=info time=2025-02-06T01:50:40Z msg="Managed task has reached stopped; waiting for container cleanup" task="xxx"
/var/log/ecs/ecs-agent.log.2025-02-06-04:level=info time=2025-02-06T04:50:40Z msg="Resource cleanup complete" task="xxx" resource="credentialspec"

New tests cover the changes:

Description for the changelog

Bug: Ensure proper cleanup of gMSA Linux credentials by assigning leaseId to taskResource for credentialfetcher tasks

Additional Information

Does this PR include breaking model changes? If so, Have you added transformation functions? - No

Does this PR include the addition of new environment variables in the README? - No

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@as14692
as14692 requested a review from a team as a code owner February 6, 2025 18:26
@as14692 as14692 self-assigned this Feb 6, 2025

@smhmhmd smhmhmd left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See if you can add a unit-test

@as14692
as14692 removed the request for review from fierlion February 7, 2025 04:47
@as14692
as14692 merged commit cf564a1 into aws:dev Feb 7, 2025
@amogh09 amogh09 mentioned this pull request Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants