feat: implement the driver doctor hook - #59
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This driver declares no
required_configat all, so nothing catches a missing endpoint or credential atfinalize_config!time the way it does in most kitchen drivers. A missingcloudstack_api_keysurfaces part way throughcreate, after the run has already started.doctormoves that discovery tokitchen doctor.Two groups of checks:
Settings the driver cannot deploy without —
cloudstack_api_url,cloudstack_api_key,cloudstack_secret_key,cloudstack_template_id,cloudstack_serviceoffering_id,cloudstack_zone_id. Each message says what the setting is for, not just that it is absent:All of them are reported in one run. Reporting the first and stopping would mean six
kitchen doctorinvocations to configure a driver from scratch.The endpoint actually works — the URL parses and has a host, and CloudStack accepts the keys (via a
list_zonescall, the cheapest authenticated request available).The connectivity check is skipped when the endpoint or credentials are missing, since the first group already said so and "could not connect" on top of "no API key is set" is noise rather than information.
Verification
rake test— 69 examples, 0 failures (63 before; 6 new),rakeexit 0cookstyle --chefstyle— 9 files, no offensesyard stats— 100% documented