Skip to content

Commit 80494ce

Browse files
chengfangSailReal
andauthored
chore(build): increase resource request and limit to be consistent with master; Fix GitHub Webhook response parsing (#1280)(#1281)
Signed-off-by: Julian Raufelder <[email protected]> Co-authored-by: Julian Raufelder <[email protected]>
1 parent 83c3871 commit 80494ce

File tree

4 files changed

+56
-8
lines changed

4 files changed

+56
-8
lines changed

config/install.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -891,10 +891,10 @@ spec:
891891
resources:
892892
limits:
893893
cpu: 500m
894-
memory: 128Mi
894+
memory: 1024Mi
895895
requests:
896-
cpu: 10m
897-
memory: 64Mi
896+
cpu: 250m
897+
memory: 512Mi
898898
securityContext:
899899
allowPrivilegeEscalation: false
900900
capabilities:

config/manager/manager.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,10 @@ spec:
200200
resources:
201201
limits:
202202
cpu: 500m
203-
memory: 128Mi
203+
memory: 1024Mi
204204
requests:
205-
cpu: 10m
206-
memory: 64Mi
205+
cpu: 250m
206+
memory: 512Mi
207207
volumeMounts:
208208
- mountPath: /app/config
209209
name: image-updater-conf

pkg/webhook/ghcr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func (g *GHCRWebhook) Parse(r *http.Request) (*argocd.WebhookEvent, error) {
110110
}
111111

112112
// Only process container packages
113-
if payload.Package.PackageType != "container" {
113+
if strings.ToLower(payload.Package.PackageType) != "container" {
114114
return nil, fmt.Errorf("unsupported package type: %s", payload.Package.PackageType)
115115
}
116116

pkg/webhook/ghcr_test.go

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func TestGHCRWebhook_Parse(t *testing.T) {
146146
expectError bool
147147
}{
148148
{
149-
name: "valid registry package published event",
149+
name: "valid registry package published event with lower case package_type",
150150
payload: `{
151151
"action": "published",
152152
"package": {
@@ -169,6 +169,54 @@ func TestGHCRWebhook_Parse(t *testing.T) {
169169
expectedTag: "v1.0.0",
170170
expectError: false,
171171
},
172+
{
173+
name: "another valid registry package published event with upper case package_type",
174+
payload: `{
175+
"action": "published",
176+
"package": {
177+
"name": "myapp",
178+
"package_type": "CONTAINER",
179+
"owner": {
180+
"login": "myuser"
181+
},
182+
"package_version": {
183+
"name": "v1.0.0",
184+
"container_metadata": {
185+
"tag": {
186+
"name": "v1.0.0"
187+
}
188+
}
189+
}
190+
}
191+
}`,
192+
expectedRepo: "myuser/myapp",
193+
expectedTag: "v1.0.0",
194+
expectError: false,
195+
},
196+
{
197+
name: "another valid registry package published event with camel case package_type",
198+
payload: `{
199+
"action": "published",
200+
"package": {
201+
"name": "myapp",
202+
"package_type": "Container",
203+
"owner": {
204+
"login": "myuser"
205+
},
206+
"package_version": {
207+
"name": "v1.0.0",
208+
"container_metadata": {
209+
"tag": {
210+
"name": "v1.0.0"
211+
}
212+
}
213+
}
214+
}
215+
}`,
216+
expectedRepo: "myuser/myapp",
217+
expectedTag: "v1.0.0",
218+
expectError: false,
219+
},
172220
{
173221
name: "valid registry package published event with latest tag",
174222
payload: `{

0 commit comments

Comments
 (0)