Skip to content

Commit

Permalink
Remove lease resource from openshift-machine-config-operator namespace
Browse files Browse the repository at this point in the history
With 4.12.3 we found out that MCO is block till
machine-config-controller and machine-config lease is not acquired
and that takes around 5 mins. In this patch we are removing all the
lease (as of now these 2 are present) from this namespace so that MCO
is not blocked for that long time.

We still don't know the root cause, a Jira issue was created against
MCO to track it: https://issues.redhat.com/browse/OCPBUGS-7583
  • Loading branch information
praveenkumar authored and anjannath committed Feb 21, 2023
1 parent 6fef623 commit 86f1ed6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/crc/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,13 @@ func DeleteMCOLeaderLease(ctx context.Context, ocConfig oc.Config) error {
if err := WaitForOpenshiftResource(ctx, ocConfig, "cm"); err != nil {
return err
}
_, _, err := ocConfig.RunOcCommand("delete", "-n", "openshift-machine-config-operator", "cm", "machine-config-controller")
if _, _, err := ocConfig.RunOcCommand("delete", "-n", "openshift-machine-config-operator", "cm", "machine-config-controller"); err != nil {
return err
}
// https://issues.redhat.com/browse/OCPBUGS-7583 as workaround
if err := WaitForOpenshiftResource(ctx, ocConfig, "lease"); err != nil {
return err
}
_, _, err := ocConfig.RunOcCommand("delete", "-n", "openshift-machine-config-operator", "lease", "--all")
return err
}

0 comments on commit 86f1ed6

Please sign in to comment.