fix (machine) : crc daemon /status
api should return correct preset value for okd
cluster (#4478)
#4480
+283
−23
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.
Fixes: Issue #4478
Relates to: Issue #4478
Solution/Idea
CRC daemon's
/api/status
API endpoint should return correct value of preset when running CRC cluster configured withcrc
preset. At the moment it only returns correct value formicroshift
andopenshift
presets.Proposed changes
Status()
method to move ClusterStatusResult object creation logic to a separate method for easier testingTesting
Build a development version of CRC and create a cluster configured with okd preset. Then query status endpoint to see what preset is returned by API server.
crc config set preset okd
crc setup
crc start
curl -i --unix-socket ~/.crc/crc-http.sock http://crc/api/status | jq .Preset
should return"okd"
Old Behavior
Old Response of
/api/status
on OKD based cluster:New Behavior (with this PR)
New Response of
/api/status
on OKD based cluster:I have tested by cherry-picking this commit on top of #4479 , it's now displaying OKD value in
crc status
as expected.