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

exhibitor: Fix bug with automatic instance management #27700

Merged
merged 1 commit into from Jul 28, 2017

Conversation

joelthompson
Copy link
Contributor

Exhibitor expects the auto-manage-instances config value to be an
integer of 0 or 1, rather than a true/false string, which was getting
printed before.

Motivation for this change

Current NixOS module has a bug that prevents automatic instance management from working properly.

Things done

Please check what applies. Note that these are not hard requirements but mereley serve as information for reviewers.

  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

/cc @copumpkin

${cfg.extraConf}
'';
# NB: toString rather than lib.boolToString on cfg.autoManageInstances is intended.
# Exhibitor expects it to be a 0/1 integer rather than a truthy/falsey string
Copy link
Member

Choose a reason for hiding this comment

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

Given that toString returns "1" or "", this might strike folks as weird. I think the actual Exhibitor logic checks against "1" so toString is fine, but it might be clearer if the comment said it's okay because of that. Or just be explicit with if foo then "1" else "0" 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the comment and verified that toString does what I expect. Also rebased against latest master.

Copy link
Member

Choose a reason for hiding this comment

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

@volth may have a point 😄

Exhibitor tests the auto-manage-instances config value to see if it's a
non-zero integer, rather than a true/false string, which was getting
put into the config before. This now causes autoManageInstances to
behave correctly.
@copumpkin
Copy link
Member

Thanks!

@joelthompson joelthompson deleted the exhibitor branch July 28, 2017 20:02
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