Skip to content

Terraform is always reconciled after controller restart if plan is not updated and resource age > interval #1681

@artem-nefedov

Description

@artem-nefedov

Currently, the logic in shouldReconcile() compares current time to status.lastPlanAt value + interval duration here and here. But the problem is that status.lastPlanAt isn't always updated on reconcile, e.g. if there are no planned changes it won't be updated.

So, what happens is after initial resource creation and planning, the logic will work correctly until time specified in spec.interval passes. After that, if there are no changes in plan, it is guaranteed to trigger reconcile because status.lastPlanAt + interval will always be lower than current time, regardless of when last reconcile happened.

Terraform resource also has status.lastHandledReconcileAt, which seems to be a better fit for comparison, as it will always be updated on a reconcile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions