Documentation ¶
Index ¶
- Constants
- Variables
- func NewEnvironment() (api.Component, error)
- type Environment
- func (e *Environment) Close() (err error)
- func (e *Environment) DeployIstio() bool
- func (e *Environment) DeployYaml(yamlFile string, scope lifecycle.Scope) (*deployment.Instance, error)
- func (e *Environment) Descriptor() component.Descriptor
- func (e *Environment) DumpState(context string)
- func (e *Environment) Evaluate(template string) (string, error)
- func (e *Environment) EvaluateWithParams(tpl string, data interface{}) (string, error)
- func (e *Environment) HelmValueMap() map[string]string
- func (e *Environment) IsMtlsEnabled() bool
- func (e *Environment) MinikubeIngress() bool
- func (e *Environment) NamespaceForScope(scope lifecycle.Scope) string
- func (e *Environment) Reset() error
- func (e *Environment) Scope() lifecycle.Scope
- func (e *Environment) Start(ctx context.Instance, scope lifecycle.Scope) error
- func (e *Environment) SuiteNamespace() string
- func (e *Environment) SystemNamespace() string
- func (e *Environment) TestNamespace() string
Constants ¶
const ( // HubValuesKey values key for the Docker image hub. HubValuesKey = "global.hub" // TagValuesKey values key for the Docker image tag. TagValuesKey = "global.tag" // ImagePullPolicyValuesKey values key for the Docker image pull policy. ImagePullPolicyValuesKey = "global.imagePullPolicy" // DefaultSystemNamespace default value for SystemNamespace DefaultSystemNamespace = "istio-system" // DefaultValuesFile for Istio Helm deployment. DefaultValuesFile = "test-values/values-istio-mcp.yaml" // LatestTag value LatestTag = "latest" // DefaultDeployTimeout for Istio DefaultDeployTimeout = time.Second * 480 // DefaultUndeployTimeout for Istio. DefaultUndeployTimeout = time.Second * 600 )
Variables ¶
var ( // ISTIO_TEST_KUBE_CONFIG is the Kubernetes configuration file to use for testing. If a configuration file // is specified on the command-line, that takes precedence. // nolint: golint ISTIO_TEST_KUBE_CONFIG env.Variable = "ISTIO_TEST_KUBE_CONFIG" // HUB is the Docker hub to be used for images. // nolint: golint HUB env.Variable = "HUB" // TAG is the Docker tag to be used for images. // nolint: golint TAG env.Variable = "TAG" )
Functions ¶
func NewEnvironment ¶
NewEnvironment factory function for the component
Types ¶
type Environment ¶
Environment is the implementation of a kubernetes environment. It implements environment.Environment, and also hosts publicly accessible methods that are specific to cluster environment.
func GetEnvironment ¶
func GetEnvironment(r component.Repository) (*Environment, error)
GetEnvironment from the repository.
func GetEnvironmentOrFail ¶
func GetEnvironmentOrFail(r component.Repository, t testing.TB) *Environment
GetEnvironmentOrFail from the repository.
func (*Environment) DeployIstio ¶
func (e *Environment) DeployIstio() bool
DeployIstio indicates whether the Istio system should be deployed.
func (*Environment) DeployYaml ¶
func (e *Environment) DeployYaml(yamlFile string, scope lifecycle.Scope) (*deployment.Instance, error)
DeployYaml deploys the given yaml with the given scope.
func (*Environment) Descriptor ¶
func (e *Environment) Descriptor() component.Descriptor
Descriptor for this component
func (*Environment) DumpState ¶
func (e *Environment) DumpState(context string)
DumpState dumps the state of the environment to the file system and the log.
func (*Environment) Evaluate ¶
func (e *Environment) Evaluate(template string) (string, error)
Evaluate the template against standard set of parameters. See template.parameters for details.
func (*Environment) EvaluateWithParams ¶
func (e *Environment) EvaluateWithParams(tpl string, data interface{}) (string, error)
EvaluateWithParams the given template using the provided data.
func (*Environment) HelmValueMap ¶
func (e *Environment) HelmValueMap() map[string]string
HelmValueMap returns the overrides for helm values.
func (*Environment) IsMtlsEnabled ¶
func (e *Environment) IsMtlsEnabled() bool
Is mtls enabled. Check in Values flag and Values file.
func (*Environment) MinikubeIngress ¶
func (e *Environment) MinikubeIngress() bool
MinikubeIngress indicates that the Ingress Gateway is not available. This typically happens in Minikube. The Ingress component will fall back to node-port in this case.
func (*Environment) NamespaceForScope ¶
func (e *Environment) NamespaceForScope(scope lifecycle.Scope) string
NamespaceForScope returns the namespace to be used for the given scope.
func (*Environment) Reset ¶
func (e *Environment) Reset() error
Reset the environment before starting another test.
func (*Environment) SuiteNamespace ¶
func (e *Environment) SuiteNamespace() string
SuiteNamespace namespace used for non-system components that have Suite scope.
func (*Environment) SystemNamespace ¶
func (e *Environment) SystemNamespace() string
SystemNamespace namespace used for components deployed to the Istio system.
func (*Environment) TestNamespace ¶
func (e *Environment) TestNamespace() string
TestNamespace namespace used for non-system components that have Test scope.