k8s

package
v0.44.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidReference if given reference is invalid.
	ErrInvalidReference = errors.New("reference is invalid")

	// ErrNotAddressable if found resource isn't addressable.
	ErrNotAddressable = errors.New("resource isn't addressable")

	// ErrUnexcpected if something unexpected actually has happened.
	ErrUnexcpected = errors.New("something unexpected actually has happened")

	// ErrJobFailed if the job has failed.
	ErrJobFailed = errors.New("the Kubernetes job failed")
)
View Source
var ErrNoKubernetesConnection = errors.New("no Kubernetes connection")

ErrNoKubernetesConnection if we can't connect to Kube API server.

Functions

This section is empty.

Types

type Clients

type Clients interface {
	Namespace() string
	Typed() kubernetes.Interface
	Dynamic() dynamic.Interface
	Serving() servingv1.ServingV1Interface
	Eventing() eventingv1.EventingV1Interface
	Messaging() messagingv1.MessagingV1Interface
}

Clients holds available Kubernetes clients.

func NewClients added in v0.43.0

func NewClients(cfg *Configurator) (Clients, error)

NewClients creates kubernetes clients.

type Configurator added in v0.43.0

type Configurator struct {
	ClientConfig func() (clientcmd.ClientConfig, error)
	Namespace    *string
}

Configurator for creating the Kube's clients.

type JobRunner

type JobRunner interface {
	Run(ctx context.Context, job *batchv1.Job) error
}

JobRunner will launch a Job and monitor it for completion.

func NewJobRunner added in v0.43.0

func NewJobRunner(kube Clients) JobRunner

NewJobRunner will create a JobRunner, or return an error.

type NewKubeClients added in v0.43.0

type NewKubeClients func(configurator *Configurator) (Clients, error)

NewKubeClients creates Clients.

type Params added in v0.43.0

type Params struct {
	Namespace string
	knk8s.Params
}

Params contain Kubernetes specific params, that CLI should comply to.

func (*Params) Parse added in v0.43.0

func (kp *Params) Parse() *Configurator

Parse will build k8s.Configurator struct which could be used to initiate the k8s.Clients.

func (*Params) SetCommandFlags added in v0.43.0

func (kp *Params) SetCommandFlags(flags *pflag.FlagSet)

func (*Params) SetGlobalFlags added in v0.43.0

func (kp *Params) SetGlobalFlags(flags *pflag.FlagSet)

type ReferenceAddressResolver

type ReferenceAddressResolver interface {
	ResolveAddress(ctx context.Context, ref *sink.Reference, relativeURI string) (*url.URL, error)
}

ReferenceAddressResolver will resolve the tracker.Reference to an url.URL, or return an error.

func NewAddressResolver added in v0.43.0

func NewAddressResolver(kube Clients) ReferenceAddressResolver

NewAddressResolver will create ReferenceAddressResolver or return an error.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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