client

package module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2021 License: Apache-2.0 Imports: 5 Imported by: 20

README

controller-runtime-client

A controller-runtime implementation of the Manifestival Client.

Usage

import (
    mfc "github.com/manifestival/controller-runtime-client"
    mf  "github.com/manifestival/manifestival"
    "sigs.k8s.io/controller-runtime/pkg/client"
)

func main() {
    var client client.Client = ...
    
    manifest, err := mfc.NewManifest("file.yaml", client)
    if err != nil {
        panic("Failed to load manifest")
    }
    manifest.Apply()
    
    // a slightly more complex example
    m, err := mf.ManifestFrom(mf.Recursive("dir/"), mf.UseClient(mfc.NewClient(client)))
    if err != nil {
        panic("Failed to load manifest")
    }
    m.Apply()
}

The NewManifest function in this library delegates to the function of the same name in the manifestival package after constructing a manifestival.Client implementation from the client.Client.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(client client.Client) mf.Client

func NewManifest

func NewManifest(pathname string, client client.Client, opts ...mf.Option) (mf.Manifest, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL