Skip to content

Commit

Permalink
cluster: Don't return error if there is no machine-config-controller …
Browse files Browse the repository at this point in the history
…configmap

OCP 4.14 moves to use LeasesResourceLock instead of ConfigMapsLeasesResourceLock and it
doesn't have this `machine-config-controller` configmap and `crc start`
failing on those bundle. This PR make sure if configmap doesn't present
then don't send the error.

- openshift/machine-config-operator#3842
  • Loading branch information
praveenkumar committed Oct 20, 2023
1 parent 5863186 commit 4e1acda
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/crc/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,11 @@ func DeleteMCOLeaderLease(ctx context.Context, ocConfig oc.Config) error {
if err := WaitForOpenshiftResource(ctx, ocConfig, "configmap"); err != nil {
return err
}
if _, _, err := ocConfig.RunOcCommand("delete", "-n", "openshift-machine-config-operator", "configmap", "machine-config-controller"); err != nil {
return err

if _, stderr, err := ocConfig.RunOcCommand("delete", "-n", "openshift-machine-config-operator", "configmap", "machine-config-controller"); err != nil {
if !strings.Contains(stderr, "\"machine-config-controller\" not found") {
return err
}
}
// https://issues.redhat.com/browse/OCPBUGS-7583 as workaround
if err := WaitForOpenshiftResource(ctx, ocConfig, "lease"); err != nil {
Expand Down

0 comments on commit 4e1acda

Please sign in to comment.