fetch

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package fetch provides information retrieval, mostly by wrapping vendir.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractImageRegistry added in v0.39.0

func ExtractImageRegistry(name string) string

ExtractImageRegistry returns the registry portion of a Docker image reference

Types

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

Factory allows to build various fetchers. At this point most of the fetching is performed via vendir.

func NewFactory

func NewFactory(coreClient kubernetes.Interface, vendirOpts VendirOpts, cmdRunner exec.CmdRunner) Factory

NewFactory returns a Factory.

func (Factory) NewInline

func (f Factory) NewInline(opts v1alpha1.AppFetchInline, nsName string) *Inline

func (Factory) NewVendir added in v0.14.0

func (f Factory) NewVendir(nsName string) *Vendir

TODO: pass v1alpha1.Vendir opts here once api is exapnded

type Inline

type Inline struct {
	// contains filtered or unexported fields
}

Inline struct helps you fetch files or strings from a storage location such as a configmap or secret. For an example if you had a controller in your cluster that generated certs and stored them in a configmap or secret, you could use this inline fetcher to retrieve those certs to pass them on to a templating step.

func NewInline

func NewInline(opts v1alpha1.AppFetchInline, nsName string, coreClient kubernetes.Interface) *Inline

func (*Inline) Retrieve

func (t *Inline) Retrieve(dstPath string) error

type SkipTLSConfig added in v0.18.0

type SkipTLSConfig interface {
	ShouldSkipTLSForAuthority(authority string) bool
}

type Vendir added in v0.14.0

type Vendir struct {
	// contains filtered or unexported fields
}

func NewVendir added in v0.14.0

func NewVendir(nsName string, coreClient kubernetes.Interface,
	opts VendirOpts, cmdRunner exec.CmdRunner) *Vendir

NewVendir returns vendir.

func (*Vendir) AddDir added in v0.14.0

func (v *Vendir) AddDir(fetch v1alpha1.AppFetch, dirPath string) error

AddDir adds a directory to vendir's config for each fetcher that the app spec declares. vendir fetches resources into your filesystem, so the destination directory is a core part of vendir config.

func (*Vendir) Config added in v0.30.3

func (v *Vendir) Config() vendirconf.Config

Config is just for accessing (a copy of) the internal config for testing; you probably don't want to call this IRL

func (*Vendir) ConfigBytes added in v0.30.3

func (v *Vendir) ConfigBytes() ([]byte, error)

ConfigBytes fetches all the referenced Secrets & ConfigMaps and returns the multi-document YAML-encoded config that vendir consumes. https://github.com/vmware-tanzu/carvel-vendir/blob/develop/examples/secrets/vendir.yml

func (*Vendir) Run added in v0.37.0

func (v *Vendir) Run(conf []byte, workingDir string) exec.CmdRunResult

Run executes vendir command based on given configuration.

type VendirOpts added in v0.37.0

type VendirOpts struct {
	// ConfigHook provides an opportunity to make changes to vendir configuration
	// before it's given to vendir for execution. If not provided it will default
	// to the identity function.
	ConfigHook    func(vendirconf.Config) vendirconf.Config
	SkipTLSConfig SkipTLSConfig
}

VendirOpts allows to customize vendir configuration given to vendir.

Jump to

Keyboard shortcuts

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