Skip to content

Commit cd4bc48

Browse files
committed
review mods
Signed-off-by: grokspawn <[email protected]>
1 parent 11883a1 commit cd4bc48

File tree

4 files changed

+485
-4
lines changed

4 files changed

+485
-4
lines changed

alpha/template/semver/semver_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,9 @@ func TestGenerateChannels(t *testing.T) {
529529
t.Run(tt.name, func(t *testing.T) {
530530
sv := &SemverTemplateData{GenerateMajorChannels: tt.generateMajorChannels, GenerateMinorChannels: tt.generateMinorChannels, pkg: "a", DefaultChannelTypePreference: tt.channelTypePreference}
531531
out := sv.generateChannels(&channelOperatorVersions)
532-
require.ElementsMatch(t, tt.out, out)
532+
if diff := gocmp.Diff(tt.out, out); diff != "" {
533+
t.Errorf("unexpected generated channels (-expected +received):\n%s", diff)
534+
}
533535
require.Equal(t, tt.defaultChannel, sv.defaultChannel)
534536
})
535537
}

alpha/template/template.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ func (r *TemplateRegistry) HasSchema(schema string) bool {
100100
return exists
101101
}
102102

103+
func (r *TemplateRegistry) HasType(templateType string) bool {
104+
types := r.GetSupportedTypes()
105+
return slices.Contains(types, templateType)
106+
}
107+
103108
// UnknownSchemaError is returned when a schema is not recognized
104109
type UnknownSchemaError struct {
105110
Schema string

0 commit comments

Comments
 (0)