Skip to content
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

Explicitly set up ECS config dir in spec files #4131

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

danehlim
Copy link
Contributor

@danehlim danehlim commented Apr 1, 2024

Summary

Explicitly make sure that ECS config directory (e.g., /etc/ecs) is created and owned by ecs-init package when ecs-init package is installed.

Current behavior is that this directory is created implicitly elsewhere and not owned by ecs-init, which should not be the case.

Implementation details

Ensure %dir %{_sysconfdir}/ecs is present under %files section in spec files.

Testing

Run the following commands on an EC2 instance to build and install ecs-init RPM package with the changes from this pull request:

# Stop ECS service.
sudo systemctl stop ecs
# Uninstall ecs-init.
sudo yum remove -y ecs-init
# Delete any existing ECS config directory and files.
sudo rm -rf /etc/ecs
# Build ecs-init RPM package with the changes from this pull request.
make generic-rpm-integrated
# Install the ecs-init RPM built by running the previous command.
sudo yum localinstall -y /home/ec2-user/go/src/github.com/aws/amazon-ecs-agent/amazon-ecs-init-1.82.1-1.x86_64.rpm
# Start ECS service.
sudo systemctl start ecs

Then confirm that ECS config directory is set up correctly and owned by ecs-init:

$ ls -la /etc/ecs
total 16
drwxr-xr-x.  2 root root     6 Apr  1 18:25 .
drwxr-xr-x. 78 root root 16384 Apr  1 18:29 ..
$ rpm -qf /etc/ecs
amazon-ecs-init-1.82.1-1.x86_64

Also ran automated unit, integration, and functional tests.

New tests cover the changes: no

Description for the changelog

Explicitly set up ECS config dir in spec files

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

Licensing

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

@Yiyuanzzz Yiyuanzzz marked this pull request as ready for review April 4, 2024 18:06
@Yiyuanzzz Yiyuanzzz requested a review from a team as a code owner April 4, 2024 18:06
@Yiyuanzzz Yiyuanzzz merged commit 845177f into aws:dev Apr 4, 2024
37 of 40 checks passed
@Yiyuanzzz Yiyuanzzz mentioned this pull request Apr 4, 2024
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.

4 participants