diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index b5c9176ea..0fda74f71 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -90,10 +90,10 @@ jobs: name: Checkout repository uses: actions/checkout@v4.1.7 - - name: Setup Go 1.18 + name: Setup Go 1.23 uses: actions/setup-go@v5 with: - go-version: 1.18 + go-version: 1.23 - name: Download goimports run: | @@ -102,7 +102,7 @@ jobs: name: Download golangci-lint run: | curl -sSfL --output /tmp/golangci-lint.sh https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh - cat /tmp/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.49.0 + cat /tmp/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.1 - name: Run linter working-directory: jenkins/webhook-proxy diff --git a/CHANGELOG.md b/CHANGELOG.md index fb8c1eb4a..3137f9f61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Added ### Changed +- Webhook Proxy maintenance ([#1298](https://github.com/opendevstack/ods-core/pull/1298)) ### Fixed diff --git a/jenkins/ocp-config/deploy/jenkins-webhook-proxy.yml b/jenkins/ocp-config/deploy/jenkins-webhook-proxy.yml index 5eed693a7..5bf6fde34 100644 --- a/jenkins/ocp-config/deploy/jenkins-webhook-proxy.yml +++ b/jenkins/ocp-config/deploy/jenkins-webhook-proxy.yml @@ -21,13 +21,13 @@ parameters: - name: ODS_BITBUCKET_PROJECT required: true - name: WEBHOOK_PROXY_CPU_REQUEST - value: 50m + value: 25m - name: WEBHOOK_PROXY_CPU_LIMIT - value: 200m + value: 50m - name: WEBHOOK_PROXY_MEMORY_REQUEST - value: 128Mi + value: 30Mi - name: WEBHOOK_PROXY_MEMORY_LIMIT - value: 128Mi + value: 40Mi objects: - apiVersion: route.openshift.io/v1 kind: Route diff --git a/jenkins/webhook-proxy/Dockerfile b/jenkins/webhook-proxy/Dockerfile index 8dd80316a..762446d32 100644 --- a/jenkins/webhook-proxy/Dockerfile +++ b/jenkins/webhook-proxy/Dockerfile @@ -1,13 +1,16 @@ # Ideally we would us a very small image like plain alpine and just copy the # pre-built binary into it, but due to e.g. multistage builds not available in # OpenShift yet, for now the easiest is to build the binary in this image. -FROM golang:1.18-alpine +FROM golang:1.23-alpine # Set default ALLOWED_EXTERNAL_PROJECTS env var ARG allowedExternalProjects=opendevstack ENV ALLOWED_EXTERNAL_PROJECTS=$allowedExternalProjects -RUN apk add --no-cache ca-certificates && \ +RUN apk add -i ca-certificates && \ + apk update && \ + apk -i upgrade && \ + apk cache clean && \ mkdir -p /home/webhook-proxy && \ chgrp -R 0 /home/webhook-proxy && \ chmod g+w /home/webhook-proxy diff --git a/jenkins/webhook-proxy/Makefile b/jenkins/webhook-proxy/Makefile index dca27bcb7..bb3c62991 100644 --- a/jenkins/webhook-proxy/Makefile +++ b/jenkins/webhook-proxy/Makefile @@ -8,7 +8,7 @@ fmt: lint: golangci-lint --version - golangci-lint run --go=1.18 + golangci-lint run --go=1.23 build: build-linux build-darwin build-windows diff --git a/jenkins/webhook-proxy/go.mod b/jenkins/webhook-proxy/go.mod index 281b2e28e..3a9f0f8d5 100644 --- a/jenkins/webhook-proxy/go.mod +++ b/jenkins/webhook-proxy/go.mod @@ -1,3 +1,3 @@ module github.com/opendevstack/ods-core/jenkins/webhook-proxy -go 1.18 +go 1.23 diff --git a/jenkins/webhook-proxy/main.go b/jenkins/webhook-proxy/main.go index 132fcceab..49615bc4b 100644 --- a/jenkins/webhook-proxy/main.go +++ b/jenkins/webhook-proxy/main.go @@ -593,11 +593,12 @@ func (c *ocClient) Forward(e *Event, triggerSecret string) (int, []byte, error) e.Pipeline, triggerSecret, ) - log.Println(e.RequestID, "Forwarding to", url) c.CheckJenkinsAvailability(e) c.CheckDocGenAvailability(e) + log.Println(e.RequestID, "Forwarding to", url) + p := struct { Env []EnvPair `json:"env"` }{ @@ -629,9 +630,6 @@ func (c *ocClient) CreateOrUpdatePipeline(exists bool, tmpl *template.Template, return 500, err } - c.CheckJenkinsAvailability(e) - c.CheckDocGenAvailability(e) - url := fmt.Sprintf( "%s/namespaces/%s/buildconfigs", c.OpenShiftAPIBaseURL, @@ -673,9 +671,6 @@ func (c *ocClient) DeletePipeline(e *Event) error { e.Pipeline, ) - c.CheckJenkinsAvailability(e) - c.CheckDocGenAvailability(e) - req, _ := http.NewRequest( "DELETE", url,