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 ¶
- func AccessGives(binding operatorv1alpha1.SourceAccessBinding, artifactDigest string, ...) bool
- func ConfigMapPlanSource(revision operatorv1alpha1.ConfigMapSourceRevision, ...) *operatorv1alpha1.PlanSourceBinding
- func ContractVersion(source *operatorv1alpha1.PlanSourceBinding) int32
- func Equal(a, b *operatorv1alpha1.PlanSourceBinding) bool
- func Fingerprint(source *operatorv1alpha1.PlanSourceBinding) *fingerprint.PlanSource
- func GitAccess(spec operatorv1alpha1.GitSourceSpec, ...) *operatorv1alpha1.GitSourceBinding
- func GitPlanSource(repository, path, contentDigest string) *operatorv1alpha1.PlanSourceBinding
- func GitResolved(spec *operatorv1alpha1.GitSourceSpec, ...) bool
- func GitRevision(repository, path string) string
- func MigrationPlanSource(artifact *operatorv1alpha1.SourceAccessBinding, ...) (string, *operatorv1alpha1.PlanSourceBinding)
- func SamePlanSource(artifactA string, sourceA *operatorv1alpha1.PlanSourceBinding, ...) bool
- func SamePolicy(a, b *operatorv1alpha1.SourcePolicyBinding) bool
- func SchemaAccess(spec operatorv1alpha1.SourceSpec, status operatorv1alpha1.SchemaSourceStatus) *operatorv1alpha1.SourceAccessBinding
- func SchemaPlanSource(status operatorv1alpha1.SchemaSourceStatus) (string, *operatorv1alpha1.PlanSourceBinding)
- func SchemaSourceReady(spec operatorv1alpha1.SourceSpec, status operatorv1alpha1.SchemaSourceStatus) bool
- func ValidateAccess(binding operatorv1alpha1.SourceAccessBinding) error
- func ValidateGit(git operatorv1alpha1.GitSourceBinding) error
- func WrittenContract(version int32, source *operatorv1alpha1.PlanSourceBinding) bool
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 ¶
func ConfigMapPlanSource(revision operatorv1alpha1.ConfigMapSourceRevision, snapshot operatorv1alpha1.SourceSnapshotBinding) *operatorv1alpha1.PlanSourceBinding
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 ¶
func Equal(a, b *operatorv1alpha1.PlanSourceBinding) bool
Equal reports whether two plan source bindings name the same source, and the same source policy.
func Fingerprint ¶
func Fingerprint(source *operatorv1alpha1.PlanSourceBinding) *fingerprint.PlanSource
Fingerprint converts a plan's source binding to the form the fingerprint binds.
func GitAccess ¶
func GitAccess(spec operatorv1alpha1.GitSourceSpec, revision operatorv1alpha1.GitSourceRevision) *operatorv1alpha1.GitSourceBinding
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 ¶
func GitResolved(spec *operatorv1alpha1.GitSourceSpec, revision *operatorv1alpha1.GitSourceRevision) bool
GitResolved reports whether a resolution answered the Git source the spec names now: the same repository, ref and path.
func GitRevision ¶
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 ¶
func MigrationPlanSource( artifact *operatorv1alpha1.SourceAccessBinding, revision *operatorv1alpha1.ConfigMapSourceRevision, policy *operatorv1alpha1.SourcePolicyBinding, ) (string, *operatorv1alpha1.PlanSourceBinding)
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 ¶
func SchemaAccess(spec operatorv1alpha1.SourceSpec, status operatorv1alpha1.SchemaSourceStatus) *operatorv1alpha1.SourceAccessBinding
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 ¶
func SchemaPlanSource(status operatorv1alpha1.SchemaSourceStatus) (string, *operatorv1alpha1.PlanSourceBinding)
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.