Skip to content

Commit

Permalink
Cluster: Remove all the lease from cluster
Browse files Browse the repository at this point in the history
lease is a mechanism to lock shared resources in k8s and since we start
a stopped cluster better to remove all the lease so that lock is not
around for longer period of time in case older lease expire and only
renew once respective resource ask for it.

Also during 4.14 testing we found out if we only remove lease from
`openshift-machine-config-operator` namespace then having the
pull-secret on the disk takes a longer time then usual. I am still not
sure where it is stuck but https://issues.redhat.com/browse/OCPBUGS-7583
is closed as expected behaviour and till 4.13 we used the workaround.
From 4.14 that workaround doesn't work because there is no configmap and
just removing lease of this namespace not helpful so I am removing all
the lease from older cluster which atleast perfrom better.
  • Loading branch information
praveenkumar committed Oct 20, 2023
1 parent 4e1acda commit 416c8cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/crc/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,6 @@ func DeleteMCOLeaderLease(ctx context.Context, ocConfig oc.Config) error {
if err := WaitForOpenshiftResource(ctx, ocConfig, "lease"); err != nil {
return err
}
_, _, err := ocConfig.RunOcCommand("delete", "-n", "openshift-machine-config-operator", "lease", "--all")
_, _, err := ocConfig.RunOcCommand("delete", "-A", "lease", "--all")
return err
}

0 comments on commit 416c8cd

Please sign in to comment.