Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MockHookTemplate = `apiVersion: v1
kind: Job
metadata:
annotations:
"helm.sh/hook": pre-install
`
MockHookTemplate is the hook template used for all mock release objects.
var MockManifest = `apiVersion: v1
kind: Secret
metadata:
name: fixture
`
MockManifest is the manifest used for all mock release objects.
Functions ¶
This section is empty.
Types ¶
type GetReleaseStatusResponse ¶
type GetReleaseStatusResponse struct { // Name is the name of the release. Name string `json:"name,omitempty"` // Info contains information about the release. Info *Info `json:"info,omitempty"` // Namespace the release was released into Namespace string `json:"namespace,omitempty"` }
GetReleaseStatusResponse is the response indicating the status of the named release.
type Hook ¶
type Hook struct { Name string `json:"name,omitempty"` // Kind is the Kubernetes kind. Kind string `json:"kind,omitempty"` // Path is the chart-relative path to the template. Path string `json:"path,omitempty"` // Manifest is the manifest contents. Manifest string `json:"manifest,omitempty"` // Events are the events that this hook fires on. Events []HookEvent `json:"events,omitempty"` // LastRun indicates the date/time this was last run. LastRun time.Time `json:"last_run,omitempty"` // Weight indicates the sort order for execution among similar Hook type Weight int `json:"weight,omitempty"` // DeletePolicies are the policies that indicate when to delete the hook DeletePolicies []HookDeletePolicy `json:"delete_policies,omitempty"` }
Hook defines a hook object.
type HookDeletePolicy ¶
type HookDeletePolicy string
HookDeletePolicy specifies the hook delete policy
const ( HookSucceeded HookDeletePolicy = "succeeded" HookFailed HookDeletePolicy = "failed" HookBeforeHookCreation HookDeletePolicy = "before-hook-creation" )
Hook delete policy types
func (HookDeletePolicy) String ¶
func (x HookDeletePolicy) String() string
type HookEvent ¶
type HookEvent string
HookEvent specifies the hook event
const ( HookPreInstall HookEvent = "pre-install" HookPostInstall HookEvent = "post-install" HookPreDelete HookEvent = "pre-delete" HookPostDelete HookEvent = "post-delete" HookPreUpgrade HookEvent = "pre-upgrade" HookPostUpgrade HookEvent = "post-upgrade" HookPreRollback HookEvent = "pre-rollback" HookPostRollback HookEvent = "post-rollback" HookReleaseTestSuccess HookEvent = "release-test-success" HookReleaseTestFailure HookEvent = "release-test-failure" )
Hook event types
type Info ¶
type Info struct { // FirstDeployed is when the release was first deployed. FirstDeployed time.Time `json:"first_deployed,omitempty"` // LastDeployed is when the release was last deployed. LastDeployed time.Time `json:"last_deployed,omitempty"` // Deleted tracks when this object was deleted. Deleted time.Time `json:"deleted,omitempty"` // Description is human-friendly "log entry" about this release. Description string `json:"Description,omitempty"` // Status is the current state of the release Status Status `json:"status,omitempty"` // Cluster resources as kubectl would print them. Resources string `json:"resources,omitempty"` // Contains the rendered templates/NOTES.txt if available Notes string `json:"notes,omitempty"` // LastTestSuiteRun provides results on the last test run on a release LastTestSuiteRun *TestSuite `json:"last_test_suite_run,omitempty"` }
Info describes release information.
type MockReleaseOptions ¶
type MockReleaseOptions struct { Name string Version int Chart *chart.Chart Status Status Namespace string TestSuiteResults []*TestRun }
MockReleaseOptions allows for user-configurable options on mock release objects.
type Release ¶
type Release struct { // Name is the name of the release Name string `json:"name,omitempty"` // Info provides information about a release Info *Info `json:"info,omitempty"` // Chart is the chart that was released. Chart *chart.Chart `json:"chart,omitempty"` // Config is the set of extra Values added to the chart. // These values override the default values inside of the chart. Config map[string]interface{} `json:"config,omitempty"` // Manifest is the string representation of the rendered template. Manifest string `json:"manifest,omitempty"` // Hooks are all of the hooks declared for this release. Hooks []*Hook `json:"hooks,omitempty"` // Version is an int which represents the version of the release. Version int `json:"version,omitempty"` // Namespace is the kubernetes namespace of the release. Namespace string `json:"namespace,omitempty"` }
Release describes a deployment of a chart, together with the chart and the variables used to deploy that chart.
func Mock ¶
func Mock(opts *MockReleaseOptions) *Release
Mock creates a mock release object based on options set by MockReleaseOptions. This function should typically not be used outside of testing.
type Status ¶
type Status string
Status is the status of a release
const ( // StatusUnknown indicates that a release is in an uncertain state. StatusUnknown Status = "unknown" // StatusDeployed indicates that the release has been pushed to Kubernetes. StatusDeployed Status = "deployed" // StatusUninstalled indicates that a release has been uninstalled from Kubermetes. StatusUninstalled Status = "uninstalled" // StatusSuperseded indicates that this release object is outdated and a newer one exists. StatusSuperseded Status = "superseded" // StatusFailed indicates that the release was not successfully deployed. StatusFailed Status = "failed" // StatusUninstalling indicates that a uninstall operation is underway. StatusUninstalling Status = "uninstalling" // StatusPendingInstall indicates that an install operation is underway. StatusPendingInstall Status = "pending-install" // StatusPendingUpgrade indicates that an upgrade operation is underway. StatusPendingUpgrade Status = "pending-upgrade" // StatusPendingRollback indicates that an rollback operation is underway. StatusPendingRollback Status = "pending-rollback" )
Describe the status of a release
type TestReleaseResponse ¶
type TestReleaseResponse struct { Msg string `json:"msg,omitempty"` Status TestRunStatus `json:"status,omitempty"` }
TestReleaseResponse represents a message from executing a test
type TestRun ¶
type TestRun struct { Name string `json:"name,omitempty"` Status TestRunStatus `json:"status,omitempty"` Info string `json:"info,omitempty"` StartedAt time.Time `json:"started_at,omitempty"` CompletedAt time.Time `json:"completed_at,omitempty"` }
TestRun describes the run of a test
type TestRunStatus ¶
type TestRunStatus string
TestRunStatus is the status of a test run
const ( TestRunUnknown TestRunStatus = "unknown" TestRunSuccess TestRunStatus = "success" TestRunFailure TestRunStatus = "failure" TestRunRunning TestRunStatus = "running" )
Indicates the results of a test run
func (TestRunStatus) String ¶
func (x TestRunStatus) String() string
Strng converts a test run status to a printable string
type TestSuite ¶
type TestSuite struct { // StartedAt indicates the date/time this test suite was kicked off StartedAt time.Time `json:"started_at,omitempty"` // CompletedAt indicates the date/time this test suite was completed CompletedAt time.Time `json:"completed_at,omitempty"` // Results are the results of each segment of the test Results []*TestRun `json:"results,omitempty"` }
TestSuite comprises of the last run of the pre-defined test suite of a release version
type UninstallReleaseResponse ¶
type UninstallReleaseResponse struct { // Release is the release that was marked deleted. Release *Release `json:"release,omitempty"` // Info is an uninstall message Info string `json:"info,omitempty"` }
UninstallReleaseResponse represents a successful response to an uninstall request.