sourcebinding

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 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 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 or Git 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 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 or Git 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, or the snapshot of the ConfigMap the spec names.

func ValidateAccess

func ValidateAccess(binding operatorv1alpha1.SourceAccessBinding) error

ValidateAccess holds an access binding to one of its three shapes: an OCI reference pinned to a matching digest, a well-formed snapshot, or a Git commit, the last two 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 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