Skip to content

Commit 5174020

Browse files
DanNiEShclaude
andauthored
Exclude PoweredOn from provisioning config version hash (#12)
PoweredOn is handled by reconcilePower() which directly calls the management backend API — it does not need the provisioning template. Including it in the hash caused the template to re-trigger on every power state toggle. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a1bda84 commit 5174020

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

internal/controller/hostlease_controller.go

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,29 @@ func (r *HostLeaseReconciler) reconcilePower(ctx context.Context, hostLease *v1a
345345
}
346346

347347
func (r *HostLeaseReconciler) reconcileProvisioning(ctx context.Context, hostLease *v1alpha1.HostLease) (ctrl.Result, error) {
348-
desiredVersion, err := provisioning.ComputeDesiredConfigVersion(hostLease.Spec)
348+
desiredVersion, err := provisioning.ComputeDesiredConfigVersion(struct {
349+
HostType string
350+
ExternalHostID string
351+
ExternalHostName string
352+
HostClass string
353+
NetworkClass string
354+
Selector v1alpha1.HostSelectorSpec
355+
InventoryLabels map[string]string
356+
InventoryPersistentLabels map[string]string
357+
TemplateID string
358+
TemplateParameters string
359+
}{
360+
hostLease.Spec.HostType,
361+
hostLease.Spec.ExternalHostID,
362+
hostLease.Spec.ExternalHostName,
363+
hostLease.Spec.HostClass,
364+
hostLease.Spec.NetworkClass,
365+
hostLease.Spec.Selector,
366+
hostLease.Spec.InventoryLabels,
367+
hostLease.Spec.InventoryPersistentLabels,
368+
hostLease.Spec.TemplateID,
369+
hostLease.Spec.TemplateParameters,
370+
})
349371
if err != nil {
350372
return ctrl.Result{}, fmt.Errorf("failed to compute desired config version: %w", err)
351373
}

0 commit comments

Comments
 (0)