Skip to content

Commit

Permalink
fix: deploy reviewbot
Browse files Browse the repository at this point in the history
  • Loading branch information
wwcchh0123 committed Sep 10, 2024
1 parent 3bca48f commit c71d8ae
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions deploy/reviewbot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ spec:
- -app-id=$(GITHUB_APP_ID)
- -app-private-key=/secrets/github_app_key
- -debug=true
- -s3-credentials-file=/root/.aws/credentials.json
- -server-addr=http://qiniu-x.jfcs-k8s-qa1.qiniu.io # this is an intranet domain of qiniu.
env:
- name: GITHUB_WEBHOOK_SECRET
valueFrom:
Expand Down Expand Up @@ -75,6 +77,11 @@ spec:
subPath: .golangci.goplus.yml
name: golangci-config-goplus
readOnly: true
- mountPath: /tmp
name: reviewbot-pvc
- name: aws-credentials-volume
mountPath: /root/.aws/credentials.json
subPath: credentials.json
- name: dind
image: aslan-spock-register.qiniu.io/qa/docker:27.2.0-dind
securityContext:
Expand Down Expand Up @@ -124,6 +131,13 @@ spec:
name: golangci-config-goplus
- name: dind-storage
emptyDir: {}
- name: reviewbot-pvc
persistentVolumeClaim:
claimName: reviewbot-pvc
- name: aws-credentials-volume
configMap:
name: s3credentials-cm


---
apiVersion: v1
Expand Down Expand Up @@ -174,5 +188,28 @@ spec:
number: 8888
path: /hook
pathType: Prefix
- host: qiniu-x.jfcs-k8s-qa1.qiniu.io
http:
paths:
- backend:
service:
name: reviewbot
port:
number: 8888
path: /view
pathType: Prefix
---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: reviewbot-pvc
namespace: reviewbot
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Gi

---
2 changes: 1 addition & 1 deletion internal/storage/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type s3Credentials struct {
func NewS3Storage(credFilePath string) (Storage, error) {
credential, err := os.ReadFile(credFilePath)
if err != nil {
return nil, fmt.Errorf("failed to open S3CredentialsFile: %w", err)
return nil, fmt.Errorf("failed to open S3CredentialsFile: %v", err)

Check warning on line 34 in internal/storage/s3.go

View check run for this annotation

qiniu-x / golangci-lint

internal/storage/s3.go#L34

do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"failed to open S3CredentialsFile: %v\", err)" (err113)
}
s3Creds := &s3Credentials{}
if err := json.Unmarshal(credential, s3Creds); err != nil {
Expand Down

0 comments on commit c71d8ae

Please sign in to comment.