Documentation
¶
Index ¶
- Constants
- func BundleBOMWriter(builder artifact.Artifact, digests DigestLookup) artifact.BOMWriter
- func CycloneDX(tree SourceTree, name, version string) ([]byte, error)
- func ListLines(inv Inventory) string
- type BaseLister
- type DigestLookup
- type Entry
- type FacetTrace
- type FluxMirrorArtifact
- type FluxMirrorChart
- type FluxMirrorConfig
- type FluxMirrorSelector
- type Inventory
- type Kind
- type Lister
- type Options
- type RegistryDigests
- type Result
- type Source
- type SourceTree
- type Transport
Constants ¶
const FluxMirrorAPIVersion = "mirror.plugin.fluxcd.io/v1beta2"
FluxMirrorAPIVersion is the apiVersion of the Flux Mirror config that FluxMirror writes.
const InventoryVersion = "v1alpha1"
InventoryVersion is the schema version of an Inventory document.
Variables ¶
This section is empty.
Functions ¶
func BundleBOMWriter ¶
func BundleBOMWriter(builder artifact.Artifact, digests DigestLookup) artifact.BOMWriter
BundleBOMWriter returns the BOM writer of windsor bundle. The writer lists the artifact tags of the bundle, each oci:// source of the bundled blueprint, and the components of each source. It pulls each source that is not in the cache through builder, once for all calls, and fails when a pull fails. Each tag with an exact version and no digest gets its digest from digests, and a failed lookup fails the writer. A nil digests reads no digest.
func CycloneDX ¶
func CycloneDX(tree SourceTree, name, version string) ([]byte, error)
CycloneDX returns tree as a CycloneDX 1.6 BOM in JSON. An image is a container component, a chart is an application component, and a source is a data component. The BOM has one component for each package URL, and its dependencies graph names the components that each source pulls. When name is not empty, the metadata names the blueprint, with name as its bom-ref, and the blueprint depends on its own artifacts and sources.
Types ¶
type BaseLister ¶
type BaseLister struct {
// contains filtered or unexported fields
}
BaseLister is the default Lister.
func NewLister ¶
func NewLister(rt *runtime.Runtime, artifactBuilder artifact.Artifact) *BaseLister
NewLister creates a BaseLister. It panics if rt or artifactBuilder is nil.
func (*BaseLister) List ¶
func (l *BaseLister) List(blueprint *blueprintv1alpha1.Blueprint, opts Options) (*Result, error)
List returns the artifacts of blueprint: each oci:// blueprint source, and each chart and image that an artifact tag names in the files that blueprint uses, in the project and in the cache of each oci:// source. With opts.All, it reads whole sources. Each entry gets a destination, and the entries are unique and sorted. The tree of the result groups the tags of each source under that source.
type DigestLookup ¶
DigestLookup returns the digest that the tag of an artifact names in its registry now.
type Entry ¶
type Entry struct {
Kind Kind `yaml:"kind"`
Transport Transport `yaml:"transport"`
Reference string `yaml:"reference"`
Name string `yaml:"name,omitempty"`
Version string `yaml:"version,omitempty"`
Digest string `yaml:"digest,omitempty"`
Destination string `yaml:"destination,omitempty"`
NoReferrers bool `yaml:"noReferrers,omitempty"`
Source Source `yaml:"source"`
}
Entry is one external artifact. Reference is the repository without a scheme or tag for OCI, and the repository URL for HTTP and Git. NoReferrers is true when an artifact tag has referrers=false.
type FacetTrace ¶
FacetTrace tells which values of a facet the composed blueprint uses. UnusedFacetValue returns true only when the trace proves that the blueprint does not use the value on the line. It returns a note when the trace cannot resolve the value.
type FluxMirrorArtifact ¶
type FluxMirrorArtifact struct {
Source string `yaml:"source"`
Destination string `yaml:"destination"`
Selector FluxMirrorSelector `yaml:"selector"`
IncludeReferrers bool `yaml:"includeReferrers"`
}
FluxMirrorArtifact copies the tags that its selector names from one OCI repository to another.
type FluxMirrorChart ¶
type FluxMirrorChart struct {
Name string `yaml:"name"`
Source string `yaml:"source"`
Destination string `yaml:"destination"`
Version string `yaml:"version"`
}
FluxMirrorChart copies one chart version from an HTTP Helm repository to an OCI registry.
type FluxMirrorConfig ¶
type FluxMirrorConfig struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Charts []FluxMirrorChart `yaml:"charts,omitempty"`
Artifacts []FluxMirrorArtifact `yaml:"artifacts,omitempty"`
}
FluxMirrorConfig is a Flux Mirror config.
func FluxMirror ¶
func FluxMirror(inv Inventory, chartsTo string) (FluxMirrorConfig, []string, error)
FluxMirror returns the Flux Mirror config of inv and a note for each artifact it leaves out. It writes an HTTP chart as a charts entry with an exact version, and an OCI chart, an image, or a blueprint as an artifacts entry whose selector.tags holds its one tag. The entry includes referrers unless the artifact has NoReferrers. It leaves out an artifact with no destination or no tag, and a chart whose upstream is already in chartsTo. It needs chartsTo when inv has a chart.
type FluxMirrorSelector ¶
type FluxMirrorSelector struct {
Tags []string `yaml:"tags"`
}
FluxMirrorSelector selects an exact list of tags.
type Inventory ¶
type Inventory struct {
Version string `yaml:"version"`
Context string `yaml:"context,omitempty"`
Artifacts []Entry `yaml:"artifacts"`
}
Inventory is the document that windsor show artifacts prints with -o yaml.
type Lister ¶
type Lister interface {
List(blueprint *blueprintv1alpha1.Blueprint, opts Options) (*Result, error)
}
Lister lists the external artifacts of a composed blueprint.
type Options ¶
type Options struct {
ChartsTo string
All bool
Trace FacetTrace
}
Options holds the settings of one List call. All selects the artifact tags of whole sources, also of the files that the blueprint does not use. Trace removes the artifact tags of facet values that the blueprint does not use. It is optional.
type RegistryDigests ¶
type RegistryDigests struct {
// contains filtered or unexported fields
}
RegistryDigests is the default DigestLookup.
func NewRegistryDigests ¶
func NewRegistryDigests() *RegistryDigests
NewRegistryDigests creates a RegistryDigests.
func (*RegistryDigests) Digest ¶
func (d *RegistryDigests) Digest(e Entry) (string, error)
Digest returns the sha256 digest of e. An OCI image or chart gets the digest of its manifest or index. An HTTP chart gets the digest of its archive from the repository index, or the sha256 of the archive when the index gives none. It returns an error for an artifact that it cannot read, and for a Git chart.
type Result ¶
type Result struct {
Inventory Inventory
Tree SourceTree
Notes []string
}
Result is the inventory, its source tree, and the notes that List writes for the operator.
type Source ¶
type Source struct {
Kustomization string `yaml:"kustomization,omitempty"`
Object string `yaml:"object,omitempty"`
File string `yaml:"file,omitempty"`
}
Source records where the context declares an artifact.
type SourceTree ¶
type SourceTree struct {
Name string
Entry Entry
Artifacts []Entry
Sources []SourceTree
// contains filtered or unexported fields
}
SourceTree is the artifacts of one blueprint source and the trees of the oci:// sources that it names. The root of a tree is the blueprint itself, with no name and no entry.