bottlerocket-os / bottlerocket-ecs-updater

A service to automatically manage Bottlerocket updates in an Amazon ECS cluster.
Other
47 stars 9 forks source link

Upgrade to `go 1.19`, bump dependencies, & use latest SDK #107

Closed jpmcb closed 2 years ago

jpmcb commented 2 years ago
- Match version of Go in latest SDK and build with latest Go in docker
- Use go 1.19 in github actions (instead of default version on ubuntu)
- Remove deprecated golangci-lint linters

Signed-off-by: John McBride <jpmmcb@amazon.com>

Description of changes:

Upgrades the Go build directive to go 1.19 to match the latest version of the SDK. Includes changes to GitHub actions to be explicit about what version of Go should be used in build and tests (vs. using the default version found on the ubuntu images). Also carries a few other nice to have changes to the github actions (like upgrade checkout to v3).

Removes a few deprectaed linters found in golangci-lint:

WARN [runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter.  Replaced by unused.
WARN [runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter.  Replaced by unused.
WARN [runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner.  Replaced by revive.

I believe this will also fixup the Actions errors occurring in #106 where golangci-lint is failing to start

Testing done:

Able to make build, make test, make lint, and make image. I pushed the new image to a private ECR registry and went through the integration tests using a 1.9.0 AMI. In the cloudwatch logs, I see:

Container instance "abc..." updated to version "1.9.2"

for each of the instances. I've also verified on a few of the hosts too 👍🏼

ssm-user@control]$ apiclient update check
14:45:12 [INFO] Refreshing updates...
{
  "active_partition": {
    "image": {
      "arch": "x86_64",
      "variant": "aws-ecs-1",
      "version": "1.9.2"
    },
    "next_to_boot": true
  },
  ...

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.