Documentation
¶
Index ¶
- Constants
- Variables
- func BuildResources(ctx context.Context, deployType common.DeployType, releaseNamespace string, ...) ([]*InstallableResource, []*DeletableResource, error)
- func InstallableResourceSortByWeightHandler(r1, r2 *InstallableResource) bool
- func IsSensitive(groupKind schema.GroupKind, annotations map[string]string) bool
- func KeepOnDelete(meta *spec.ResourceMeta, releaseNamespace string) bool
- func ParseSensitivePaths(value string) []string
- func RedactSensitiveData(unstruct *unstructured.Unstructured, sensitivePaths []string) *unstructured.Unstructured
- func ValidateLocal(ctx context.Context, releaseNamespace string, ...) error
- func ValidateResourcePolicy(meta *spec.ResourceMeta) error
- type BuildResourcesOptions
- type DeletableResource
- type DeletableResourceOptions
- type ExternalDependency
- type InstallableResource
- type InstallableResourceOptions
- type InternalDependency
- type SensitiveInfo
Constants ¶
const HideAll = "$$HIDE_ALL$$"
Variables ¶
var ErrResourceValidationSourceSanityCheck = errors.New("resource validation source sanity check")
Functions ¶
func BuildResources ¶
func BuildResources(ctx context.Context, deployType common.DeployType, releaseNamespace string, prevRelResSpecs, newRelResSpecs []*spec.ResourceSpec, patchers []spec.ResourcePatcher, clientFactory kube.ClientFactorier, opts BuildResourcesOptions) ([]*InstallableResource, []*DeletableResource, error)
Build Installable/DeletableResources from ResourceSpecs. Resulting Resources can be used to construct Installable/DeletableResourceInfos later. Must never contact the cluster, because this is called even when no cluster access allowed.
func InstallableResourceSortByWeightHandler ¶
func InstallableResourceSortByWeightHandler(r1, r2 *InstallableResource) bool
func KeepOnDelete ¶
func KeepOnDelete(meta *spec.ResourceMeta, releaseNamespace string) bool
func ParseSensitivePaths ¶
func RedactSensitiveData ¶
func RedactSensitiveData(unstruct *unstructured.Unstructured, sensitivePaths []string) *unstructured.Unstructured
func ValidateLocal ¶
func ValidateLocal(ctx context.Context, releaseNamespace string, transformedResources []*InstallableResource, opts common.ResourceValidationOptions) error
Can be called even without cluster access.
func ValidateResourcePolicy ¶
func ValidateResourcePolicy(meta *spec.ResourceMeta) error
Types ¶
type BuildResourcesOptions ¶
type BuildResourcesOptions struct {
DefaultDeletePropagation metav1.DeletionPropagation
Remote bool
}
type DeletableResource ¶
type DeletableResource struct {
*spec.ResourceMeta
AutoInternalDependencies []*InternalDependency
DeletePropagation metav1.DeletionPropagation
KeepOnDelete bool
ManualInternalDependencies []*InternalDependency
Ownership common.Ownership
}
Represent a Kubernetes resource that can be deleted. Higher level than ResourceMeta, but lower level than DeletableResourceInfo. If something can be computed on this level instead of doing this on higher levels, it's better to do it here.
func NewDeletableResource ¶
func NewDeletableResource(resourceSpec *spec.ResourceSpec, otherResourceSpecs []*spec.ResourceSpec, releaseNamespace string, opts DeletableResourceOptions) *DeletableResource
Construct a DeletableResource from a ResourceSpec. Must never contact the cluster, because this is called even when no cluster access allowed.
type DeletableResourceOptions ¶
type DeletableResourceOptions struct {
DefaultDeletePropagation metav1.DeletionPropagation
}
type ExternalDependency ¶
type ExternalDependency struct {
*spec.ResourceMeta `json:"resourceMeta"`
}
Represents a dependency on an external resource outside of the Helm release.
type InstallableResource ¶
type InstallableResource struct {
*spec.ResourceSpec `json:"resourceSpec"`
Ownership common.Ownership `json:"ownership"`
Recreate bool `json:"recreate"`
RecreateOnImmutable bool `json:"recreateOnImmutable"`
DefaultReplicasOnCreation *int `json:"defaultReplicasOnCreation,omitempty"`
DeleteOnSucceeded bool `json:"deleteOnSucceeded"`
DeleteOnFailed bool `json:"deleteOnFailed"`
KeepOnDelete bool `json:"keepOnDelete"`
FailMode multitrack.FailMode `json:"failMode"`
FailuresAllowed int `json:"failuresAllowed"`
IgnoreReadinessProbeFailsForContainers map[string]time.Duration `json:"ignoreReadinessProbeFailsForContainers,omitempty"`
LogRegex *regexp.Regexp `json:"logRegex"`
LogRegexesForContainers map[string]*regexp.Regexp `json:"logRegexesForContainers"`
NoActivityTimeout time.Duration `json:"noActivityTimeout"`
ShowLogsOnlyForContainers []string `json:"showLogsOnlyForContainers,omitempty"`
ShowServiceMessages bool `json:"showServiceMessages"`
ShowLogsOnlyForNumberOfReplicas int `json:"showLogsOnlyForNumberOfReplicas"`
SkipLogs bool `json:"skipLogs"`
SkipLogsForContainers []string `json:"skipLogsForContainers,omitempty"`
SkipLogsRegex *regexp.Regexp `json:"skipLogsRegex"`
SkipLogsRegexForContainers map[string]*regexp.Regexp `json:"skipLogsRegexForContainers"`
TrackTerminationMode multitrack.TrackTerminationMode `json:"trackTerminationMode"`
Weight *int `json:"weight,omitempty"`
ManualInternalDependencies []*InternalDependency `json:"manualInternalDependencies,omitempty"`
AutoInternalDependencies []*InternalDependency `json:"autoInternalDependencies,omitempty"`
ExternalDependencies []*ExternalDependency `json:"externalDependencies,omitempty"`
DeployConditions map[common.On][]common.Stage `json:"deployConditions"`
DeletePropagation metav1.DeletionPropagation `json:"deletePropagation"`
}
Represent a Kubernetes resource that can be installed. Higher level than ResourceSpec, but lower level than InstallableResourceInfo. If something can be computed on this level instead of doing this on higher levels, it's better to do it here.
func NewInstallableResource ¶
func NewInstallableResource(res *spec.ResourceSpec, releaseNamespace string, clientFactory kube.ClientFactorier, opts InstallableResourceOptions) (*InstallableResource, error)
Construct an InstallableResource from a ResourceSpec. Must never contact the cluster, because this is called even when no cluster access allowed.
type InstallableResourceOptions ¶
type InstallableResourceOptions struct {
DefaultDeletePropagation metav1.DeletionPropagation
Remote bool
}
type InternalDependency ¶
type InternalDependency struct {
*spec.ResourceMatcher `json:"resourceMatcher"`
ResourceState common.ResourceState `json:"resourceState"`
}
Represents a dependency on a Kubernetes resource in the Helm release.
type SensitiveInfo ¶
func GetSensitiveInfo ¶
func GetSensitiveInfo(groupKind schema.GroupKind, annotations map[string]string) SensitiveInfo
func (*SensitiveInfo) FullySensitive ¶
func (i *SensitiveInfo) FullySensitive() bool