Skip to content

manifestival/client-go-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

client-go-client

A client-go implementation of the Manifestival Client.

Usage

import (
    "context"

    mfc "github.com/manifestival/client-go-client"
    mf  "github.com/manifestival/manifestival"
    "k8s.io/client-go/rest"
)

func main() {
    var config *rest.Config = ...
    ctx := context.Background()

    manifest, err := mfc.NewManifest("file.yaml", config)
    if err != nil {
        panic("Failed to load manifest")
    }
    manifest.Apply(ctx)

    // a slightly more complex example
    client, _ := mfc.NewClient(config)
    m, err := mf.ManifestFrom(mf.Recursive("dir/"), mf.UseClient(client))
    if err != nil {
        panic("Failed to load manifest")
    }
    m.Apply(ctx)
}

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 *rest.Config.