Skip to content

Instantly share code, notes, and snippets.

@jmrodri
Created February 19, 2021 19:59
Show Gist options
  • Save jmrodri/c04635ca818b86f3d27fc93042372f05 to your computer and use it in GitHub Desktop.
Save jmrodri/c04635ca818b86f3d27fc93042372f05 to your computer and use it in GitHub Desktop.
size := memcached.Spec.Size
if *found.Spec.Replicas != size {
found.Spec.Replicas = &size
err = r.Update(ctx, found)
if err != nil {
log.Error(err, "Failed to update Deployment", "Deployment.Namespace", found.Namespace, "Deployment.Name", found.Name)
return ctrl.Result{}, err
}
// Spec updated - return and requeue
return ctrl.Result{Requeue: true}, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment