client

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 38 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPostRendererFunc = func(rm meta.RESTMapper, kubeClient kube.Interface, owner client.Object) postrender.PostRenderer {
	return &ownerPostRenderer{rm, kubeClient, owner}
}

DefaultPostRendererFunc returns a post-renderer that applies owner references to compatible objects in a helm release manifest. This is the default post-renderer used by ActionClients created with NewActionClientGetter.

Functions

func MatchAllSecrets added in v0.4.0

func MatchAllSecrets(_ *corev1.Secret) bool

func NewOwnerRefSecretClient added in v0.4.0

func NewOwnerRefSecretClient(client clientcorev1.SecretInterface, refs []metav1.OwnerReference, match func(*corev1.Secret) bool) clientcorev1.SecretInterface

NewOwnerRefSecretClient returns a SecretInterface that injects the provided owner references to all created or updated secrets that match the provided match function. If match is nil, all secrets are matched.

Types

type ActionClientGetter

type ActionClientGetter interface {
	ActionClientFor(ctx context.Context, obj client.Object) (ActionInterface, error)
}

type ActionClientGetterFunc

type ActionClientGetterFunc func(ctx context.Context, obj client.Object) (ActionInterface, error)

func (ActionClientGetterFunc) ActionClientFor

func (acgf ActionClientGetterFunc) ActionClientFor(ctx context.Context, obj client.Object) (ActionInterface, error)

type ActionClientGetterOption added in v0.1.0

type ActionClientGetterOption func(*actionClientGetter) error

func AppendGetOptions added in v0.1.0

func AppendGetOptions(opts ...GetOption) ActionClientGetterOption

func AppendHistoryOptions added in v0.6.0

func AppendHistoryOptions(opts ...HistoryOption) ActionClientGetterOption

func AppendInstallFailureUninstallOptions added in v0.1.0

func AppendInstallFailureUninstallOptions(opts ...UninstallOption) ActionClientGetterOption

func AppendInstallOptions added in v0.1.0

func AppendInstallOptions(opts ...InstallOption) ActionClientGetterOption

func AppendPostRenderers added in v0.1.0

func AppendPostRenderers(postRendererFns ...PostRendererProvider) ActionClientGetterOption

func AppendUninstallOptions added in v0.1.0

func AppendUninstallOptions(opts ...UninstallOption) ActionClientGetterOption

func AppendUpgradeFailureRollbackOptions added in v0.1.0

func AppendUpgradeFailureRollbackOptions(opts ...RollbackOption) ActionClientGetterOption

func AppendUpgradeOptions added in v0.1.0

func AppendUpgradeOptions(opts ...UpgradeOption) ActionClientGetterOption

func WithFailureRollbacks added in v0.3.0

func WithFailureRollbacks(enableFailureRollbacks bool) ActionClientGetterOption

type ActionConfigGetter

type ActionConfigGetter interface {
	ActionConfigFor(ctx context.Context, obj client.Object) (*action.Configuration, error)
}

func NewActionConfigGetter

func NewActionConfigGetter(baseRestConfig *rest.Config, rm meta.RESTMapper, opts ...ActionConfigGetterOption) (ActionConfigGetter, error)

type ActionConfigGetterOption added in v0.1.0

type ActionConfigGetterOption func(getter *actionConfigGetter)

func ClientNamespaceMapper added in v0.1.0

func ClientNamespaceMapper(m ObjectToStringMapper) ActionConfigGetterOption

func ClientRestConfigMapper added in v0.4.0

func ClientRestConfigMapper(f ObjectToRestConfigMapper) ActionConfigGetterOption

func DisableStorageOwnerRefInjection deprecated added in v0.1.0

func DisableStorageOwnerRefInjection(v bool) ActionConfigGetterOption

Deprecated: use StorageDriverMapper(DefaultSecretsStorageDriver(SecretsStorageDriverOpts)) instead.

func RestConfigMapper deprecated added in v0.2.0

Deprecated: use ClientRestConfigMapper and StorageRestConfigMapper instead.

func StorageDriverMapper added in v0.4.0

func StorageNamespaceMapper deprecated added in v0.1.0

func StorageNamespaceMapper(m ObjectToStringMapper) ActionConfigGetterOption

Deprecated: use StorageDriverMapper(DefaultSecretsStorageDriver(SecretsStorageDriverOpts)) instead.

func StorageRestConfigMapper added in v0.4.0

func StorageRestConfigMapper(f ObjectToRestConfigMapper) ActionConfigGetterOption

type ActionInterface

type ActionInterface interface {
	Get(name string, opts ...GetOption) (*release.Release, error)
	History(name string, opts ...HistoryOption) ([]*release.Release, error)
	Install(name, namespace string, chrt *chart.Chart, vals map[string]interface{}, opts ...InstallOption) (*release.Release, error)
	Upgrade(name, namespace string, chrt *chart.Chart, vals map[string]interface{}, opts ...UpgradeOption) (*release.Release, error)
	Uninstall(name string, opts ...UninstallOption) (*release.UninstallReleaseResponse, error)
	Reconcile(rel *release.Release) error
}

type GetOption

type GetOption func(*action.Get) error

type HistoryOption added in v0.6.0

type HistoryOption func(*action.History) error

type InstallOption

type InstallOption func(*action.Install) error

func AppendInstallPostRenderer added in v0.1.0

func AppendInstallPostRenderer(pr postrender.PostRenderer) InstallOption

AppendInstallPostRenderer appends a post-renderer to the existing chain of post-renderers configured for the install. This function should be used instead of WithInstallPostRenderer if you want to inherit the default set of post-renderers configured by an ActionClientGetter.

func WithInstallPostRenderer added in v0.1.0

func WithInstallPostRenderer(pr postrender.PostRenderer) InstallOption

WithInstallPostRenderer sets the post-renderer to use for the install. It overrides any post-renderer that may already be configured or set as a default.

type ObjectToRestConfigMapper added in v0.4.0

type ObjectToRestConfigMapper func(context.Context, client.Object, *rest.Config) (*rest.Config, error)

type ObjectToStorageDriverMapper added in v0.4.0

type ObjectToStorageDriverMapper func(context.Context, client.Object, *rest.Config) (driver.Driver, error)

func DefaultSecretsStorageDriver added in v0.4.0

func DefaultSecretsStorageDriver(opts SecretsStorageDriverOpts) ObjectToStorageDriverMapper

type ObjectToStringMapper added in v0.1.0

type ObjectToStringMapper func(client.Object) (string, error)

type PostRendererFunc added in v0.1.0

type PostRendererFunc func(buffer *bytes.Buffer) (*bytes.Buffer, error)

PostRendererFunc defines a function signature that implements helm's PostRenderer interface.

func (PostRendererFunc) Run added in v0.1.0

func (f PostRendererFunc) Run(buffer *bytes.Buffer) (*bytes.Buffer, error)

Run runs the post-renderer function.

type PostRendererProvider added in v0.1.0

type PostRendererProvider func(rm meta.RESTMapper, kubeClient kube.Interface, obj client.Object) postrender.PostRenderer

PostRendererProvider is a function that returns a post-renderer for a given object. obj represents the custom resource that is being reconciled.

type RollbackOption added in v0.1.0

type RollbackOption func(*action.Rollback) error

type SecretsStorageDriverOpts added in v0.4.0

type SecretsStorageDriverOpts struct {
	DisableOwnerRefInjection bool
	StorageNamespaceMapper   ObjectToStringMapper
}

type UninstallOption

type UninstallOption func(*action.Uninstall) error

type UpgradeOption

type UpgradeOption func(*action.Upgrade) error

func AppendUpgradePostRenderer added in v0.1.0

func AppendUpgradePostRenderer(pr postrender.PostRenderer) UpgradeOption

AppendUpgradePostRenderer appends a post-renderer to the existing chain of post-renderers configured for the upgrade. This function should be used instead of WithUpgradePostRenderer if you want to inherit the default set of post-renderers configured by an ActionClientGetter.

func WithUpgradePostRenderer added in v0.1.0

func WithUpgradePostRenderer(pr postrender.PostRenderer) UpgradeOption

WithUpgradePostRenderer sets the post-renderer to use for the upgrade. It overrides any post-renderer that may already be configured or set as a default.

Jump to

Keyboard shortcuts

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