PatchStatusCondition removes status conditions on a given Cluster
( ctx context.Context, crudClient client.Client, namespace, clusterName string, )
| 80 | |
| 81 | // PatchStatusCondition removes status conditions on a given Cluster |
| 82 | func PatchStatusCondition( |
| 83 | ctx context.Context, |
| 84 | crudClient client.Client, |
| 85 | namespace, clusterName string, |
| 86 | ) error { |
| 87 | cluster := &apiv1.Cluster{} |
| 88 | var err error |
| 89 | err = retry.RetryOnConflict(retry.DefaultBackoff, func() error { |
| 90 | cluster, err = clusterutils.Get(ctx, crudClient, namespace, clusterName) |
| 91 | if err != nil { |
| 92 | return err |
| 93 | } |
| 94 | clusterNoConditions := cluster.DeepCopy() |
| 95 | clusterNoConditions.Status.Conditions = nil |
| 96 | return crudClient.Patch(ctx, clusterNoConditions, client.MergeFrom(cluster)) |
| 97 | }) |
| 98 | if err != nil { |
| 99 | return err |
| 100 | } |
| 101 | return nil |
| 102 | } |
| 103 | |
| 104 | // GetOpenshiftVersion returns the current openshift version |
| 105 | func GetOpenshiftVersion(ctx context.Context, restConfig *rest.Config) (semver.Version, error) { |