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

Fix power on string in cycle check: #105

Merged
merged 1 commit into from Nov 17, 2021

Conversation

jacobweinstock
Copy link
Member

@jacobweinstock jacobweinstock commented Nov 17, 2021

Description

This fixes power cycle requests. At line 307 If action == v1.PowerAction_POWER_ACTION_CYCLE.String() then we set the requested power state to be the string "POWER_ACTION_ON". This causes the client.SetPowerState(ctx, pwrAction) to fail as the string "POWER_ACTION_ON" is not recognized by bmclib. We need to pass "on" as is done in line 219.

Why is this needed

Fixes: #

How Has This Been Tested?

Tested manually against vaporio/ipmi-simulator container image.

How are existing users impacted? What migration steps/scripts do we need?

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

If action == v1.PowerAction_POWER_ACTION_CYCLE.String() then
we set the requested power state to be "POWER_ACTION_ON". This
causes the client.SetPowerState(ctx, pwrAction) to fail as the
string "POWER_ACTION_ON" is not recognized by bmclib. We need to
pass "on" as is done in 219.

Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
@jacobweinstock jacobweinstock added kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. labels Nov 17, 2021
@codecov
Copy link

codecov bot commented Nov 17, 2021

Codecov Report

Merging #105 (2288dbd) into main (1ffd6a4) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #105   +/-   ##
=======================================
  Coverage   80.34%   80.34%           
=======================================
  Files          10       10           
  Lines         468      468           
=======================================
  Hits          376      376           
  Misses         79       79           
  Partials       13       13           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ffd6a4...2288dbd. Read the comment docs.

@tstromberg
Copy link
Contributor

Can has test?

@jacobweinstock
Copy link
Member Author

Can has test?

Only 3 words, but a great observation and point. This function definitely should have a test. I created #106 to capture this need. Apologizes, I know that doesn't help with this PR. Would you be comfortable with a follow-up PR to add tests?

Copy link
Member

@nshalman nshalman left a comment

Choose a reason for hiding this comment

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

This was a subtle one. Thank you for catching it!

@nshalman
Copy link
Member

Can has test?

Only 3 words, but a great observation and point. This function definitely should have a test. I created #106 to capture this need. Apologizes, I know that doesn't help with this PR. Would you be comfortable with a follow-up PR to add tests?

Based on when this bug was introduced, I'd like the fix to land now and am comfortable with #106, having been filed, being left open for today.

@nshalman nshalman self-assigned this Nov 17, 2021
@nshalman nshalman added the ready-to-merge Signal to Mergify to merge the PR. label Nov 17, 2021
@nshalman nshalman removed the request for review from tstromberg November 17, 2021 14:38
@mergify mergify bot merged commit c6e5a5c into tinkerbell:main Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. ready-to-merge Signal to Mergify to merge the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants