Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 Update tooling #6

Merged
merged 4 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .dockerignore

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: images

on:
push:
tags:
- "v*"
branches:
- "*"
paths-ignore:
- "**.md"

jobs:
images:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
- run: make images PUSH=true
57 changes: 0 additions & 57 deletions .github/workflows/on-push-pre-release.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/on-push-test.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/on-release-publish.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: verify

on:
pull_request:
paths-ignore:
- "**.md"
push:
branches:
- '*'
paths-ignore:
- "**.md"

jobs:
verify:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: make verify-extended
run: |
git config --global user.email "ci@gardener.cloud"
git config --global user.name "ci"
make verify-extended
102 changes: 102 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
run:
concurrency: 4
deadline: 10m

skip-files:
- "zz_generated\\..*\\.go$"

linters:
enable:
- revive
- unused
- importas
- exportloopref
- nilerr
- whitespace

issues:
exclude-use-default: false
exclude:
# errcheck: Almost all programs ignore errors on these functions and in most cases it's ok
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked
# revive:
- var-naming # ((var|const|struct field|func) .* should be .*
- dot-imports # should not use dot imports
- package-comments # package comment should be of the form
- unexported-return # exported func .* returns unexported type .*, which can be annoying to use
- indent-error-flow # if block ends with a return statement, so drop this else and outdent its block
- "exported: (type|func) name will be used as .* by other packages, and that stutters;"
# typecheck:
- "undeclared name: `.*`"
- "\".*\" imported but not used"
# allow non-capitalized messages if they start with technical terms
- "structured logging message should be capitalized: \"garden(er-apiserver|er-controller-manager|er-admission-controller|er-operator|er-resource-manager|let)"
exclude-rules:
- linters:
- staticcheck
text: "SA1019:" # Excludes messages where deprecated variables are used

linters-settings:
revive:
rules:
- name: duplicated-imports
- name: unused-parameter
- name: unreachable-code
- name: context-as-argument
- name: early-return
- name: exported
importas:
alias:
# External imported packages
- pkg: k8s.io/api/(\w+)/(v[\w\d]+)
alias: $1$2
- pkg: k8s.io/apimachinery/pkg/apis/(\w+)/(v[\w\d]+)
alias: $1$2
- pkg: k8s.io/apimachinery/pkg/api/([^m]\w+)
alias: api${1}
- pkg: k8s.io/apimachinery/pkg/util/(\w+)
alias: util${1}
- pkg: k8s.io/utils/clock/testing
alias: testclock
- pkg: sigs.k8s.io/controller-runtime/pkg/client/fake
alias: fakeclient
- pkg: sigs.k8s.io/controller-runtime/pkg/log/zap
alias: logzap
- pkg: sigs.k8s.io/controller-runtime/pkg/log
alias: logf
# Gardener extension package
- pkg: github.com/gardener/gardener/extensions/.*/(\w+)/mock$
alias: extensionsmock${1}
- pkg: github.com/gardener/gardener/extensions/pkg/apis/config
alias: extensionsconfig
- pkg: github.com/gardener/gardener/extensions/pkg/controller
alias: extensionscontroller
- pkg: github.com/gardener/gardener/extensions/pkg/predicate
alias: extensionspredicate
- pkg: github.com/gardener/gardener/extensions/pkg/controller/([^m]\w+)
alias: extensions${1}controller
- pkg: github.com/gardener/gardener/extensions/pkg/controller/heartbeat/cmd
alias: extensionsheartbeatcmd
- pkg: github.com/gardener/gardener/extensions/pkg/controller/worker/helper
alias: extensionsworkerhelper
- pkg: github.com/gardener/gardener/extensions/pkg/util/secret/manager
alias: extensionssecretsmanager
- pkg: github.com/gardener/gardener/extensions/pkg/webhook
alias: extensionswebhook
- pkg: github.com/gardener/gardener/extensions/pkg/webhook/([^m]\w+)
alias: extensions${1}webhook
# Gardener other packages
- pkg: github.com/gardener/gardener/pkg/api/extensions
alias: apiextensions
- pkg: github.com/gardener/gardener/pkg/apis/core
alias: gardencore
- pkg: github.com/gardener/gardener/pkg/apis/core/([\w\d]+)
alias: gardencore${1}
- pkg: github.com/gardener/gardener/pkg/apis/core/([\w\d]+)/helper
alias: ${1}helper
- pkg: github.com/gardener/gardener/pkg/apis/([^c]\w+)/([\w\d]+)
alias: $1$2
- pkg: github.com/gardener/gardener/pkg/apis/([^c]\w+)/([\w\d]+)/([\w\d]+)
alias: $1$2$3
- pkg: github.com/gardener/gardener/pkg/chartrenderer
alias: chartrenderer
5 changes: 5 additions & 0 deletions .ko.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
builds:
- main: ./cmd/gardener-extension-shoot-flux
ldflags:
- |
{{.Env.LD_FLAGS}}
23 changes: 0 additions & 23 deletions Dockerfile

This file was deleted.

Loading