...

Package fixtures

import "edge-infra.dev/test/fixtures"
Overview
Index
Examples

Overview ▾

Package fixtures provides functions for loading embedded test fixtures used by various tests.

Variables

var PalletFixtures embed.FS

func LoadCRDs

func LoadCRDs(opts ...Option) ([]*v1.CustomResourceDefinition, error)

LoadCRDs loads the embedded CRD test fixtures and marshals them into client.Object structs that are ready to be applied to any K8s server

func Only

func Only(dir string) func(*options)

Only makes LoadCRDs only return CRDs from directories with the provided name. e.g., to only read the Edge CRDs, pass "edge"

Example

Code:

crds, _ := LoadCRDs(Only("edge"))
for _, crd := range crds {
    fmt.Println(crd.GetName())
}

type Option

type Option func(*options)

type Path

type Path struct {
    *layout.Path
}

func Layout

func Layout() (*Path, error)

Layout copies the embedded Image Layout to a test's temp directory and then instantiates it.

func (*Path) Push

func (p *Path) Push(dst name.Reference, pkg, tag string, opts ...remote.Option) error

Push pushes an artifact from the Image Layout identified by package name and tag to a remote registry