Skip to content

Commit 9ec1509

Browse files
fix logs (#171)
* fix logs * regenerate files * regenerate files
1 parent 9265236 commit 9ec1509

File tree

11 files changed

+96
-33
lines changed

11 files changed

+96
-33
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.15-cap-CR-14605-fix-release-2
1+
2.4.15-cap-CR-14605-fix-logs

manifests/base/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ kind: Kustomization
44
images:
55
- name: quay.io/argoproj/argocd
66
newName: quay.io/codefresh/argocd
7-
newTag: v2.4.15-cap-CR-14605-fix-release-2
7+
newTag: v2.4.15-cap-CR-14605-fix-logs
88
resources:
99
- ./application-controller
1010
- ./dex

manifests/core-install.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9662,7 +9662,7 @@ spec:
96629662
valueFrom:
96639663
fieldRef:
96649664
fieldPath: metadata.namespace
9665-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
9665+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
96669666
imagePullPolicy: Always
96679667
name: argocd-applicationset-controller
96689668
ports:
@@ -9922,7 +9922,7 @@ spec:
99229922
value: /helm-working-dir
99239923
- name: HELM_DATA_HOME
99249924
value: /helm-working-dir
9925-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
9925+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
99269926
imagePullPolicy: Always
99279927
livenessProbe:
99289928
failureThreshold: 3
@@ -9974,7 +9974,7 @@ spec:
99749974
- -n
99759975
- /usr/local/bin/argocd
99769976
- /var/run/argocd/argocd-cmp-server
9977-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
9977+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
99789978
name: copyutil
99799979
securityContext:
99809980
allowPrivilegeEscalation: false
@@ -10163,7 +10163,7 @@ spec:
1016310163
key: otlp.address
1016410164
name: argocd-cmd-params-cm
1016510165
optional: true
10166-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
10166+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
1016710167
imagePullPolicy: Always
1016810168
livenessProbe:
1016910169
httpGet:

manifests/core-install/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ resources:
1212
images:
1313
- name: quay.io/argoproj/argocd
1414
newName: quay.io/codefresh/argocd
15-
newTag: v2.4.15-cap-CR-14605-fix-release-2
15+
newTag: v2.4.15-cap-CR-14605-fix-logs

manifests/ha/base/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ patchesStrategicMerge:
99
images:
1010
- name: quay.io/argoproj/argocd
1111
newName: quay.io/codefresh/argocd
12-
newTag: v2.4.15-cap-CR-14605-fix-release-2
12+
newTag: v2.4.15-cap-CR-14605-fix-logs
1313
resources:
1414
- ../../base/application-controller
1515
- ../../base/applicationset-controller

manifests/ha/install.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10513,7 +10513,7 @@ spec:
1051310513
valueFrom:
1051410514
fieldRef:
1051510515
fieldPath: metadata.namespace
10516-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
10516+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
1051710517
imagePullPolicy: Always
1051810518
name: argocd-applicationset-controller
1051910519
ports:
@@ -10610,7 +10610,7 @@ spec:
1061010610
- -n
1061110611
- /usr/local/bin/argocd
1061210612
- /shared/argocd-dex
10613-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
10613+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
1061410614
imagePullPolicy: Always
1061510615
name: copyutil
1061610616
securityContext:
@@ -10882,7 +10882,7 @@ spec:
1088210882
value: /helm-working-dir
1088310883
- name: HELM_DATA_HOME
1088410884
value: /helm-working-dir
10885-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
10885+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
1088610886
imagePullPolicy: Always
1088710887
livenessProbe:
1088810888
failureThreshold: 3
@@ -10934,7 +10934,7 @@ spec:
1093410934
- -n
1093510935
- /usr/local/bin/argocd
1093610936
- /var/run/argocd/argocd-cmp-server
10937-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
10937+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
1093810938
name: copyutil
1093910939
securityContext:
1094010940
allowPrivilegeEscalation: false
@@ -11183,7 +11183,7 @@ spec:
1118311183
key: otlp.address
1118411184
name: argocd-cmd-params-cm
1118511185
optional: true
11186-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
11186+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
1118711187
imagePullPolicy: Always
1118811188
livenessProbe:
1118911189
httpGet:
@@ -11391,7 +11391,7 @@ spec:
1139111391
key: otlp.address
1139211392
name: argocd-cmd-params-cm
1139311393
optional: true
11394-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
11394+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
1139511395
imagePullPolicy: Always
1139611396
livenessProbe:
1139711397
httpGet:

manifests/ha/namespace-install.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ spec:
11601160
valueFrom:
11611161
fieldRef:
11621162
fieldPath: metadata.namespace
1163-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
1163+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
11641164
imagePullPolicy: Always
11651165
name: argocd-applicationset-controller
11661166
ports:
@@ -1257,7 +1257,7 @@ spec:
12571257
- -n
12581258
- /usr/local/bin/argocd
12591259
- /shared/argocd-dex
1260-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
1260+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
12611261
imagePullPolicy: Always
12621262
name: copyutil
12631263
securityContext:
@@ -1529,7 +1529,7 @@ spec:
15291529
value: /helm-working-dir
15301530
- name: HELM_DATA_HOME
15311531
value: /helm-working-dir
1532-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
1532+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
15331533
imagePullPolicy: Always
15341534
livenessProbe:
15351535
failureThreshold: 3
@@ -1581,7 +1581,7 @@ spec:
15811581
- -n
15821582
- /usr/local/bin/argocd
15831583
- /var/run/argocd/argocd-cmp-server
1584-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
1584+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
15851585
name: copyutil
15861586
securityContext:
15871587
allowPrivilegeEscalation: false
@@ -1830,7 +1830,7 @@ spec:
18301830
key: otlp.address
18311831
name: argocd-cmd-params-cm
18321832
optional: true
1833-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
1833+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
18341834
imagePullPolicy: Always
18351835
livenessProbe:
18361836
httpGet:
@@ -2038,7 +2038,7 @@ spec:
20382038
key: otlp.address
20392039
name: argocd-cmd-params-cm
20402040
optional: true
2041-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
2041+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
20422042
imagePullPolicy: Always
20432043
livenessProbe:
20442044
httpGet:

manifests/install.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9885,7 +9885,7 @@ spec:
98859885
valueFrom:
98869886
fieldRef:
98879887
fieldPath: metadata.namespace
9888-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
9888+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
98899889
imagePullPolicy: Always
98909890
name: argocd-applicationset-controller
98919891
ports:
@@ -9982,7 +9982,7 @@ spec:
99829982
- -n
99839983
- /usr/local/bin/argocd
99849984
- /shared/argocd-dex
9985-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
9985+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
99869986
imagePullPolicy: Always
99879987
name: copyutil
99889988
securityContext:
@@ -10222,7 +10222,7 @@ spec:
1022210222
value: /helm-working-dir
1022310223
- name: HELM_DATA_HOME
1022410224
value: /helm-working-dir
10225-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
10225+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
1022610226
imagePullPolicy: Always
1022710227
livenessProbe:
1022810228
failureThreshold: 3
@@ -10274,7 +10274,7 @@ spec:
1027410274
- -n
1027510275
- /usr/local/bin/argocd
1027610276
- /var/run/argocd/argocd-cmp-server
10277-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
10277+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
1027810278
name: copyutil
1027910279
securityContext:
1028010280
allowPrivilegeEscalation: false
@@ -10519,7 +10519,7 @@ spec:
1051910519
key: otlp.address
1052010520
name: argocd-cmd-params-cm
1052110521
optional: true
10522-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
10522+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
1052310523
imagePullPolicy: Always
1052410524
livenessProbe:
1052510525
httpGet:
@@ -10721,7 +10721,7 @@ spec:
1072110721
key: otlp.address
1072210722
name: argocd-cmd-params-cm
1072310723
optional: true
10724-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
10724+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
1072510725
imagePullPolicy: Always
1072610726
livenessProbe:
1072710727
httpGet:

manifests/namespace-install.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ spec:
532532
valueFrom:
533533
fieldRef:
534534
fieldPath: metadata.namespace
535-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
535+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
536536
imagePullPolicy: Always
537537
name: argocd-applicationset-controller
538538
ports:
@@ -629,7 +629,7 @@ spec:
629629
- -n
630630
- /usr/local/bin/argocd
631631
- /shared/argocd-dex
632-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
632+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
633633
imagePullPolicy: Always
634634
name: copyutil
635635
securityContext:
@@ -869,7 +869,7 @@ spec:
869869
value: /helm-working-dir
870870
- name: HELM_DATA_HOME
871871
value: /helm-working-dir
872-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
872+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
873873
imagePullPolicy: Always
874874
livenessProbe:
875875
failureThreshold: 3
@@ -921,7 +921,7 @@ spec:
921921
- -n
922922
- /usr/local/bin/argocd
923923
- /var/run/argocd/argocd-cmp-server
924-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
924+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
925925
name: copyutil
926926
securityContext:
927927
allowPrivilegeEscalation: false
@@ -1166,7 +1166,7 @@ spec:
11661166
key: otlp.address
11671167
name: argocd-cmd-params-cm
11681168
optional: true
1169-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
1169+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
11701170
imagePullPolicy: Always
11711171
livenessProbe:
11721172
httpGet:
@@ -1368,7 +1368,7 @@ spec:
13681368
key: otlp.address
13691369
name: argocd-cmd-params-cm
13701370
optional: true
1371-
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-release-2
1371+
image: quay.io/codefresh/argocd:v2.4.15-cap-CR-14605-fix-logs
13721372
imagePullPolicy: Always
13731373
livenessProbe:
13741374
httpGet:
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package application
2+
3+
import (
4+
"context"
5+
"errors"
6+
"fmt"
7+
gohttp "net/http"
8+
9+
"github.com/argoproj/argo-cd/v2/util/kube"
10+
11+
"github.com/argoproj/pkg/grpc/http"
12+
"github.com/grpc-ecosystem/grpc-gateway/runtime"
13+
14+
// nolint:staticcheck
15+
"github.com/golang/protobuf/proto"
16+
17+
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
18+
)
19+
20+
func init() {
21+
logsForwarder := func(ctx context.Context, mux *runtime.ServeMux, marshaler runtime.Marshaler, w gohttp.ResponseWriter, req *gohttp.Request, recv func() (proto.Message, error), opts ...func(context.Context, gohttp.ResponseWriter, proto.Message) error) {
22+
if req.URL.Query().Get("download") == "true" {
23+
w.Header().Set("Content-Type", "application/octet-stream")
24+
fileName := "log"
25+
if container := req.URL.Query().Get("container"); len(container) > 0 && kube.IsValidResourceName(container) {
26+
fileName = container
27+
}
28+
w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment;filename="%s.txt"`, fileName))
29+
for {
30+
msg, err := recv()
31+
if err != nil {
32+
_, _ = w.Write([]byte(err.Error()))
33+
return
34+
}
35+
if logEntry, ok := msg.(*LogEntry); ok {
36+
if logEntry.GetLast() {
37+
return
38+
}
39+
if _, err = w.Write([]byte(logEntry.GetContent() + "\n")); err != nil {
40+
return
41+
}
42+
}
43+
}
44+
} else {
45+
http.StreamForwarder(ctx, mux, marshaler, w, req, recv, opts...)
46+
}
47+
}
48+
forward_ApplicationService_PodLogs_0 = logsForwarder
49+
forward_ApplicationService_PodLogs_1 = logsForwarder
50+
forward_ApplicationService_WatchResourceTree_0 = http.StreamForwarder
51+
forward_ApplicationService_Watch_0 = http.NewStreamForwarder(func(message proto.Message) (string, error) {
52+
event, ok := message.(*v1alpha1.ApplicationWatchEvent)
53+
if !ok {
54+
return "", errors.New("unexpected message type")
55+
}
56+
return event.Application.Name, nil
57+
})
58+
forward_ApplicationService_List_0 = http.UnaryForwarder
59+
forward_ApplicationService_ManagedResources_0 = http.UnaryForwarder
60+
}

0 commit comments

Comments
 (0)