Skip to content

Drift correction not working #2436

@lindhe

Description

@lindhe

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

If an object is changed, Fleet detects the diff but does nothing to converge to a healthy state.

Expected Behavior

When spec.correctDrift.enabled=true, I expect Fleet to try and apply changes as soon as there is a diff.

Steps To Reproduce

  1. Have Rancher v2.8.1 installed.

  2. In Rancher, click "Continuous Delivery" and "Git Repos" and select the "fleet-local" workspace.

  3. Add a GitRepo that applies some resource. Make sure to check "Enable Self-Healing" to set spec.correctDrift.enabled=true in the bundle.

  4. Wait for the GitRepo to sync and become healthy, with the new resource created and in state "Ready".

  5. Edit the resource using kubectl edit, e.g. delete a label or something.

  6. Observe new state "Modified" for the resource:

    Screenshot 2024-05-16 171752

Environment

- Architecture: amd64
- Fleet Version: The one that's bundled with Rancher v2.8.1. 
- Cluster:
  - Provider: RKE2
  - Options: 3 nodes upstream cluster
  - Kubernetes Version: 1.27.9

Logs

No response

Anything else?

It looks like #1594 tried to implement drift correction, but it's clearly not working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    ✅ Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions