scenario

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: UPL-1.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PsrPrefix is the prefix used for PSR names
	PsrPrefix = "psr"

	// LabelScenario has a bool value to indicate a resource is part of a scenario
	LabelScenario = "psr.verrazzano.io/scenario"

	// LabelScenarioID has a string value with the scenario ID
	LabelScenarioID = "psr.verrazzano.io/scenario-id"

	// DataScenarioKey is the configmap key for the data field which
	// has a base64 encoded Scenario
	DataScenarioKey = "scenario"
)

Variables

View Source
var StartUpgradeFunc = helmcli.Upgrade
View Source
var UninstallFunc = helmcli.Uninstall
View Source
var UpdateGetValuesFunc = helmcli.GetValues
View Source
var UpdateUpgradeFunc = helmcli.Upgrade

Functions

This section is empty.

Types

type HelmRelease

type HelmRelease struct {
	// The namespaced name of the Helm release
	types.NamespacedName

	// The scenario use case for this HelmRelase
	manifest.Usecase
}

HelmRelease specifies a HelmRelease for a use case within a scenario

type Scenario

type Scenario struct {
	// The namespace where the scenario is installed
	Namespace string

	// The helm releases that are installed by the scenario
	HelmReleases []HelmRelease

	// The scenario manifests that was used to run the scenario
	*manifest.ScenarioManifest
}

Scenario specifies a PSR scenario that was installed in the cluster

type ScenarioMananger

type ScenarioMananger struct {
	Namespace     string
	DryRun        bool
	Verbose       bool
	Log           vzlog.VerrazzanoLogger
	Client        corev1.CoreV1Interface
	HelmOverrides []helm.HelmOverrides
}

ScenarioMananger contains the information needed to manage a Scenario

func NewManager

func NewManager(namespace string, helmOverrides ...helm.HelmOverrides) (ScenarioMananger, error)

NewManager returns a scenario ScenarioMananger

func (ScenarioMananger) FindRunningScenarioByID

func (m ScenarioMananger) FindRunningScenarioByID(ID string) (*Scenario, error)

FindRunningScenarioByID returns the Scenario with the specified Scenario ID

func (ScenarioMananger) FindRunningScenarios

func (m ScenarioMananger) FindRunningScenarios() ([]Scenario, error)

FindRunningScenarios returns the list of Scenarios that are running in the cluster.

func (ScenarioMananger) StartScenario

func (m ScenarioMananger) StartScenario(manifestMan manifest.ManifestManager, scman *manifest.ScenarioManifest, vzHelper helpers.VZHelper) (string, error)

StartScenario starts a Scenario

func (ScenarioMananger) StopScenarioByID

func (m ScenarioMananger) StopScenarioByID(ID string, vzHelper helpers.VZHelper) error

StopScenarioByID stops a running scenario specified by the scenario ID

func (ScenarioMananger) UpdateScenario

func (m ScenarioMananger) UpdateScenario(manifestMan manifest.ManifestManager, scman *manifest.ScenarioManifest, vzHelper helpers.VZHelper) (string, error)

UpdateScenario updates a running Scenario The scenario manifest directory can be different that the one used to start the scenario. However, the scenario.yaml must be identical. In fact, the scenario.yaml is ignored during update, the code uses the scenario YAML information stored in the ConfigMap.

type WorkerType

type WorkerType struct {
	Global struct {
		EnvVars struct {
			WorkerType string `json:"PSR_WORKER_TYPE"`
		}
	}
}

WorkerType is used to get the worker type from the worker use case YAML file. Note: struct and fields must be public for YAML unmarshal to work.

Jump to

Keyboard shortcuts

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