secrets

package
v2.11.9 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package secrets contains the client for working with Kubernetes Secrets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildParamsSecret

func BuildParamsSecret(owner kmeta.OwnerRefable, name string, params json.RawMessage) *v1.Secret

BuildParamsSecret builds a secret that holds parameters for a service instance or binding.

func ConditionDeleted

func ConditionDeleted(_ *v1.Secret, apiErr error) (bool, error)

ConditionDeleted is a ConditionFuncE that succeeds if the error returned by the cluster was a not found error.

func CreateJSONPatch

func CreateJSONPatch(params json.RawMessage) (data []byte, err error)

CreateJSONPatch creates a json patch object with the given json raw message.

Types

type Client

type Client interface {
	Create(ctx context.Context, namespace string, obj *v1.Secret) (*v1.Secret, error)
	Transform(ctx context.Context, namespace string, name string, transformer Mutator) (*v1.Secret, error)
	Get(ctx context.Context, namespace string, name string) (*v1.Secret, error)
	Delete(ctx context.Context, namespace string, name string) error
	List(ctx context.Context, namespace string) ([]v1.Secret, error)
	Upsert(ctx context.Context, namespace string, newObj *v1.Secret, merge Merger) (*v1.Secret, error)
	WaitFor(ctx context.Context, namespace string, name string, interval time.Duration, condition Predicate) (*v1.Secret, error)

	// Utility functions
	WaitForDeletion(ctx context.Context, namespace string, name string, interval time.Duration) (*v1.Secret, error)

	// ClientExtension can be used by the developer to extend the client.
	ClientExtension
}

Client is the interface for interacting with v1.Secret types as Secret CF style objects.

func NewClient

func NewClient(kclient cv1.SecretsGetter) Client

NewClient creates a new service client.

type ClientExtension

type ClientExtension interface {
	CreateParamsSecret(ctx context.Context, owner kmeta.OwnerRefable, name string, params json.RawMessage) (*v1.Secret, error)
	UpdateParamsSecret(ctx context.Context, namespace string, name string, params json.RawMessage) (*v1.Secret, error)
}

ClientExtension holds additional functions that should be exposed by client.

type ConditionFuncE

type ConditionFuncE func(instance *v1.Secret, apiErr error) (done bool, err error)

ConditionFuncE is a callback used by waitForE. Done should be set to true once the condition succeeds and shouldn't be called anymore. The error will be passed back to the user.

This function MAY retrieve a nil instance and an apiErr. It's up to the function to decide how to handle the apiErr.

type Merger

type Merger func(newObj, oldObj *v1.Secret) *v1.Secret

Merger is a type to merge an existing value with a new one.

type Mutator

type Mutator func(*v1.Secret) error

Mutator is a function that changes v1.Secret.

type Predicate

type Predicate func(*v1.Secret) bool

Predicate is a boolean function for a v1.Secret.

type ResourceInfo

type ResourceInfo struct{}

func NewResourceInfo

func NewResourceInfo() *ResourceInfo

NewResourceInfo returns a new instance of ResourceInfo

func (*ResourceInfo) FriendlyName

func (*ResourceInfo) FriendlyName() string

FriendlyName gets the user-facing name of the resource.

func (*ResourceInfo) GroupVersionKind

func (*ResourceInfo) GroupVersionKind(context.Context) schema.GroupVersionKind

GroupVersionKind gets the GVK struct for the resource.

func (*ResourceInfo) GroupVersionResource

func (*ResourceInfo) GroupVersionResource(context.Context) schema.GroupVersionResource

GroupVersionResource gets the GVR struct for the resource.

func (*ResourceInfo) Namespaced

func (*ResourceInfo) Namespaced() bool

Namespaced returns true if the type belongs in a namespace.

Directories

Path Synopsis
Package fake is a generated GoMock package.
Package fake is a generated GoMock package.

Jump to

Keyboard shortcuts

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