config

package
v0.0.0-...-6b456cb Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: Apache-2.0 Imports: 12 Imported by: 5

Documentation

Index

Constants

View Source
const (
	NP_MASTER       = "NP_MASTER"
	NP_KCONFIG_PATH = "NP_KCONFIG_PATH"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssertStep

type AssertStep struct {
	Count    uint64
	Class    Class // optional
	Object   Object
	PodPhase v1.PodPhase // optional
	Delay    time.Duration
	GVK      *schema.GroupVersionKind
}

type ChangeStep

type ChangeStep struct {
	Count        uint64
	Class        Class
	Object       Object
	FromPodPhase v1.PodPhase
	ToPodPhase   v1.PodPhase
}

type Class

type Class string

type CreateStep

type CreateStep struct {
	Count    uint64
	Class    Class
	Object   Object
	YamlPath string
}

type DeleteStep

type DeleteStep struct {
	Count    uint64
	Class    Class
	Object   Object
	YamlPath string
}

type KubeInfo

type KubeInfo struct {
	Master      string
	KconfigPath string
}

func KubeInfoFromEnv

func KubeInfoFromEnv() (KubeInfo, error)

type NodeClass

type NodeClass struct {
	Name      string
	Count     uint
	Labels    map[string]string
	Resources NodeResources
}

type NodeConfig

type NodeConfig struct {
	NodeClasses []NodeClass `yaml:"nodeClasses"`
}

func NodeConfigFromBytes

func NodeConfigFromBytes(data []byte) (*NodeConfig, error)

func NodeConfigFromFile

func NodeConfigFromFile(path string) (*NodeConfig, error)

func (*NodeConfig) AsYaml

func (n *NodeConfig) AsYaml() (string, error)

type NodeResources

type NodeResources struct {
	Capacity    map[string]string
	Allocatable map[string]string
}

type Object

type Object string
const (
	Node Object = "node"
	Pod  Object = "pod"
)

type PodClass

type PodClass struct {
	Name   string
	Labels map[string]string
	Spec   corev1.PodSpec
}

type PodConfig

type PodConfig struct {
	PodClasses []PodClass `yaml:"podClasses"`
}

func PodConfigFromBytes

func PodConfigFromBytes(data []byte) (*PodConfig, error)

func PodConfigFromFile

func PodConfigFromFile(path string) (*PodConfig, error)

type Scenario

type Scenario struct {
	ScenarioYaml
	Steps []*Step
}

func ScenarioFromBytes

func ScenarioFromBytes(data []byte) (*Scenario, error)

func ScenarioFromFile

func ScenarioFromFile(path string) (*Scenario, error)

type ScenarioYaml

type ScenarioYaml struct {
	Name       string
	Version    uint64
	RawSteps   []string `yaml:"steps"`
	WorkingDir string
}

type Step

type Step struct {
	Verb   Verb
	Assert *AssertStep
	Create *CreateStep
	Change *ChangeStep
	Delete *DeleteStep
}

func ParseStep

func ParseStep(raw string) (*Step, error)

func ParseSteps

func ParseSteps(rawSteps []string) ([]*Step, error)

func (*Step) AsYaml

func (s *Step) AsYaml() string

type Verb

type Verb string
const (
	Assert Verb = "assert"
	Create Verb = "create"
	Change Verb = "change"
	Delete Verb = "delete"
)

Jump to

Keyboard shortcuts

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