machine

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package machine provides a number of utility functions encapsulating often-used sequences. I.e. create/delete applications/configurations, bind/unbind configurations, etc. This is done in the hope of enhancing the readability of various before/after blocks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Machine

type Machine struct {
	// contains filtered or unexported fields
}

func New

func New(dir, user, password, adminToken, userToken, root, epinioBinaryPath string) Machine

func (*Machine) BindAppConfiguration added in v0.6.0

func (m *Machine) BindAppConfiguration(appName, configurationName, namespace string)

func (*Machine) CleanupApp

func (m *Machine) CleanupApp(appName string)

func (*Machine) CleanupConfiguration added in v0.6.0

func (m *Machine) CleanupConfiguration(configurationName string)

func (*Machine) Client

func (m *Machine) Client() *http.Client

func (*Machine) CreateEpinioUser added in v0.1.4

func (m *Machine) CreateEpinioUser(role string, namespaces []string) (string, string)

CreateEpinioUser creates a new "user" BasicAuth Secret labeled as an Epinio User.

func (*Machine) Curl

func (m *Machine) Curl(method, uri string, requestBody io.Reader) (*http.Response, error)

Curl is used to make requests against a server

func (*Machine) DeleteApp

func (m *Machine) DeleteApp(appName string)

func (*Machine) DeleteAppchart added in v1.2.0

func (m *Machine) DeleteAppchart(tempFile string)

func (*Machine) DeleteConfigurations added in v1.3.0

func (m *Machine) DeleteConfigurations(configurationNames ...string)

func (*Machine) DeleteConfigurationsUnbind added in v1.3.0

func (m *Machine) DeleteConfigurationsUnbind(configurationNames ...string)

func (*Machine) DeleteConfigurationsWithUnbind added in v1.3.0

func (m *Machine) DeleteConfigurationsWithUnbind(configurationNames []string, unbind bool)

func (*Machine) DeleteEpinioUser added in v0.1.4

func (m *Machine) DeleteEpinioUser(username string) error

DeleteEpinioUser deletes the relevant Kubernetes secret if it exists.

func (*Machine) DeleteNamespace added in v0.1.5

func (m *Machine) DeleteNamespace(namespace string)

func (*Machine) DeleteService

func (m *Machine) DeleteService(serviceName string)

func (*Machine) Epinio

func (m *Machine) Epinio(dir, command string, arg ...string) (string, error)

Epinio invokes the `epinio` binary, running the specified command. It returns the command output and/or error. dir parameter defines the directory from which the command should be run. It defaults to the current dir if left empty.

func (*Machine) EpinioCmd added in v1.8.1

func (m *Machine) EpinioCmd(command string, arg ...string) *exec.Cmd

EpinioCmd creates a Cmd to run the Epinio client

func (*Machine) EpinioPush added in v0.4.0

func (m *Machine) EpinioPush(dir string, name string, arg ...string) (string, error)

EpinioPush shows the staging log if the error indicates that staging failed

func (*Machine) GetPodNames

func (m *Machine) GetPodNames(appName, namespaceName string) []string

func (*Machine) GetSettings added in v0.6.0

func (m *Machine) GetSettings() (*settings.Settings, error)

func (*Machine) GetSettingsFrom added in v0.6.0

func (m *Machine) GetSettingsFrom(location string) (*settings.Settings, error)

func (*Machine) HaveConfiguration added in v1.4.0

func (m *Machine) HaveConfiguration(configurationName string)

func (*Machine) HaveServiceInstance added in v1.4.0

func (m *Machine) HaveServiceInstance(serviceName string)

func (*Machine) MakeApp

func (m *Machine) MakeApp(appName string, instances int, deployFromCurrentDir bool) string

func (*Machine) MakeAppWithDir

func (m *Machine) MakeAppWithDir(appName string, instances int, deployFromCurrentDir bool, appDir string, more ...string) string

func (*Machine) MakeAppWithDirSimple added in v0.1.2

func (m *Machine) MakeAppWithDirSimple(appName string, deployFromCurrentDir bool, appDir string) string

func (*Machine) MakeAppchart added in v1.2.0

func (m *Machine) MakeAppchart(chartName string) string

func (*Machine) MakeAppchartStateful added in v1.2.0

func (m *Machine) MakeAppchartStateful(chartName string) string

func (*Machine) MakeConfiguration added in v0.6.0

func (m *Machine) MakeConfiguration(configurationName string)

func (*Machine) MakeConfigurationFromFiles added in v1.9.0

func (m *Machine) MakeConfigurationFromFiles(configurationName, path string)

func (*Machine) MakeContainerImageApp added in v0.1.2

func (m *Machine) MakeContainerImageApp(appName string, instances int, containerImageURL string) string

func (*Machine) MakeGitconfig added in v1.10.0

func (m *Machine) MakeGitconfig(gitConfigName string)

func (*Machine) MakeGitconfigWithoutCleanup added in v1.10.0

func (m *Machine) MakeGitconfigWithoutCleanup(gitConfigName string)

func (*Machine) MakeGolangApp

func (m *Machine) MakeGolangApp(appName string, instances int, deployFromCurrentDir bool) string

func (*Machine) MakeRoutedContainerImageApp added in v0.6.3

func (m *Machine) MakeRoutedContainerImageApp(appName string, instances int, containerImageURL, route string, more ...string) string

func (*Machine) MakeServiceInstance added in v0.7.0

func (m *Machine) MakeServiceInstance(serviceName, catalogService string)

func (*Machine) MakeWebSocketConnection

func (m *Machine) MakeWebSocketConnection(authToken string, url string, subprotocols ...string) (*websocket.Conn, error)

func (*Machine) SaveApplicationSpec added in v1.1.0

func (m *Machine) SaveApplicationSpec(appName string)

SaveApplicationSpec is a debugging helper function saving the specified application's manifest and helm data (values, chart) into file and directory named after the application.

Note: Intended use is debugging of a test case. Most tests cases will not need this as part of their regular operation.

__Attention__: The created files and directory are __not cleaned up automatically__

func (*Machine) SaveServerLogs added in v1.1.0

func (m *Machine) SaveServerLogs(destination string)

SaveServerLogs is a debugging helper function saving the test server's logs (last 3 minutes) into the specified file.

Note: Intended use is debugging of a test case. Most tests cases will not need this as part of their regular operation.

__Attention__: The created file is __not cleaned up automatically__

func (*Machine) SetupAndTargetNamespace added in v0.2.1

func (m *Machine) SetupAndTargetNamespace(namespace string)

func (*Machine) SetupNamespace added in v0.9.0

func (m *Machine) SetupNamespace(namespace string)

func (*Machine) ShowStagingLogs added in v0.3.6

func (m *Machine) ShowStagingLogs(app string)

func (*Machine) TargetNamespace added in v0.2.1

func (m *Machine) TargetNamespace(namespace string)

func (*Machine) UnbindAppConfiguration added in v0.6.0

func (m *Machine) UnbindAppConfiguration(appName, configurationName, namespace string)

func (*Machine) VerifyAppConfigurationBound added in v0.6.0

func (m *Machine) VerifyAppConfigurationBound(appName, configurationName, namespace string, offset int)

func (*Machine) VerifyAppConfigurationNotbound added in v0.6.0

func (m *Machine) VerifyAppConfigurationNotbound(appName, configurationName, namespace string, offset int)

func (*Machine) VerifyNamespaceNotExist added in v0.2.1

func (m *Machine) VerifyNamespaceNotExist(namespace string)

func (*Machine) Versions added in v1.4.0

func (m *Machine) Versions()

Jump to

Keyboard shortcuts

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