mirror of https://github.com/helm/helm
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.3 KiB
69 lines
2.3 KiB
7 years ago
|
/*
|
||
6 years ago
|
Copyright The Helm Authors.
|
||
7 years ago
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
you may not use this file except in compliance with the License.
|
||
|
You may obtain a copy of the License at
|
||
|
|
||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||
|
|
||
|
Unless required by applicable law or agreed to in writing, software
|
||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
See the License for the specific language governing permissions and
|
||
|
limitations under the License.
|
||
|
*/
|
||
|
|
||
7 years ago
|
package release
|
||
|
|
||
7 years ago
|
import "time"
|
||
7 years ago
|
|
||
6 years ago
|
// HookEvent specifies the hook event
|
||
7 years ago
|
type HookEvent string
|
||
7 years ago
|
|
||
6 years ago
|
// Hook event types
|
||
7 years ago
|
const (
|
||
7 years ago
|
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"
|
||
7 years ago
|
)
|
||
|
|
||
7 years ago
|
func (x HookEvent) String() string { return string(x) }
|
||
7 years ago
|
|
||
6 years ago
|
// HookDeletePolicy specifies the hook delete policy
|
||
7 years ago
|
type HookDeletePolicy string
|
||
7 years ago
|
|
||
6 years ago
|
// Hook delete policy types
|
||
7 years ago
|
const (
|
||
7 years ago
|
HookSucceeded HookDeletePolicy = "succeeded"
|
||
|
HookFailed HookDeletePolicy = "failed"
|
||
|
HookBeforeHookCreation HookDeletePolicy = "before-hook-creation"
|
||
7 years ago
|
)
|
||
|
|
||
7 years ago
|
func (x HookDeletePolicy) String() string { return string(x) }
|
||
7 years ago
|
|
||
7 years ago
|
// Hook defines a hook object.
|
||
|
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.
|
||
7 years ago
|
Events []HookEvent `json:"events,omitempty"`
|
||
7 years ago
|
// LastRun indicates the date/time this was last run.
|
||
7 years ago
|
LastRun time.Time `json:"last_run,omitempty"`
|
||
7 years ago
|
// Weight indicates the sort order for execution among similar Hook type
|
||
7 years ago
|
Weight int `json:"weight,omitempty"`
|
||
7 years ago
|
// DeletePolicies are the policies that indicate when to delete the hook
|
||
7 years ago
|
DeletePolicies []HookDeletePolicy `json:"delete_policies,omitempty"`
|
||
7 years ago
|
}
|