util

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterCloseErr added in v0.10.0

func FilterCloseErr(err error) bool

FilterCloseErr rewrites EOF and EPIPE errors to bool. Use when returning from call or handling errors from main read loop.

This purposely ignores errors with a wrapped cause.

func NodeName

func NodeName() (string, error)

NodeName returns the node name of this daemon

func NormalizeImageRef

func NormalizeImageRef(ref string) (reference.Named, error)

NormalizeImageRef normalizes the image reference.

func NormalizeImageRefToNameTag

func NormalizeImageRefToNameTag(ref string) (string, string, error)

NormalizeImageRefToNameTag normalizes the image reference to name and tag.

func ParseRegistry

func ParseRegistry(imageName string) string

ParseRegistry return the registry of image

func ParseRepositoryTag

func ParseRepositoryTag(repos string) (string, string)

ParseRepositoryTag gets a repos name and returns the right reposName + tag|digest The tag can be confusing because of a port in a repository name.

Ex: localhost.localdomain:5000/samalba/hipache:latest
Digest ex: localhost:5000/foo/bar@sha256:bc8813ea7b3603864987522f02a76101c17ad122e1c46d790efc0fca78ca7bfb

Types

type AuthInfo

type AuthInfo struct {
	Username string
	Password string
}

func (*AuthInfo) EncodeToString

func (i *AuthInfo) EncodeToString() string

type HealthCheck

type HealthCheck interface {
	Check(req *http.Request) error
}

HealthCheck defines the interface that a checker should impl.

type HealthCheckFunc

type HealthCheckFunc func(req *http.Request) error

HealthCheckFunc is the interface theat a checker should impl.

type Healthz

type Healthz struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Healthz is a manager which will run all healthChecks registered.

func NewHealthz

func NewHealthz() *Healthz

NewHealthz create a Healthz

func (*Healthz) Handler

func (h *Healthz) Handler(w http.ResponseWriter, r *http.Request)

Handler implements the http handler

func (*Healthz) Register

func (h *Healthz) Register(name string, handler HealthCheck)

Register a check handler

func (*Healthz) RegisterFunc

func (h *Healthz) RegisterFunc(name string, handler HealthCheckFunc)

RegisterFunc a check handlerFunc

func (*Healthz) SetInfo

func (h *Healthz) SetInfo(info string)

SetInfo set the information when /heathz returns

func (*Healthz) Unregister

func (h *Healthz) Unregister(name string)

Unregister a check handler

type ImagePullAccountManager

type ImagePullAccountManager interface {
	GetAccountInfo(repo string) (*AuthInfo, error)
}

func NewImagePullAccountManager

func NewImagePullAccountManager(kubeClient clientset.Interface) ImagePullAccountManager

NewImagePullAccountManager returns an ImagePullAccountManager, defaults to be nil

type SecretManager

type SecretManager interface {
	GetSecrets(secret []appsv1alpha1.ReferenceObject) ([]v1.Secret, error)
}

SecretManager is the interface to get secrets from API Server.

func NewCacheBasedSecretManager

func NewCacheBasedSecretManager(client clientset.Interface) SecretManager

NewCacheBasedSecretManager create a cache based SecretManager

Jump to

Keyboard shortcuts

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