diff --git a/alpha/declcfg/declcfg.go b/alpha/declcfg/declcfg.go index a4169c28c..d575987b1 100644 --- a/alpha/declcfg/declcfg.go +++ b/alpha/declcfg/declcfg.go @@ -52,11 +52,11 @@ type ChannelEntry struct { // 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(). +// - 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 Bundle struct { Schema string `json:"schema"` Name string `json:"name"` diff --git a/alpha/model/model.go b/alpha/model/model.go index a6ca06042..b18ba5118 100644 --- a/alpha/model/model.go +++ b/alpha/model/model.go @@ -141,8 +141,9 @@ type Channel struct { } // TODO(joelanford): This function determines the channel head by finding the bundle that has 0 -// incoming edges, based on replaces and skips. It also expects to find exactly one such bundle. -// Is this the correct algorithm? +// +// incoming edges, based on replaces and skips. It also expects to find exactly one such bundle. +// Is this the correct algorithm? func (c Channel) Head() (*Bundle, error) { incoming := map[string]int{} for _, b := range c.Bundles { @@ -210,11 +211,11 @@ func (c *Channel) Validate() error { // validateReplacesChain checks the replaces chain of a channel. // Specifically the following rules must be followed: -// 1. There must be exactly 1 channel head. -// 2. Beginning at the head, the replaces chain must reach all non-skipped entries. -// Non-skipped entries are defined as entries that are not skipped by any other entry in the channel. -// 3. There must be no cycles in the replaces chain. -// 4. The tail entry in the replaces chain is permitted to replace a non-existent entry. +// 1. There must be exactly 1 channel head. +// 2. Beginning at the head, the replaces chain must reach all non-skipped entries. +// Non-skipped entries are defined as entries that are not skipped by any other entry in the channel. +// 3. There must be no cycles in the replaces chain. +// 4. The tail entry in the replaces chain is permitted to replace a non-existent entry. func (c *Channel) validateReplacesChain() error { head, err := c.Head() if err != nil { diff --git a/alpha/property/property.go b/alpha/property/property.go index 695bfd6da..79dc33fae 100644 --- a/alpha/property/property.go +++ b/alpha/property/property.go @@ -40,8 +40,9 @@ type Package struct { } // NOTICE: The Channel properties are for internal use only. -// DO NOT use it for any public-facing functionalities. -// This API is in alpha stage and it is subject to change. +// +// DO NOT use it for any public-facing functionalities. +// This API is in alpha stage and it is subject to change. type Channel struct { ChannelName string `json:"channelName"` //Priority string `json:"priority"` @@ -287,8 +288,9 @@ func MustBuildBundleObjectData(data []byte) Property { } // NOTICE: The Channel properties are for internal use only. -// DO NOT use it for any public-facing functionalities. -// This API is in alpha stage and it is subject to change. +// +// DO NOT use it for any public-facing functionalities. +// This API is in alpha stage and it is subject to change. func MustBuildChannelPriority(name string, priority int) Property { return MustBuild(&Channel{ChannelName: name, Priority: priority}) } diff --git a/pkg/lib/indexer/interfaces.go b/pkg/lib/indexer/interfaces.go index df9e6e47a..5ebefdd1e 100644 --- a/pkg/lib/indexer/interfaces.go +++ b/pkg/lib/indexer/interfaces.go @@ -9,6 +9,7 @@ import ( // IndexAdder allows the creation of index container images from scratch or // based on previous index images +// //counterfeiter:generate . IndexAdder type IndexAdder interface { AddToIndex(AddToIndexRequest) error @@ -29,6 +30,7 @@ func NewIndexAdder(buildTool, pullTool containertools.ContainerTool, logger *log // IndexDeleter takes indexes and deletes all references to an operator // from them +// //counterfeiter:generate . IndexDeleter type IndexDeleter interface { DeleteFromIndex(DeleteFromIndexRequest) error diff --git a/pkg/registry/query.go b/pkg/registry/query.go index 4c4212217..7e7cf21fd 100644 --- a/pkg/registry/query.go +++ b/pkg/registry/query.go @@ -268,12 +268,13 @@ func (q Querier) GetChannelEntriesThatProvide(_ context.Context, group, version, } // TODO(joelanford): Need to review the expected functionality of this function. I ran -// some experiments with the sqlite version of this function and it seems to only return -// channel heads that provide the GVK (rather than searching down the graph if parent bundles -// don't provide the API). Based on that, this function currently looks at channel heads only. -// --- -// Separate, but possibly related, I noticed there are several channels in the channel entry -// table who's minimum depth is 1. What causes 1 to be minimum depth in some cases and 0 in others? +// +// some experiments with the sqlite version of this function and it seems to only return +// channel heads that provide the GVK (rather than searching down the graph if parent bundles +// don't provide the API). Based on that, this function currently looks at channel heads only. +// --- +// Separate, but possibly related, I noticed there are several channels in the channel entry +// table who's minimum depth is 1. What causes 1 to be minimum depth in some cases and 0 in others? func (q Querier) GetLatestChannelEntriesThatProvide(_ context.Context, group, version, kind string) ([]*ChannelEntry, error) { var entries []*ChannelEntry