Skip to content

Commit 04cfa00

Browse files
authored
Merge pull request #1 from nginx/nginxaas-merge-devops
Merge in changes made by NGINXaaS for Azure project
2 parents 049b252 + 9b190c4 commit 04cfa00

File tree

96 files changed

+3929
-3485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+3929
-3485
lines changed

.gitignore

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,69 @@ cover*
2323
tmp/
2424
docs/tls/DESIGN.md
2525
:q
26-
qqq
26+
qqq.env
27+
.env*
28+
!.env.example
29+
!.allowed_clients.json
30+
!.env.example.auth
31+
*.db
32+
priv/certs
33+
priv/nginx-agent/*
34+
!priv/nginx-agent/nginx-agent.conf.example
35+
key-data.json
36+
nginx-instance-manager.tar.gz
37+
vendor/
38+
39+
# Binaries for programs and plugins
40+
*.exe
41+
*.exe~
42+
*.dll
43+
*.so
44+
*.dylib
45+
46+
# Test binary, built with `go test -c`
47+
*.test
48+
49+
# Output of the go coverage tool, specifically when used with LiteIDE
50+
*.out
51+
52+
# Output from debugger
53+
__debug_bin
54+
55+
code-quality.json
56+
coverage/*
57+
58+
# vim
59+
*~
60+
*.swp
61+
62+
### VisualStudioCode (from https://gitignore.io/api/VisualStudioCode) ###
63+
.vscode/*
64+
!.vscode/tasks.example.json
65+
!.vscode/launch.example.json
66+
!.vscode/extensions.json
67+
!.vscode/KubernetesLocalProcessConfig*.yaml
68+
*.code-workspace
69+
70+
### Goland
71+
.idea/*
72+
73+
# bridge to kubernetes artifact
74+
/KubernetesLocalProcessConfig.yaml
75+
76+
77+
# output directory for build artifacts
78+
build
79+
80+
# output directory for test artifacts (eg. coverage report, junit xml)
81+
results
82+
83+
# devops-utils repo
84+
.devops-utils/
85+
86+
# Ignore golang cache in CI
87+
.go/pkg/mod
88+
89+
.go-build
90+
91+
nginxaas-loadbalancer-kubernetes-*

.golangci.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# GolangCI-Lint settings
2+
3+
# Disable all linters and enable the required ones
4+
linters:
5+
disable-all: true
6+
7+
# Supported linters: https://golangci-lint.run/usage/linters/
8+
enable:
9+
- errcheck
10+
- gosimple
11+
- govet
12+
- ineffassign
13+
- staticcheck
14+
- typecheck
15+
- unused
16+
- bodyclose
17+
- dupl
18+
- gochecknoinits
19+
- goconst
20+
- gocritic
21+
- gocyclo
22+
- gofmt
23+
- goimports
24+
- gosec
25+
- lll
26+
- misspell
27+
- nakedret
28+
- prealloc
29+
- stylecheck
30+
- unconvert
31+
- unparam
32+
- paralleltest
33+
- forbidigo
34+
fast: false
35+
36+
# Run options
37+
run:
38+
# 10 minute timeout for analysis
39+
timeout: 10m
40+
# Specific linter settings
41+
linters-settings:
42+
gocyclo:
43+
# Minimal code complexity to report
44+
min-complexity: 16
45+
govet:
46+
disable-all: true
47+
enable:
48+
# Report shadowed variables
49+
- shadow
50+
51+
misspell:
52+
# Correct spellings using locale preferences for US
53+
locale: US
54+
goimports:
55+
# Put imports beginning with prefix after 3rd-party packages
56+
local-prefixes: gitswarm.f5net.com/indigo,gitlab.com/f5
57+
exhaustruct:
58+
# List of regular expressions to match struct packages and names.
59+
# If this list is empty, all structs are tested.
60+
# Default: []
61+
include:
62+
- "gitlab.com/f5/nginx/nginxazurelb/azure-resource-provider/pkg/token.TokenID"
63+
- "gitlab.com/f5/nginx/nginxazurelb/azure-resource-provider/internal/dpo/agent/certificates.CertGetRequest"
64+
65+
issues:
66+
exclude-dirs:
67+
- .go/pkg/mod
68+
# Exclude configuration
69+
exclude-rules:
70+
# Exclude gochecknoinits and gosec from running on tests files
71+
- path: _test\.go
72+
linters:
73+
- gochecknoinits
74+
- gosec
75+
- path: test/*
76+
linters:
77+
- gochecknoinits
78+
- gosec
79+
# Exclude lll issues for long lines with go:generate
80+
- linters:
81+
- lll
82+
source: "^//go:generate "
83+
# Exclude false positive paralleltest error : Range statement for test case does not use range value in test Run
84+
- linters:
85+
- paralleltest
86+
text: "does not use range value in test Run"
87+
88+
# Disable maximum issues count per one linter
89+
max-issues-per-linter: 0
90+
91+
# Disable maximum count of issues with the same text
92+
max-same-issues: 0

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
golang 1.23.3
1+
golang 1.24.4

Dockerfile

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,11 @@
1-
# Copyright 2023 f5 Inc. All rights reserved.
2-
# Use of this source code is governed by the Apache
3-
# license that can be found in the LICENSE file.
1+
FROM alpine:3.14.1 AS base-certs
2+
RUN apk update && apk add --no-cache ca-certificates
43

5-
FROM golang:1.23.3-alpine3.20 AS builder
4+
FROM scratch AS base
5+
COPY docker-user /etc/passwd
6+
USER 101
7+
COPY --from=base-certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
68

7-
WORKDIR /app
8-
9-
COPY go.mod go.sum ./
10-
11-
RUN go mod download
12-
13-
COPY . .
14-
15-
RUN go build -o nginx-loadbalancer-kubernetes ./cmd/nginx-loadbalancer-kubernetes/main.go
16-
17-
FROM alpine:3.20
18-
19-
WORKDIR /opt/nginx-loadbalancer-kubernetes
20-
21-
RUN adduser -u 11115 -D -H nlk
22-
23-
USER nlk
24-
25-
COPY --from=builder /app/nginx-loadbalancer-kubernetes .
26-
27-
ENTRYPOINT ["/opt/nginx-loadbalancer-kubernetes/nginx-loadbalancer-kubernetes"]
9+
FROM base as nginxaas-loadbalancer-kubernetes
10+
ENTRYPOINT ["/nginxaas-loadbalancer-kubernetes"]
11+
COPY build/nginxaas-loadbalancer-kubernetes /

0 commit comments

Comments
 (0)