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 HTTPSAccess(spec operatorv1alpha1.HTTPSSourceSpec, ...) *operatorv1alpha1.HTTPSSourceBinding
- func HTTPSPlanSource(download, path, contentDigest string) *operatorv1alpha1.PlanSourceBinding
- func HTTPSResolved(spec *operatorv1alpha1.HTTPSSourceSpec, ...) bool
- func HTTPSRevision(download, 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 ValidateHTTPS(binding operatorv1alpha1.HTTPSSourceBinding) 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 HTTPSAccess ¶ added in v0.2.12
func HTTPSAccess(spec operatorv1alpha1.HTTPSSourceSpec, revision operatorv1alpha1.HTTPSSourceRevision) *operatorv1alpha1.HTTPSSourceBinding
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
func HTTPSResolved(spec *operatorv1alpha1.HTTPSSourceSpec, revision *operatorv1alpha1.HTTPSSourceRevision) bool
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
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 ¶
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, 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 ¶
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 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 ¶
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, 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.