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

Spot termination checking #390

Conversation

gabegorelick
Copy link
Contributor

Issue Type

Feature Pull Request

Summary

#363 with an extra commit to add tests.

Code contribution checklist

  1. I hereby allow the Copyright holder the rights to distribute this piece of
    code under any software license.
  2. The contribution fixes a single existing github issue, and it is linked
    to it.
  3. The code is as simple as possible, readable and follows the idiomatic Go
    guidelines.
  4. All new functionality is covered by automated test cases so the overall
    test coverage doesn't decrease.
  5. No issues are reported when running make full-test.
  6. Functionality not applicable to all users should be configurable.
  7. Configurations should be exposed through Lambda function environment
    variables which are also passed as parameters to the
    CloudFormation
    and
    Terraform
    stacks defined as infrastructure code.
  8. Global configurations set from the infrastructure stack level should also
    support per-group overrides using tags.
  9. Tags names and expected values should be similar to the other existing
    configurations.
  10. Both global and tag-based configuration mechanisms should be tested and
    proven to work using log output from various test runs.
  11. The logs should be kept as clean as possible (use log levels as
    appropriate) and formatted consistently to the existing log output.
  12. The documentation is updated to cover the new behavior, as well as the
    new configuration options for both stack parameters and tag overrides.
  13. A code reviewer reproduced the problem and can confirm the code
    contribution actually resolves it.

core/main.go Outdated
@@ -210,7 +210,12 @@ func (a *AutoSpotting) EventHandler(event *json.RawMessage) {
return
} else if instanceID != nil {
spotTermination := newSpotTermination(cloudwatchEvent.Region)
spotTermination.executeAction(instanceID, a.config.TerminationNotificationAction)
if spotTermination.isInAutoSpottingASG(instanceID, a.config.TagFilteringMode, a.config.FilterByTags) {
spotTermination.executeAction(instanceID, a.config.TerminationNotificationAction)

Choose a reason for hiding this comment

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

Error return value of spotTermination.executeAction is not checked (from errcheck)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@gabegorelick
Copy link
Contributor Author

I have no idea what these lint errors are about. The referenced lines don't exist in autoscaling.go and I can't find any instances of instanceId in the codebase.
image

gabegorelick added a commit to gabegorelick/AutoSpotting that referenced this pull request Jan 27, 2020
This is a reworking of LeanerCloud#363 against `master`.

Credit for original code goes to @cfarrend.

Closes LeanerCloud#363
Closes LeanerCloud#390
gabegorelick added a commit to gabegorelick/AutoSpotting that referenced this pull request Jan 27, 2020
This is a reworking of LeanerCloud#363 against `master`.

Credit for original code goes to @cfarrend.

Fixes LeanerCloud#362
Closes LeanerCloud#363
Closes LeanerCloud#390
gabegorelick added a commit to gabegorelick/AutoSpotting that referenced this pull request Jan 27, 2020
This is a reworking of LeanerCloud#363 against `master`.

Credit for original code goes to @cfarrend.

Fixes LeanerCloud#362
Closes LeanerCloud#363
Closes LeanerCloud#390
@gabegorelick
Copy link
Contributor Author

Closing this in favor of #391 which targets master.

gabegorelick added a commit to gabegorelick/AutoSpotting that referenced this pull request Jan 28, 2020
This is a reworking of LeanerCloud#363 against `master`.

Credit for original code goes to @cfarrend.

Fixes LeanerCloud#362
Closes LeanerCloud#363
Closes LeanerCloud#390
cristim pushed a commit that referenced this pull request Jan 28, 2020
…391)

This is a reworking of #363 against `master`.

Credit for original code goes to @cfarrend.

Fixes #362
Closes #363
Closes #390
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.

None yet

2 participants