Documentation
¶
Overview ¶
Package orphans deletes what an application instance leaves beside its Helm release: objects its workloads or hooks create at runtime, and the release hooks an uninstall does not delete. The package declares the kinds of such objects; the instance's objects among them are the ones in its namespace that carry its instance label.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resource ¶
type Resource struct {
// Kind is the kind of the objects, e.g. Job.
Kind string `json:"kind"`
// Version is the API version the kind is served at. A bare version ("v1") matches the kind in
// every group serving it at that version, so Job is declared by "v1" just as Pod is; a
// group-qualified one ("batch/v1") matches that group only.
Version string `json:"version"`
}
Resource is a kind of object an application leaves beside its release, as its package declares it under orphanResources in its values:
orphanResources:
- kind: Job
version: v1
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service deletes what application instances leave beside their releases.
func NewService ¶
NewService creates a service that lists and deletes objects through the given client.
func (*Service) Delete ¶
func (s *Service) Delete(ctx context.Context, namespace, instance string, resources []Resource) error
Delete deletes the objects of the declared kinds the instance left in its namespace: those that carry its instance label. It is meant to run once the instance's release is uninstalled, so that nothing of the instance is left to recreate them.
Only what a retry can fix fails the call, since a removal waits on it. A kind the cluster does not serve has no objects to delete. A cluster-scoped kind is skipped: the instance label names an instance within its namespace alone, so across the cluster it matches the instances of the same name in other namespaces too. An object that says it outlives its release is left, as the uninstall left it.