orphans

package
v1.77.9 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package orphans deletes what an application instance leaves beside its Helm release: objects its workloads or hooks create at runtime, and the rendered objects an uninstall does not delete — the release hooks, the objects owned by anyone, such as a Job deployed on install only, and the objects a werf resource policy keeps. 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

func NewService(client kubeClient, logger *log.Logger) *Service

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 with the keep Helm resource policy is left, as the uninstall left it.

Jump to

Keyboard shortcuts

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