🌱 reword to custom provisioner. - #2142
Open
guettli wants to merge 118 commits into
Open
Conversation
Fix gci import alignment and return err instead of nil in StateOfImageURLCommandV2 error path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add top-level Status field to ImageURLCommandOutputV2. StateOfImageURLCommandV2 now treats a missing or unparseable Status as "not done yet" (requeue) instead of failing immediately — the binary writes output.json atomically so the file is either complete with a valid status or absent. Also pass --api-version flag to the binary via StartImageURLCommand's new apiVersion parameter. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t.json When the process is gone (ps check fails) but output.json is missing or incomplete, return ImageURLCommandStateFailed right away instead of ImageURLCommandStateRunning. This prevents waiting up to 7 minutes for the timeout to fire when the binary crashed before writing its output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Uses an in-process fake SSH server so the tests run without any external infrastructure. The two new failure-path tests would have caught the bug fixed in the previous commit: when the process has exited but output.json is missing or has no Status field, the old code returned ImageURLCommandStateRunning (waiting for the 7-minute timeout) instead of ImageURLCommandStateFailed (immediate termination). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract the decision logic into stateOfImageURLCommandV2Logic so it can be unit-tested with plain Go values instead of a fake SSH server. The sshClient method becomes a thin wrapper that collects SSH outputs and delegates to the pure function. Tests drop from 212 lines (fake SSH server + 4 integration-style tests) to 93 lines (table-driven unit tests, no networking). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- gci: align struct field values in test table (no extra padding spaces)
- nilerr: replace `if err := json.Unmarshal(...); err != nil { return ..., nil }`
with `_ = json.Unmarshal(...)` — bad JSON leaves Status empty, which
already returns ImageURLCommandStateFailed on the next check
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… into tg/img-url-cmd-via-go
- Drop the imageURLCommandAPIVersion field from HCloudMachineSpec and InstallImage (and the matching CRD YAML, validation, and docs). - Remove the separate v2 dispatch in host.go and server.go; both now go through the single IMAGE_URL_DONE-based handler. - On success, CAPH attempts to read /root/output.json. If present and parseable, phase conditions are updated. Missing file is not an error. - Remove StateOfImageURLCommandV2, stateOfImageURLCommandV2Logic, and the dedicated v2 functions in host.go and server.go.
CAPH sets only one condition (NodeProvisioningSucceeded), not multiple per-phase conditions. The previous wording implied otherwise. Also fix pre-existing MD060 table separator style lint warning. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The actual StepResult and PhaseResult types written by image-url-command include duration and percentOfTimeout, but the example in the docs was missing them, making the schema look incomplete. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Restructure output.json section: lead with what CAPH reads (status, message), explain why JSON over plain logs, show minimal examples, demote extended example to its own subsection - ParseAndApply now returns error when JSON is invalid or status field is missing; callers log it at StateFinishedSuccessfully so operators can see when output.json is present but has no status field Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…redesign output.json's status field was removed (success/failure is now decided purely by IMAGE_URL_DONE on stdout), but two tests still expected the old status-based abort behavior, causing a nil pointer panic since they enforce that the CI mock is never called. A third test still expected a hard actionError on a transient ReadOutputJSON failure, even though that path was intentionally changed to retry via actionContinue. # Committing as: thomas.guettler@syself.com
… publish it as event. It's not about success or not
… condition in the Kubernetes object up to date?
The test was left over from an earlier 20-minute timeout experiment today; the code reverted to 7 minutes but the test wasn't. The ReadOutputJSON mock is dead since the timeout check returns before that call is ever reached. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> # Committing as: thomas.guettler@syself.com
…# Committing as: thomas.guettler@syself.com
Contributor
|
I don't think we can change the conditions etc like this.. I would not do this right now. We shouldn't do anything breaking and can do it for v1beta2 |
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.
Rewording to "custom provisioner".