Description
Server-side apply will be landing in 1.14 (code is merged 🎉 and all), so we should come up with a plan to support server-side apply.
Talking with @apelisse and @jennybuckley, it looks like the main constraints on server-side apply from a controller perspective are that you must set all the fields you care about when submitting an object, which is what we encourage anyway (declare the state of the world that you want to see, instead of just making changes).
This should ultimately (in many cases) allow people to write code like:
if err := r.Client.Ensure(ctx, &grp.MyKind{
fieldA: "foo",
fieldB: "bar",
}); err != nil {
return ctrl.Result{}, err
}
instead of using CreateOrUpdate
.
It would be neat to call server-side apply from CreateOrUpdate
, but it's not clear to me that we can safely do so without violating an implicit contract -- if people have special logic that they do when fields aren't set (not a good pattern, but people almost certainly do it), it could break them. That being said, it's not clear to me that we explicitly write that as a contract anywhere.