Skip to content

Commit

Permalink
chore(repo): add renovate managers
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Bähler <[email protected]>
  • Loading branch information
oliverbaehler committed Feb 6, 2025
1 parent 425c881 commit d97527e
Show file tree
Hide file tree
Showing 19 changed files with 128 additions and 157 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/codecov.yml

This file was deleted.

102 changes: 102 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Coverage
on:
push:
branches:
- "main"
pull_request:
types: [opened, reopened, synchronize]
branches:
- "main"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
compliance:
name: "License Compliance"
runs-on: ubuntu-24.04
steps:
- name: "Checkout Code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Check secret
id: checksecret
uses: ./.github/actions/exists
with:
value: ${{ secrets.FOSSA_API_KEY }}
- name: "Run FOSSA Scan"
if: steps.checksecret.outputs.result == 'true'
uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
- name: "Run FOSSA Test"
if: steps.checksecret.outputs.result == 'true'
uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
run-tests: true
sast:
name: "SAST"
runs-on: ubuntu-24.04
env:
GO111MODULE: on

Check warning on line 42 in .github/workflows/coverage.yml

View workflow job for this annotation

GitHub Actions / yamllint

42:20 [truthy] truthy value should be one of [false, true]
permissions:
security-events: write
actions: read
contents: read
steps:
- name: Checkout Source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: 'go.mod'
- name: Run Gosec Security Scanner
uses: securego/gosec@e0cca6fe95306b7e7790d6f1bf6a7bec6d622459 # v2.22.0
with:
args: '-no-fail -fmt sarif -out gosec.sarif ./...'
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@08bc0cf022445eacafaa248bf48da20f26b8fd40
with:
sarif_file: gosec.sarif
unit_tests:
name: "Unit tests"
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: 'go.mod'
- name: Unit Test
run: make test
- name: Upload Coverage Results
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
with:
name: code-coverage
path: coverage.out
- name: Check secret
id: checksecret
uses: ./.github/actions/exists
with:
value: ${{ secrets.CODECOV_TOKEN }}
- name: Upload Report to Codecov
if: steps.checksecret.outputs.result == 'true'
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
with:
file: ./coverage.out
fail_ci_if_error: true
verbose: true
coverage_upload:
name: "Code coverage report"
if: github.event_name == 'pull_request' # Do not run when workflow is triggered by push to main branch
runs-on: ubuntu-24.04
needs: unit_tests # Depends on the artifact uploaded by the "unit_tests" job
permissions:
contents: read
actions: read # to download code coverage results from "test" job
pull-requests: write # write permission needed to comment on PR
steps:
- uses: fgrosse/go-coverage-report@8c1d1a09864211d258937b1b1a5b849f7e4f2682 # Consider using a Git revision for maximum security
with:
coverage-artifact-name: "code-coverage" # can be omitted if you used this default value
coverage-file-name: "coverage.txt" #
32 changes: 0 additions & 32 deletions .github/workflows/fossa.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/gosec.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ linters:
- deadcode
- ifshort
- nonamedreturns
service:
golangci-lint-version: 1.56.x
run:
timeout: 3m
go: '1.21'
allow-parallel-runners: true
tests: false
skip-files:
- "zz_.*\\.go$"
- ".+\\.generated.go"
Expand Down
41 changes: 21 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,24 @@ repos:
entry: make helm-lint
language: system
files: ^charts/
- id: golangci-lint
name: Execute golangci-lint
entry: make golint
language: system
files: \.go$
- repo: https://github.com/tekwizely/pre-commit-golang
rev: v1.0.0-rc.1
hooks:
- id: go-vet
- id: go-vet-mod
- id: go-vet-pkg
- id: go-vet-repo-mod
- id: go-vet-repo-pkg
- id: go-revive
- id: go-revive-mod
- id: go-revive-repo-mod
- id: go-sec-mod
- id: go-sec-pkg
- id: go-sec-repo-mod
- id: go-sec-repo-pkg
# Currently too slow smw
# - id: golangci-lint
# name: Execute golangci-lint
# entry: make golint
# language: system
# files: \.go$
# - repo: https://github.com/tekwizely/pre-commit-golang
# rev: v1.0.0-rc.1
# hooks:
# - id: go-vet
# - id: go-vet-mod
# - id: go-vet-pkg
# - id: go-vet-repo-mod
# - id: go-vet-repo-pkg
# - id: go-revive
# - id: go-revive-mod
# - id: go-revive-repo-mod
# - id: go-sec-mod
# - id: go-sec-pkg
# - id: go-sec-repo-mod
# - id: go-sec-repo-pkg
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ run: generate manifests
go run .

# Generate manifests e.g. CRD, RBAC etc.
manifests: controller-gen
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=charts/capsule/crds
manifests: generate
$(CONTROLLER_GEN) crd paths="./..." output:crd:artifacts:config=charts/capsule/crds

# Generate code
generate: controller-gen
Expand Down Expand Up @@ -216,7 +216,7 @@ goimports:
# Linting code as PR is expecting
.PHONY: golint
golint: golangci-lint
$(GOLANGCI_LINT) run -c .golangci.yml
$(GOLANGCI_LINT) run -c .golangci.yml --verbose --fix

# Running e2e tests in a KinD instance
.PHONY: e2e
Expand Down
2 changes: 0 additions & 2 deletions pkg/webhook/route/cordoning.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook"
)

// +kubebuilder:webhook:path=/cordoning,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="*",resources="*",verbs=create;update;delete,versions="*",name=cordoning.tenant.projectcapsule.dev

type cordoning struct {
handlers []capsulewebhook.Handler
}
Expand Down
4 changes: 0 additions & 4 deletions pkg/webhook/route/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import (
capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook"
)

// +kubebuilder:webhook:path=/defaults,mutating=true,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=pods,verbs=create,versions=v1,name=pod.defaults.projectcapsule.dev
// +kubebuilder:webhook:path=/defaults,mutating=true,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=persistentvolumeclaims,verbs=create,versions=v1,name=storage.defaults.projectcapsule.dev
// +kubebuilder:webhook:path=/defaults,mutating=true,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups=networking.k8s.io,resources=ingresses,verbs=create;update,versions=v1beta1;v1,name=ingress.defaults.projectcapsule.dev

type defaults struct {
handlers []capsulewebhook.Handler
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/webhook/route/ingresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook"
)

// +kubebuilder:webhook:path=/ingresses,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups=networking.k8s.io;extensions,resources=ingresses,verbs=create;update,versions=v1beta1;v1,name=ingress.projectcapsule.dev

type ingress struct {
handlers []capsulewebhook.Handler
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/webhook/route/namespaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook"
)

// +kubebuilder:webhook:path=/namespaces,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=namespaces,verbs=create;update;delete,versions=v1,name=namespaces.projectcapsule.dev

type namespace struct {
handlers []capsulewebhook.Handler
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/webhook/route/networkpolicies.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook"
)

// +kubebuilder:webhook:path=/networkpolicies,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="networking.k8s.io",resources=networkpolicies,verbs=update;delete,versions=v1,name=networkpolicies.projectcapsule.dev

type networkPolicy struct {
handlers []capsulewebhook.Handler
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/webhook/route/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook"
)

// +kubebuilder:webhook:path=/nodes,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=nodes,verbs=update,versions=v1,name=nodes.projectcapsule.dev

type node struct {
handlers []capsulewebhook.Handler
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/webhook/route/ownerreference.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook"
)

// +kubebuilder:webhook:path=/namespace-owner-reference,mutating=true,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=namespaces,verbs=create;update,versions=v1,name=owner.namespace.projectcapsule.dev

type webhook struct {
handlers []capsulewebhook.Handler
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/webhook/route/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook"
)

// +kubebuilder:webhook:path=/pods,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=pods,verbs=create;update,versions=v1,name=pods.projectcapsule.dev

type pod struct {
handlers []capsulewebhook.Handler
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/webhook/route/pvc.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook"
)

// +kubebuilder:webhook:path=/persistentvolumeclaims,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=persistentvolumeclaims,verbs=create,versions=v1,name=pvc.projectcapsule.dev

type pvc struct {
handlers []capsulewebhook.Handler
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/webhook/route/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook"
)

// +kubebuilder:webhook:path=/services,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="",resources=services,verbs=create;update,versions=v1,name=services.projectcapsule.dev

type service struct {
handlers []capsulewebhook.Handler
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/webhook/route/tenantresource_objs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook"
)

// +kubebuilder:webhook:path=/tenantresource-objects,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="*",resources="*",verbs=update;delete,versions="*",name=resource-objects.tenant.projectcapsule.dev

type tntResourceObjs struct {
handlers []capsulewebhook.Handler
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/webhook/route/tenants.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
capsulewebhook "github.com/projectcapsule/capsule/pkg/webhook"
)

// +kubebuilder:webhook:path=/tenants,mutating=false,sideEffects=None,admissionReviewVersions=v1,failurePolicy=fail,groups="capsule.clastix.io",resources=tenants,verbs=create;update;delete,versions=v1beta2,name=tenants.projectcapsule.dev

type tenant struct {
handlers []capsulewebhook.Handler
}
Expand Down

0 comments on commit d97527e

Please sign in to comment.