kubeconfig-picker

command module
v0.0.0-...-935019e Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

README

kubeconfig-picker

wercker status Go Report Card

Pick out a subset of Kube config contexts

Build and Install

go install

Usage

Run
kubeconfig-picker
Import
import (
    "fmt"

    konfig "github.com/fenrirunbound/kubeconfig-picker/konfig"
)

func main() {
    k, _ := konfig.NewKonfigFromFile("/home/me/.kube/config")
    
    availableContexts := k.ListContexts()
    // A list of contexts contained in the kube config
    fmt.Printf("%v\n", availableContexts)

    config, _ := k.SelectContextsAsYaml([]string{"context1", "anotherContext"})
    // A kube config with only "context1" and "anotherContext" derived from the main config
    fmt.Printf("%v\n", string(config))
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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