Skip to content

Server-side Apply! #347

Open
Open
@DirectXMan12

Description

@DirectXMan12

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.wg/api-expressionCategorizes an issue or PR as relevant to WG API Expression.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions