Skip to content

Comments

fix git reconciler error: worktree contains unstaged changes#175

Merged
bcrochet merged 1 commit intoredhat-openshift-ecosystem:mainfrom
acornett21:fix_git_reconciler
Nov 11, 2025
Merged

fix git reconciler error: worktree contains unstaged changes#175
bcrochet merged 1 commit intoredhat-openshift-ecosystem:mainfrom
acornett21:fix_git_reconciler

Conversation

@acornett21
Copy link
Contributor

Motivation

The git reconciler has a pretty noisy error message for the below, which makes it hard to troubleshoot other errors that can occur. This also happens after the git reconciler has successfully reconciled, so it makes the logs/status even more confusing. This seems to be happening if someone is using a tag/commit other then main, which is the recommended approach.

{"controller": "operator_pipeline", "controllerGroup": "certification.redhat.com", "controllerKind": "OperatorPipeline", "OperatorPipeline": {"name":"operatorpipeline-sample","namespace":"oco"}, "namespace": "oco", "name": "operatorpipeline-sample", 
"reconcileID": "743bd5aa-39de-4abe-9132-12e1f48582da", "Request.Namespace": "oco", "Request.Name": "operatorpipeline-sample", "error": "worktree contains unstaged changes"}
github.com/redhat-openshift-ecosystem/operator-certification-operator/internal/reconcilers.(*PipelineGitRepoReconciler).Reconcile
    /workspace/internal/reconcilers/pipeline_git_repo.go:49
github.com/redhat-openshift-ecosystem/operator-certification-operator/internal/controller.(*OperatorPipelineReconciler).Reconcile
    /workspace/internal/controller/operatorpipeline_controller.go:135
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile
    /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.21.0/pkg/internal/controller/controller.go:119
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler
    /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.21.0/pkg/internal/controller/controller.go:340
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem
    /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.21.0/pkg/internal/controller/controller.go:300
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.1
    /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.21.0/pkg/internal/controller/controller.go:202
2025-10-27T18:10:45Z    ERROR    controller_operatorpipeline    requeuing with error    {"error": "worktree contains unstaged changes"} 

Changes

  • Check what the git status is.
  • Reset the working tree and discard local changes (changes here means something other then main it seems).

@openshift-ci openshift-ci bot requested review from bcrochet and skattoju October 27, 2025 20:53
Copy link
Contributor

@yashoza19 yashoza19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 30, 2025
Copy link
Contributor

@bcrochet bcrochet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Question

Signed-off-by: Adam D. Cornett <adc@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Oct 31, 2025
Copy link
Contributor

@bcrochet bcrochet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 11, 2025
@bcrochet bcrochet merged commit 96b8ee4 into redhat-openshift-ecosystem:main Nov 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants