Documentation
¶
Index ¶
- Constants
- func ConvertToModel(cfg DeclarativeConfig) (model.Model, error)
- func WalkFS(root fs.FS, walkFn WalkFunc) error
- func WriteJSON(cfg DeclarativeConfig, w io.Writer) error
- func WriteMermaidChannels(cfg DeclarativeConfig, out io.Writer, minEdgeName string) error
- func WriteYAML(cfg DeclarativeConfig, w io.Writer) error
- type Bundle
- type Channel
- type ChannelEntry
- type DeclarativeConfig
- type Icon
- type Meta
- type Package
- type RelatedImage
- type WalkFunc
Constants ¶
const ( SchemaPackage = "olm.package" SchemaChannel = "olm.channel" SchemaBundle = "olm.bundle" )
Variables ¶
This section is empty.
Functions ¶
func ConvertToModel ¶
func ConvertToModel(cfg DeclarativeConfig) (model.Model, error)
func WalkFS ¶
WalkFS walks root using a gitignore-style filename matcher to skip files that match patterns found in .indexignore files found throughout the filesystem. It calls walkFn for each declarative config file it finds. If WalkFS encounters an error loading or parsing any file, the error will be immediately returned.
func WriteMermaidChannels ¶ added in v1.24.0
func WriteMermaidChannels(cfg DeclarativeConfig, out io.Writer, minEdgeName string) error
writes out the channel edges of the declarative config graph in a mermaid format capable of being pasted into mermaid renderers like github, mermaid.live, etc. output is sorted lexicographically by package name, and then by channel name if provided, minEdgeName will be used as the lower bound for edges in the output graph
NB: Output has wrapper comments stating the skipRange edge caveat in HTML comment format, which cannot be parsed by mermaid renderers.
This is deliberate, and intended as an explicit acknowledgement of the limitations, instead of requiring the user to notice the missing edges upon inspection.
Example output: <!-- PLEASE NOTE: skipRange edges are not currently displayed --> graph LR
%% package "neuvector-certified-operator-rhmp" subgraph "neuvector-certified-operator-rhmp" %% channel "beta" subgraph neuvector-certified-operator-rhmp-beta["beta"] neuvector-certified-operator-rhmp-beta-neuvector-operator.v1.2.8["neuvector-operator.v1.2.8"] neuvector-certified-operator-rhmp-beta-neuvector-operator.v1.2.9["neuvector-operator.v1.2.9"] neuvector-certified-operator-rhmp-beta-neuvector-operator.v1.3.0["neuvector-operator.v1.3.0"] neuvector-certified-operator-rhmp-beta-neuvector-operator.v1.3.0["neuvector-operator.v1.3.0"]-- replaces --> neuvector-certified-operator-rhmp-beta-neuvector-operator.v1.2.8["neuvector-operator.v1.2.8"] neuvector-certified-operator-rhmp-beta-neuvector-operator.v1.3.0["neuvector-operator.v1.3.0"]-- skips --> neuvector-certified-operator-rhmp-beta-neuvector-operator.v1.2.9["neuvector-operator.v1.2.9"] end end
end <!-- PLEASE NOTE: skipRange edges are not currently displayed -->
Types ¶
type Bundle ¶
type Bundle struct { Schema string `json:"schema"` Name string `json:"name"` Package string `json:"package"` Image string `json:"image"` Properties []property.Property `json:"properties,omitempty" hash:"set"` RelatedImages []RelatedImage `json:"relatedImages,omitempty" hash:"set"` // These fields are present so that we can continue serving // the GRPC API the way packageserver expects us to in a // backwards-compatible way. These are populated from // any `olm.bundle.object` properties. // // These fields will never be persisted in the bundle blob as // first class fields. CsvJSON string `json:"-"` Objects []string `json:"-"` }
Bundle specifies all metadata and data of a bundle object. Top-level fields are the source of truth, i.e. not CSV values.
Notes:
- Any field slice type field or type containing a slice somewhere where two types/fields are equal if their contents are equal regardless of order must have a `hash:"set"` field tag for bundle comparison.
- Any fields that have a `json:"-"` tag must be included in the equality evaluation in bundlesEqual().
type ChannelEntry ¶
type DeclarativeConfig ¶
type DeclarativeConfig struct { Packages []Package Channels []Channel Bundles []Bundle Others []Meta }
func ConvertFromModel ¶
func ConvertFromModel(mpkgs model.Model) DeclarativeConfig
func LoadFS ¶
func LoadFS(root fs.FS) (*DeclarativeConfig, error)
LoadFS loads a declarative config from the provided root FS. LoadFS walks the filesystem from root and uses a gitignore-style filename matcher to skip files that match patterns found in .indexignore files found throughout the filesystem. If LoadFS encounters an error loading or parsing any file, the error will be immediately returned.
type Meta ¶
type Meta struct { Schema string Package string Blob json.RawMessage }
func (Meta) MarshalJSON ¶
func (*Meta) UnmarshalJSON ¶
type RelatedImage ¶
func ModelRelatedImagesToRelatedImages ¶
func ModelRelatedImagesToRelatedImages(relatedImages []model.RelatedImage) []RelatedImage