aws / amazon-ecs-init

Amazon Elastic Container Service RPM
http://aws.amazon.com/ecs
Apache License 2.0
198 stars 119 forks source link

[AL2022] Set GO111MODULE=auto and update ecs-init.spec #481

Closed chienhanlin closed 2 years ago

chienhanlin commented 2 years ago

Summary

This PR updates packaging/amazon-linux-ami/ecs-init.spec and scripts/gobuild.sh for packing ecs-init rpm for Amazon Linux 2022 (AL220) OS.

Implementation details

  1. Add %global debug_package %{nil} in amazon-linux-ami/ecs-init.spec to fix RPM build errors: Empty %files file....
  2. Append an argument ecs after %systemd_postunin amazon-linux-ami/ecs-init.spec to fixerror: The %systemd_postun macro requires some arguments`.
  3. Set GO111MODULE="auto" in gobuild.sh to only use go modules if modules exist.

Testing

  1. Built ecs-init rpm on an AL2022 instance (x86_64 and aarch64), installed ECS Agent version 1.58 from the rpm, and ran ECS tasks successfully.
  2. Built ecs-init rpm in an AL1 and AL2 (x86_64 and aarch64) using Koji, installed ECS Agent version 1.59 from the rpm, and ran ECS tasks successfully.

New tests cover the changes: no

Description for the changelog

Support building ecs-init rpm on AL2022 OS.

Licensing

This contribution is under the terms of the Apache 2.0 License: yes