forked from openshift/oc-mirror
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: changes catalog and OCP release heads only workflows to use imp…
…licit ranges When merging the catalog, unintentional changes to the upgrade and pruned bundles can be created in the target FBC generated by oc-mirror. To remove the requirement to merge FBCs, package ranges are being used in metadata for heads-only workflows to generate FBCs that are scoped per the configuration instead of generating differential FBCs and merging with previous FBCs. The OCP releases heads only workflow has been updated work in the same way. To achieve the same optimization in regards to download images, all images in the image mapping during each run are validated against the metadata to make sure they do not exist in PastAssociations. Closes openshift#377 BREAKING CHANGE: This change adds OCPMetadata and modifies OperatorMetadata on the Metadata Spec. It also removes the catalog merging workflow. Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
- Loading branch information
Showing
20 changed files
with
1,229 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
package v1alpha2 | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/blang/semver/v4" | ||
"github.com/operator-framework/operator-registry/alpha/action" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestConvertToDiffIncludeConfig(t *testing.T) { | ||
type spec struct { | ||
name string | ||
cfg IncludeConfig | ||
exp action.DiffIncludeConfig | ||
} | ||
|
||
specs := []spec{ | ||
{ | ||
name: "Valid/WithChannels", | ||
cfg: IncludeConfig{ | ||
Packages: []IncludePackage{ | ||
{ | ||
Name: "bar", | ||
Channels: []IncludeChannel{ | ||
{ | ||
Name: "stable", | ||
IncludeBundle: IncludeBundle{ | ||
StartingVersion: semver.MustParse("0.1.0"), | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
Name: "foo", | ||
Channels: []IncludeChannel{ | ||
{ | ||
Name: "stable", | ||
IncludeBundle: IncludeBundle{ | ||
StartingVersion: semver.MustParse("0.1.0"), | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
exp: action.DiffIncludeConfig{ | ||
Packages: []action.DiffIncludePackage{ | ||
{ | ||
Name: "bar", | ||
Channels: []action.DiffIncludeChannel{ | ||
{ | ||
Name: "stable", | ||
Versions: []semver.Version{ | ||
semver.MustParse("0.1.0"), | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
Name: "foo", | ||
Channels: []action.DiffIncludeChannel{ | ||
{ | ||
Name: "stable", | ||
Versions: []semver.Version{ | ||
semver.MustParse("0.1.0"), | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: "Valid/NoChannels", | ||
cfg: IncludeConfig{ | ||
Packages: []IncludePackage{ | ||
{ | ||
Name: "bar", | ||
IncludeBundle: IncludeBundle{ | ||
StartingVersion: semver.MustParse("0.1.0"), | ||
}, | ||
}, | ||
{ | ||
Name: "foo", | ||
IncludeBundle: IncludeBundle{ | ||
StartingVersion: semver.MustParse("0.1.0"), | ||
}, | ||
}, | ||
}, | ||
}, | ||
exp: action.DiffIncludeConfig{ | ||
Packages: []action.DiffIncludePackage{ | ||
{ | ||
Name: "bar", | ||
Versions: []semver.Version{ | ||
semver.MustParse("0.1.0"), | ||
}, | ||
}, | ||
{ | ||
Name: "foo", | ||
Versions: []semver.Version{ | ||
semver.MustParse("0.1.0"), | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
for _, s := range specs { | ||
t.Run(s.name, func(t *testing.T) { | ||
dic, err := s.cfg.ConvertToDiffIncludeConfig() | ||
require.NoError(t, err) | ||
require.Equal(t, s.exp, dic) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.