sourcebinding

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package sourcebinding holds the comparisons every component makes about a resource's source: which plan contract a source gives, what a plan binds in place of an artifact digest, and whether an operation's access binding reads the content a plan names. The controllers, the Job builder and both admission webhooks ask these questions; answering them in one place keeps the answers from drifting apart.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessGives

func AccessGives(binding operatorv1alpha1.SourceAccessBinding, artifactDigest string, source *operatorv1alpha1.PlanSourceBinding) bool

AccessGives reports whether an operation reading through binding reads the content a plan bound: the artifact digest of an OCI plan, or the content digest of a source plan.

func ConfigMapPlanSource

ConfigMapPlanSource is what a plan computed from a ConfigMap source binds: the ConfigMap's UID and the content digest of the selected files.

func ContractVersion

func ContractVersion(source *operatorv1alpha1.PlanSourceBinding) int32

ContractVersion is the plan contract a plan bound to source carries.

func Equal

Equal reports whether two plan source bindings name the same source, and the same source policy.

func Fingerprint

Fingerprint converts a plan's source binding to the form the fingerprint binds.

func GitAccess

GitAccess is what an operation fetches a resolved Git source by: the commit and content a resolution found, and the credential and trust selectors the spec names now.

func GitPlanSource

func GitPlanSource(repository, path, contentDigest string) *operatorv1alpha1.PlanSourceBinding

GitPlanSource is what a plan computed from a Git source binds: the repository and path, as GitRevision, and the content digest of the selected files.

func GitResolved

GitResolved reports whether a resolution answered the Git source the spec names now: the same repository, ref and path.

func GitRevision

func GitRevision(repository, path string) string

GitRevision is what a plan computed from a Git source binds as its revision: "sha256:" and the SHA-256 of the repository URL and the selected path, joined by a newline. Another repository or path is another source; another commit that leaves the selected files as they were is not.

func HTTPSAccess added in v0.2.12

HTTPSAccess is what an operation fetches a resolved HTTPS source by: the download and the content a resolution found, and the credential and trust selectors the spec names now.

func HTTPSPlanSource added in v0.2.12

func HTTPSPlanSource(download, path, contentDigest string) *operatorv1alpha1.PlanSourceBinding

HTTPSPlanSource is what a plan computed from an HTTPS source binds: the URL and path, as HTTPSRevision, and the content digest of the selected files.

func HTTPSResolved added in v0.2.12

HTTPSResolved reports whether a resolution answered the HTTPS source the spec names now: the same URL, digest, format and path. The digest is part of the spec, so a new digest is a new source and is resolved again.

func HTTPSRevision added in v0.2.12

func HTTPSRevision(download, path string) string

HTTPSRevision is what a plan computed from an HTTPS source binds as its revision: "sha256:" and the SHA-256 of the URL and the selected path, joined by a newline. It never binds the download digest: an archive published again as other bytes that leaves the selected files as they were keeps the plan, once the spec names its digest.

func MigrationPlanSource

MigrationPlanSource is what a plan computed from a migration's resolved source binds: the artifact digest of an OCI source, or the source binding of a ConfigMap, Git or HTTPS one.

func SamePlanSource

func SamePlanSource(artifactA string, sourceA *operatorv1alpha1.PlanSourceBinding, artifactB string, sourceB *operatorv1alpha1.PlanSourceBinding) bool

SamePlanSource reports whether two plans, or a plan and a status, bind the same source: the same artifact digest and the same source binding.

func SamePolicy

func SamePolicy(a, b *operatorv1alpha1.SourcePolicyBinding) bool

SamePolicy reports whether two source policy bindings name the same policy, or are both absent.

func SchemaAccess

SchemaAccess is the access binding a schema's resolved source gives later operations: the snapshot of a ConfigMap source, the resolved commit of a Git source or the resolved download of an HTTPS one with the spec's credential and trust selectors, or nil for an OCI source, whose binding the caller builds from the registry selectors.

func SchemaPlanSource

SchemaPlanSource is what a plan computed from a schema's resolved source binds: the artifact digest of an OCI source, or the source binding of a ConfigMap, Git or HTTPS one. A source that has not been read yet binds nothing.

func SchemaSourceReady

func SchemaSourceReady(spec operatorv1alpha1.SourceSpec, status operatorv1alpha1.SchemaSourceStatus) bool

SchemaSourceReady reports whether later operations may read a schema's source: a verified OCI artifact, the snapshot of the ConfigMap the spec names, or the Git commit or HTTPS download resolved for the source the spec names.

func ValidateAccess

func ValidateAccess(binding operatorv1alpha1.SourceAccessBinding) error

ValidateAccess holds an access binding to one of its four shapes: an OCI reference pinned to a matching digest, a well-formed snapshot, a Git commit or an HTTPS download, the last three with nothing that belongs to a registry.

func ValidateGit

func ValidateGit(git operatorv1alpha1.GitSourceBinding) error

ValidateGit holds a Git access binding to what a fetch can act on: an https:// or ssh:// repository with no credential in it, one ref, a full commit id, a clean path, a content digest, and trust that fits the scheme.

func ValidateHTTPS added in v0.2.12

func ValidateHTTPS(binding operatorv1alpha1.HTTPSSourceBinding) error

ValidateHTTPS holds an HTTPS access binding to what a fetch can act on: an https:// URL with no credential, query or fragment, a download digest, a format, a clean path that fits it, a content digest, and selectors that name a Secret and a required ConfigMap key.

func WrittenContract

func WrittenContract(version int32, source *operatorv1alpha1.PlanSourceBinding) bool

WrittenContract reports whether a plan carries the contract version this manager writes for its source binding: version 1 with no source, version 2 with one.

Types

This section is empty.

Jump to

Keyboard shortcuts

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