k8s

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RestConfigFromEnv

func RestConfigFromEnv(envVar string) (*rest.Config, error)

func RestConfigFromKubeConfig

func RestConfigFromKubeConfig(b []byte) (*rest.Config, error)

func RestInclusterConfig

func RestInclusterConfig() (*rest.Config, error)

Types

type Client

type Client interface {
	// client go like
	Get(ctx context.Context, nn types.NamespacedName, obj client.Object) error
	List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
	Create(ctx context.Context, obj client.Object) error
	Update(ctx context.Context, obj client.Object) error
	Delete(ctx context.Context, obj client.Object) error

	ListSecrets(ctx context.Context, namespace string, secretType corev1.SecretType) ([]corev1.Secret, error)

	// custom ones
	ValidateObject(ctx context.Context, obj client.Object) error

	ApplyYAML(ctx context.Context, yamls ...[]byte) error
	DeleteYAML(ctx context.Context, yamls ...[]byte) error

	ReadLogs(ctx context.Context, namespace, name string, writer io.WriteCloser, opts *ReadLogsOptions) error
}

func NewClient

func NewClient(cfg *rest.Config, scheme *runtime.Scheme) (Client, error)

type InvalidSchemaError

type InvalidSchemaError struct {
	// contains filtered or unexported fields
}

func NewInvalidSchemaError

func NewInvalidSchemaError(err error, errMsgs []string) InvalidSchemaError

func (InvalidSchemaError) Error

func (ise InvalidSchemaError) Error() string

type LogLine

type LogLine struct {
	Message       string `json:"message"`
	Timestamp     string `json:"timestamp"`
	PodName       string `json:"podName"`
	ContainerName string `json:"containerName"`
}

type ReadLogsOptions

type ReadLogsOptions struct {
	ContainerName string
	SinceSeconds  *int64
	TailLines     *int64
}

Jump to

Keyboard shortcuts

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