@@ -16,29 +16,43 @@ import (
16
16
17
17
const (
18
18
SchemaPackage = "olm.package"
19
+ SchemaIcon = "olm.icon"
19
20
SchemaChannel = "olm.channel"
20
21
SchemaBundle = "olm.bundle"
21
22
SchemaDeprecation = "olm.deprecations"
22
23
)
23
24
24
25
type DeclarativeConfig struct {
25
26
Packages []Package
27
+ Icons []Icon
26
28
Channels []Channel
27
29
Bundles []Bundle
28
30
Deprecations []Deprecation
29
31
Others []Meta
30
32
}
31
33
32
34
type Package struct {
33
- Schema string `json:"schema"`
34
- Name string `json:"name"`
35
- DefaultChannel string `json:"defaultChannel"`
36
- Icon * Icon `json:"icon,omitempty"`
37
- Description string `json:"description,omitempty"`
38
- Properties []property.Property `json:"properties,omitempty" hash:"set"`
35
+ Schema string `json:"schema"`
36
+ Name string `json:"name"`
37
+ DefaultChannel string `json:"defaultChannel"`
38
+
39
+ // Deprecated: It is no longer recommended to embed an icon in the package.
40
+ // Instead, use separate a Icon item alongside the Package.
41
+ Icon * PackageIcon `json:"icon,omitempty"`
42
+
43
+ Description string `json:"description,omitempty"`
44
+ Properties []property.Property `json:"properties,omitempty" hash:"set"`
39
45
}
40
46
41
47
type Icon struct {
48
+ Schema string `json:"schema"`
49
+ Package string `json:"package"`
50
+
51
+ MediaType string `json:"mediaType"`
52
+ Data []byte `json:"data"`
53
+ }
54
+
55
+ type PackageIcon struct {
42
56
Data []byte `json:"base64data"`
43
57
MediaType string `json:"mediatype"`
44
58
}
@@ -201,6 +215,7 @@ func extractUniqueMetaKeys(blobMap map[string]any, m *Meta) error {
201
215
202
216
func (destination * DeclarativeConfig ) Merge (src * DeclarativeConfig ) {
203
217
destination .Packages = append (destination .Packages , src .Packages ... )
218
+ destination .Icons = append (destination .Icons , src .Icons ... )
204
219
destination .Channels = append (destination .Channels , src .Channels ... )
205
220
destination .Bundles = append (destination .Bundles , src .Bundles ... )
206
221
destination .Others = append (destination .Others , src .Others ... )
0 commit comments