Documentation
¶
Index ¶
- Constants
- Variables
- func NormalizeRegistryHost(ref string) (string, error)
- func NormalizeRegistryHostInput(host string) (string, error)
- type KubernetesClient
- type KubernetesClientSpec
- type LogStreamObject
- type MetricsStreamObject
- type MetricsStreamOptions
- type PodLogStreamOptions
- type RegistryClient
Constants ¶
const ClusterLocalRegistrySuffix = ".svc.cluster.local"
ClusterLocalRegistrySuffix marks in-cluster registries; those are not reachable from the hub, so existence/push probes are skipped for them.
Variables ¶
var ErrAuthFailed = errors.New("registry authentication failed")
ErrAuthFailed indicates the registry rejected the request for auth reasons (401/403). Callers can use errors.Is to distinguish missing/invalid credentials from other failures.
var ErrRateLimited = errors.New("registry rate limited")
ErrRateLimited indicates the registry responded with a rate-limit signal (HTTP 429 / toomanyrequests) rather than a definitive answer. Callers can use errors.Is(err, ErrRateLimited) to soft-pass instead of treating it as a hard failure.
Functions ¶
func NormalizeRegistryHost ¶
This is used by a user input as an image reference. NormalizeRegistryHost parses an image ref, repository ref, or bare registry host and returns the canonical registry host. Docker Hub aliases (docker.io, registry-1.docker.io) all normalize to name.DefaultRegistry.
func NormalizeRegistryHostInput ¶
This used when users want to register a registry credential for a registry host. NormalizeRegistryHostInput normalizes a user-supplied registry host — as opposed to an image/repository reference — to its canonical form. Unlike NormalizeRegistryHost, a bare single-label string like "harbor" is treated as a host, never as a Docker Hub repository name.
Types ¶
type KubernetesClient ¶
type KubernetesClient interface {
AttachablePodFromService(ctx context.Context, svcKey types.NamespacedName) (*corev1.Pod, error)
StreamPodLogs(ctx context.Context, pod *corev1.Pod, logOpts PodLogStreamOptions) (<-chan *LogStreamObject, error)
BuildPodForJob(ctx context.Context, namespace string, jobName string) (*corev1.Pod, error)
GetNamespaceMetrics(ctx context.Context, namespace string) (*MetricsStreamObject, error)
StreamNamespaceMetrics(ctx context.Context, namespace string, metricsStreamOpts MetricsStreamOptions) (<-chan *MetricsStreamObject, error)
}
func NewKubernetesClient ¶
func NewKubernetesClient(spec KubernetesClientSpec) (KubernetesClient, error)
type KubernetesClientSpec ¶
type LogStreamObject ¶
type MetricsStreamObject ¶
type MetricsStreamObject struct {
NamespaceMetrics []metricsv1beta1.PodMetrics
NodeCapacityMap map[string]corev1.ResourceList
Error error
}
type MetricsStreamOptions ¶
type PodLogStreamOptions ¶
type PodLogStreamOptions interface {
Follow() bool
TailLines() int
Since() string
// Previous asks for the logs of the previously terminated container, which
// is where a crash-looping workload's real error lives.
Previous() bool
// MaxErrors returns the maximum number of errors to log before stopping the stream.
MaxErrors() int
}
type RegistryClient ¶
type RegistryClient interface {
CheckImage(ctx context.Context, imageRef string) (bool, error)
// CheckPushAccess verifies that the client's credentials can authorize a
// push to repoRef. It requests a push-scoped token and opens (then
// cancels) a blob upload; it never pushes any content.
CheckPushAccess(ctx context.Context, repoRef string) error
}
func NewRegistryClientAnonymous ¶
func NewRegistryClientAnonymous() (RegistryClient, error)
func NewRegistryClientWithAuth ¶
func NewRegistryClientWithAuth(username, password string) (RegistryClient, error)
Directories
¶
| Path | Synopsis |
|---|---|
|
Package githubapp is a thin GitHub App API client covering the manifest conversion, installation, and repository discovery flows.
|
Package githubapp is a thin GitHub App API client covering the manifest conversion, installation, and repository discovery flows. |
|
Package turnstile verifies Cloudflare Turnstile challenge tokens.
|
Package turnstile verifies Cloudflare Turnstile challenge tokens. |