Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Backport support for metadata-only watches to release-0.6 #1248

Merged

Commits on Nov 5, 2020

  1. Support metadata-only watches

    Add support for metadata-only watches. This backports a series of
    commits from the main branch:
    
    Add low-level metadata-only informer support
    
    This adds support for informers that communicate with the API server in
    metadata-only form.  They are *completely* separate from normal
    informers -- that is: just like unstructured, if you ask for both a
    "normal" informer & a metadata-only informer, you'll get two copies of
    the cache.
    
    Support metadata-only client operations
    
    This adds support for a metadata-only client.  It only implements
    the operations supported by metadata (delete, deleteallof, patch,
    get, list, status.patch).  The higher-level client will now delegate
    to this for when a PartialObjectMetadata object is passed in.
    
    Support "projections" in the controller builder
    
    This adds options to "project" watches as only metadata to the builder,
    making it more convienient to use these forms.  For instance:
    
    ```go
    .Owns(&corev1.Pod{}, builder.OnlyMetadata)
    ```
    
    is equivalent to
    
    ```go
    .Owns(&metav1.PartialObjectMetadata{
            TypeMeta: metav1.TypeMeta{
                    APIVersion: "v1",
                    Kind: "Pod",
            },
    })
    ```
    
    Co-authored-by: Solly Ross <sollyross@google.com>
    ncdc and DirectXMan12 committed Nov 5, 2020
    Configuration menu
    Copy the full SHA
    dbc25a8 View commit details
    Browse the repository at this point in the history
  2. ✨ Allow to use builder.OnlyMetadata option with Watches

    This change allows builders to use builder.OnlyMetadata when creating
    extra watches with .Watches(...). The code inspects the passed
    source.Source, and if it's of type *source.Kind, it calls the internal
    project method that allows to use metav1.PartialObjectMetadata in
    mapping functions.
    
    Signed-off-by: Vince Prignano <vincepri@vmware.com>
    (cherry picked from commit df54dc5)
    vincepri authored and ncdc committed Nov 5, 2020
    Configuration menu
    Copy the full SHA
    fa91e1b View commit details
    Browse the repository at this point in the history