Update machine status - #352
Conversation
Update machine status CRDs that were unused and could be meaningful. Signed-off-by: Yair Podemsky <ypodemsk@redhat.com> Assisted-by: AI
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: yairpod The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideThe PR introduces meaningful Machine status conditions for key provisioning and attestation-key approval, defines their shared constants and builders, and updates both reconciliation paths to patch status only when conditions change while retaining existing error and requeue behavior. Sequence diagram for Machine key provisioning statussequenceDiagram
participant MachineReconciler
participant Trustee
participant KubernetesAPI
MachineReconciler->>Trustee: generate_secret(id, owner_reference)
alt secret generation succeeds
MachineReconciler->>Trustee: send_secret(id)
end
MachineReconciler->>MachineReconciler: machine_key_provisioned_condition(provisioned, generation, existing_status)
alt condition changed
MachineReconciler->>KubernetesAPI: patch_status(Machine, conditions)
end
MachineReconciler-->>MachineReconciler: requeue or return provisioning error
Sequence diagram for Machine attestation-key approval statussequenceDiagram
participant AttestationKeyReconciler
participant KubernetesAPI
AttestationKeyReconciler->>KubernetesAPI: patch_status(AttestationKey, Approved)
AttestationKeyReconciler->>AttestationKeyReconciler: machine_ak_approved_condition(false, generation, status)
alt matching key approved
AttestationKeyReconciler->>KubernetesAPI: patch_status(Machine, AttestationKeyApproved)
else no matching key
AttestationKeyReconciler->>KubernetesAPI: patch_status(Machine, AttestationKeyApproved=False)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. If the condition logic or status patch is wrong, a Machine could retain an incorrect provisioning or attestation status after a revert, potentially misleading status-based automation or operators. The underlying key operations are not changed in substance, and the persisted status can be corrected by a subsequent reconciliation or rerun.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Jakob-Naucke
left a comment
There was a problem hiding this comment.
I know I'm no saint for this but could you motivate the change in the commit message a little more? Which new conditions are there and why, where do and don't we change the way we update a status (apply vs. merge)
Update machine status CRDs that were unused and could be meaningful.
Summary by Sourcery
Expose machine key provisioning and attestation-key approval status through Kubernetes conditions.
New Features:
Enhancements: