statefixtures

package
v1.0.89 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chart

type Chart struct {
	Name string
	Repo string
}

type Cluster

type Cluster struct {
	Name             string
	Base             string
	Address          string
	Project          string
	Location         string
	RequireSuitable  bool
	TerraHelmfileRef string
}

type Environment

type Environment struct {
	Name                 string
	Base                 string
	Template             string
	Lifecycle            terra.Lifecycle
	UniqueResourcePrefix string
	DefaultCluster       string
	RequireSuitable      bool
	TerraHelmfileRef     string
}

type Fixture

type Fixture interface {
	Environment(name string) *statemocks.Environment
	Cluster(name string) *statemocks.Cluster
	Release(name string, dest string) terra.Release
	AllReleases() []terra.Release
	Mocks() *Mocks
}

Fixture is a convenience interface for retrieving environments, clusters and from state by name

func LoadFixture deprecated

func LoadFixture(name FixtureName) (Fixture, error)

LoadFixture load a state fixture for use in tests

Deprecated: this package was added for backwards compatibility when we deleted gitops state; new tests that depend on state should set up their own mocks.

Old tests should also ideally be refactored to mock their own state or pass in their own fixture data

func LoadFixtureFromFile added in v1.0.76

func LoadFixtureFromFile(file string) (Fixture, error)

LoadFixture load a state fixture for use in tests. See default state fixture o

func NewFixture

func NewFixture(mocks *Mocks) Fixture

type FixtureData

type FixtureData struct {
	Clusters     []Cluster
	Environments []Environment
	Charts       []Chart
	Releases     []Release
}

FixtureData root type for a fixture definition file

type FixtureName

type FixtureName int

FixtureName is an enum type for different fixtures in the fixtures/ directory.

const (
	Default FixtureName = iota
)

func (FixtureName) String

func (f FixtureName) String() string

type Mocks

type Mocks struct {
	Clusters     *statemocks.Clusters
	Destinations *StubDestinations
	Environments *StubEnvironments
	Releases     *StubReleases
	State        *statemocks.State
	StateLoader  *statemocks.StateLoader

	Items struct {
		Clusters        map[string]*statemocks.Cluster
		Environments    map[string]*statemocks.Environment
		AppReleases     map[string]*statemocks.AppRelease
		ClusterReleases map[string]*statemocks.ClusterRelease
	}
}

type Release

type Release struct {
	FullName            string
	Name                string
	Repo                string
	Chart               string
	Cluster             string
	Namespace           string
	Environment         string
	AppVersion          string
	ChartVersion        string
	TerraHelmfileRef    string
	FirecloudDevelopRef string
	Port                int
	Protocol            string
	Subdomain           string
}

type StubDestinations

type StubDestinations struct {
	*statemocks.Destinations
}

func (*StubDestinations) Filter

type StubEnvironments

type StubEnvironments struct {
	*statemocks.Environments
}

func (*StubEnvironments) Filter

type StubReleases

type StubReleases struct {
	*statemocks.Releases
}

func (*StubReleases) Filter

func (m *StubReleases) Filter(filter terra.ReleaseFilter) ([]terra.Release, error)

Jump to

Keyboard shortcuts

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