Skip to content

Commit 227f9dc

Browse files
Merge pull request #1520 from awgreene/packagemanifests-keywords
Bug 1812019: PackageManifests should include Keywords
2 parents 06e192f + c81f025 commit 227f9dc

File tree

9 files changed

+264
-1
lines changed

9 files changed

+264
-1
lines changed

pkg/package-server/apis/operators/packagemanifest.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ func CreateCSVDescription(csv *operatorsv1alpha1.ClusterServiceVersion, csvJSON
3535
NativeAPIs: csv.Spec.NativeAPIs,
3636
MinKubeVersion: csv.Spec.MinKubeVersion,
3737
RelatedImages: GetImages(csvJSON),
38+
Keywords: csv.Spec.Keywords,
39+
Maturity: csv.Spec.Maturity,
3840
}
3941

4042
icons := make([]Icon, len(csv.Spec.Icon))
@@ -49,6 +51,22 @@ func CreateCSVDescription(csv *operatorsv1alpha1.ClusterServiceVersion, csvJSON
4951
desc.Icon = icons
5052
}
5153

54+
desc.Links = make([]AppLink, len(csv.Spec.Links))
55+
for i, link := range csv.Spec.Links {
56+
desc.Links[i] = AppLink{
57+
Name: link.Name,
58+
URL: link.URL,
59+
}
60+
}
61+
62+
desc.Maintainers = make([]Maintainer, len(csv.Spec.Maintainers))
63+
for i, maintainer := range csv.Spec.Maintainers {
64+
desc.Maintainers[i] = Maintainer{
65+
Name: maintainer.Name,
66+
Email: maintainer.Email,
67+
}
68+
}
69+
5270
return desc
5371
}
5472

pkg/package-server/apis/operators/packagemanifest_types.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ type CSVDescription struct {
9898
// Provider is the CSV's provider
9999
Provider AppLink
100100
Annotations map[string]string
101+
Keywords []string
102+
Links []AppLink
103+
Maintainers []Maintainer
104+
Maturity string
101105

102106
// LongDescription is the CSV's description
103107
LongDescription string
@@ -122,6 +126,12 @@ type AppLink struct {
122126
URL string
123127
}
124128

129+
// Maintainer defines a project maintainer
130+
type Maintainer struct {
131+
Name string `json:"name,omitempty"`
132+
Email string `json:"email,omitempty"`
133+
}
134+
125135
// Icon defines a base64 encoded icon and media type
126136
type Icon struct {
127137
Base64Data string

pkg/package-server/apis/operators/v1/packagemanifest.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ func CreateCSVDescription(csv *operatorsv1alpha1.ClusterServiceVersion, csvJSON
2929
NativeAPIs: csv.Spec.NativeAPIs,
3030
MinKubeVersion: csv.Spec.MinKubeVersion,
3131
RelatedImages: GetImages(csvJSON),
32+
Keywords: csv.Spec.Keywords,
33+
Maturity: csv.Spec.Maturity,
3234
}
3335

3436
icons := make([]Icon, len(csv.Spec.Icon))
@@ -43,6 +45,22 @@ func CreateCSVDescription(csv *operatorsv1alpha1.ClusterServiceVersion, csvJSON
4345
desc.Icon = icons
4446
}
4547

48+
desc.Links = make([]AppLink, len(csv.Spec.Links))
49+
for i, link := range csv.Spec.Links {
50+
desc.Links[i] = AppLink{
51+
Name: link.Name,
52+
URL: link.URL,
53+
}
54+
}
55+
56+
desc.Maintainers = make([]Maintainer, len(csv.Spec.Maintainers))
57+
for i, maintainer := range csv.Spec.Maintainers {
58+
desc.Maintainers[i] = Maintainer{
59+
Name: maintainer.Name,
60+
Email: maintainer.Email,
61+
}
62+
}
63+
4664
return desc
4765
}
4866

pkg/package-server/apis/operators/v1/packagemanifest_types.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ type CSVDescription struct {
9999
Provider AppLink `json:"provider,omitempty"`
100100
// +listType=map
101101
Annotations map[string]string `json:"annotations,omitempty"`
102+
// +listType=set
103+
Keywords []string `json:"keywords,omitempty"`
104+
// +listType=set
105+
Links []AppLink `json:"links,omitempty"`
106+
// +listType=set
107+
Maintainers []Maintainer `json:"maintainers,omitempty"`
108+
Maturity string `json:"maturity,omitempty"`
102109

103110
// LongDescription is the CSV's description
104111
LongDescription string `json:"description,omitempty"`
@@ -124,6 +131,12 @@ type AppLink struct {
124131
URL string `json:"url,omitempty"`
125132
}
126133

134+
// Maintainer defines a project maintainer
135+
type Maintainer struct {
136+
Name string `json:"name,omitempty"`
137+
Email string `json:"email,omitempty"`
138+
}
139+
127140
// Icon defines a base64 encoded icon and media type
128141
type Icon struct {
129142
Base64Data string `json:"base64data,omitempty"`

pkg/package-server/apis/operators/v1/zz_generated.conversion.go

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/package-server/apis/operators/v1/zz_generated.deepcopy.go

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/package-server/apis/operators/zz_generated.deepcopy.go

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/package-server/client/openapi/zz_generated.openapi.go

Lines changed: 85 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)