Skip to content

Commit 1d020d2

Browse files
committed
new history
0 parents  commit 1d020d2

Some content is hidden

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

43 files changed

+4163
-0
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
bin/
2+
deploy/
3+
scripts/
4+
.git/

.github/workflows/lint.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: lint
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
golangci-lint:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-go@v5
12+
with:
13+
go-version-file: "go.mod"
14+
- uses: golangci/golangci-lint-action@v8

.github/workflows/release.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags: ["v*.*.*"]
6+
7+
permissions:
8+
contents: write
9+
packages: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version-file: 'go.mod'
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
with:
27+
driver: docker-container
28+
29+
- name: Log in to GHCR
30+
uses: docker/login-action@v3
31+
with:
32+
registry: ghcr.io
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Create release
37+
uses: goreleaser/goreleaser-action@v6
38+
with:
39+
distribution: goreleaser
40+
version: 1
41+
args: release --clean
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: test
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
7+
jobs:
8+
run-tests:
9+
name: run-tests
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Install Go
15+
uses: actions/setup-go@v5
16+
with:
17+
go-version-file: "go.mod"
18+
- name: Run unit tests
19+
run: go test -race ./...

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
bin/
2+
.idea/
3+
dev/
4+
.env
5+
.env.*
6+
.vscode/
7+
__debug_bin
8+
.DS_Store
9+
vendor/
10+
# Added by goreleaser init:
11+
dist/

.golangci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
version: "2"
2+
linters:
3+
default: none
4+
enable:
5+
- asasalint
6+
- asciicheck
7+
- bidichk
8+
- bodyclose
9+
- containedctx
10+
- dogsled
11+
- errcheck
12+
- goconst
13+
- gocritic
14+
- gomoddirectives
15+
- goprintffuncname
16+
- gosec
17+
- govet
18+
- ineffassign
19+
- makezero
20+
- misspell
21+
- nakedret
22+
- nilnil
23+
- nolintlint
24+
- nosprintfhostport
25+
- predeclared
26+
- revive
27+
- rowserrcheck
28+
- staticcheck
29+
- unconvert
30+
- unused
31+
- wastedassign
32+
- whitespace
33+
settings:
34+
goconst:
35+
min-len: 5
36+
exclusions:
37+
generated: lax
38+
presets:
39+
- comments
40+
- common-false-positives
41+
- legacy
42+
- std-error-handling
43+
rules:
44+
- linters:
45+
- bodyclose
46+
- funlen
47+
path: _test\.go
48+
paths:
49+
- third_party$
50+
- builtin$
51+
- examples$
52+
issues:
53+
max-issues-per-linter: 0
54+
max-same-issues: 0
55+
uniq-by-line: false
56+
formatters:
57+
enable:
58+
- gofumpt
59+
- goimports
60+
exclusions:
61+
generated: lax
62+
paths:
63+
- third_party$
64+
- builtin$
65+
- examples$

.goreleaser.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
project_name: upcloud-cloud-controller-manager
2+
3+
builds:
4+
- env:
5+
- CGO_ENABLED=0
6+
binary: cloud-controller-manager
7+
main: ./cmd/upcloud-cloud-controller-manager
8+
goos:
9+
- linux
10+
goarch:
11+
- amd64
12+
ldflags:
13+
- -w -s
14+
- -X k8s.io/component-base/version.gitVersion=v{{.Version}}
15+
- -X k8s.io/component-base/version.gitCommit={{.FullCommit}}
16+
- -X "k8s.io/component-base/version/verflag.programName=UpCloud cloud controller manager"
17+
18+
dockers:
19+
- image_templates:
20+
- "ghcr.io/upcloudltd/cloud-controller-manager:v{{.Version}}"
21+
dockerfile: Dockerfile
22+
use: docker
23+
build_flag_templates:
24+
- "--platform=linux/amd64"
25+
- "--label=org.opencontainers.image.created={{.Date}}"
26+
- "--label=org.opencontainers.image.name={{.ProjectName}}"
27+
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
28+
- "--label=org.opencontainers.image.version={{.Version}}"
29+
- "--label=org.opencontainers.image.source={{.GitURL}}"
30+
goarch: amd64
31+
goos: linux
32+
33+
release:
34+
draft: true

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
repos:
2+
- repo: https://github.com/dnephin/pre-commit-golang
3+
rev: v0.5.1
4+
hooks:
5+
- id: go-fmt
6+
- id: golangci-lint
7+
- id: go-unit-tests
8+
- id: go-build
9+
- id: go-mod-tidy

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/)
5+
6+
## [Unreleased]
7+
8+
## [1.0.0]
9+
10+
First open source release
11+
12+
[Unreleased]: https://github.com/UpCloudLtd/upcloud-cloud-controller-manager/compare/v1.0.0...HEAD
13+
[1.0.0]: https://github.com/UpCloudLtd/upcloud-cloud-controller-manager/releases/tag/v1.0.0

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM alpine:3.22
2+
RUN apk add --no-cache curl tini
3+
COPY cloud-controller-manager /usr/local/bin/
4+
ENTRYPOINT ["/sbin/tini", "--"]
5+
CMD ["cloud-controller-manager"]

0 commit comments

Comments
 (0)