Skip to content

Commit ecfc967

Browse files
committed
feat(controller): hard fork
Signed-off-by: Oliver Bähler <[email protected]>
1 parent e83a4d4 commit ecfc967

Some content is hidden

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

77 files changed

+5504
-201
lines changed

.github/ISSUE_TEMPLATE/bug.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve the addon
4+
title: ''
5+
labels: blocked-needs-validation, bug
6+
assignees: ''
7+
8+
---
9+
10+
# Bug description
11+
12+
A clear and concise description of what the bug is.
13+
14+
# How to reproduce
15+
16+
Steps to reproduce the behavior:
17+
18+
1. Relevant Translator manifests
19+
2. Relevant ArgoAddon manifests
20+
21+
# Expected behavior
22+
23+
A clear and concise description of what you expected to happen.
24+
25+
# Logs
26+
27+
If applicable, please provide logs:
28+
29+
# Additional context
30+
31+
- Addon version:
32+
- Argo version:
33+
- Kubernetes version:

.github/ISSUE_TEMPLATE/config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Chat on Slack
4+
url: https://kubernetes.slack.com/archives/C03GETTJQRL
5+
about: Maybe chatting with the community can help
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: Feature request
3+
about: Suggest a new feature for the addon
4+
title: ''
5+
labels: blocked-needs-validation, feature
6+
assignees: ''
7+
8+
---
9+
10+
# Describe the feature
11+
12+
A clear and concise description of the feature.
13+
14+
# Expected behavior
15+
A clear and concise description of what you expect to happen.

.github/actions/exists/action.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Checks if an input is defined
2+
3+
description: Checks if an input is defined and outputs 'true' or 'false'.
4+
5+
inputs:
6+
value:
7+
description: value to test
8+
required: true
9+
10+
outputs:
11+
result:
12+
description: outputs 'true' or 'false' if input value is defined or not
13+
value: ${{ steps.check.outputs.result }}
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- shell: bash
19+
id: check
20+
run: |
21+
echo "result=${{ inputs.value != '' }}" >> $GITHUB_OUTPUT

.github/configs/ct.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
remote: origin
2+
target-branch: main
3+
chart-dirs:
4+
- charts/
5+
validate-chart-schema: false
6+
validate-maintainers: false
7+
validate-yaml: true
8+
exclude-deprecated: true
9+
check-version-increment: false

.github/configs/lintconf.yaml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
ignore:
3+
- config/
4+
- charts/*/templates/
5+
- charts/**/templates/
6+
- docs/**
7+
- hack/**
8+
rules:
9+
truthy:
10+
level: warning
11+
allowed-values:
12+
- "true"
13+
- "false"
14+
- "on"
15+
- "off"
16+
check-keys: false
17+
braces:
18+
min-spaces-inside: 0
19+
max-spaces-inside: 0
20+
min-spaces-inside-empty: -1
21+
max-spaces-inside-empty: -1
22+
brackets:
23+
min-spaces-inside: 0
24+
max-spaces-inside: 0
25+
min-spaces-inside-empty: -1
26+
max-spaces-inside-empty: -1
27+
colons:
28+
max-spaces-before: 0
29+
max-spaces-after: 1
30+
commas:
31+
max-spaces-before: 0
32+
min-spaces-after: 1
33+
max-spaces-after: 1
34+
comments:
35+
require-starting-space: true
36+
min-spaces-from-content: 1
37+
document-end: disable
38+
document-start: disable # No --- to start a file
39+
empty-lines:
40+
max: 2
41+
max-start: 0
42+
max-end: 0
43+
hyphens:
44+
max-spaces-after: 1
45+
indentation:
46+
spaces: consistent
47+
indent-sequences: whatever # - list indentation will handle both indentation and without
48+
check-multi-line-strings: false
49+
key-duplicates: enable
50+
line-length: disable # Lines can be any length
51+
new-line-at-end-of-file: enable
52+
new-lines:
53+
type: unix
54+
trailing-spaces: enable

.github/workflows/check-actions.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Check actions
2+
permissions: {}
3+
4+
on:
5+
push:
6+
branches:
7+
- '*'
8+
pull_request:
9+
branches:
10+
- "main"
11+
12+
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
- name: Ensure SHA pinned actions
19+
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@25ed13d0628a1601b4b44048e63cc4328ed03633 # v3.0.22
20+
with:
21+
# slsa-github-generator requires using a semver tag for reusable workflows.
22+
# See: https://github.com/slsa-framework/slsa-github-generator#referencing-slsa-builders-and-generators
23+
allowlist: |
24+
slsa-framework/slsa-github-generator

.github/workflows/check-commit.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Check Commit
2+
permissions: {}
3+
4+
on:
5+
push:
6+
branches:
7+
- "*"
8+
pull_request:
9+
branches:
10+
- "*"
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
commit_lint:
18+
runs-on: ubuntu-24.04
19+
steps:
20+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
with:
22+
fetch-depth: 0
23+
- uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed # v6.2.1

.github/workflows/check-pr.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "Check Pull Request"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
permissions:
11+
pull-requests: write
12+
13+
jobs:
14+
main:
15+
name: Validate PR title
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: amannn/action-semantic-pull-request@40166f00814508ec3201fc8595b393d451c8cd80
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
with:
22+
types: |
23+
chore
24+
ci
25+
docs
26+
feat
27+
fix
28+
test
29+
sec
30+
requireScope: false
31+
wip: false
32+
# If the PR only contains a single commit, the action will validate that
33+
# it matches the configured pattern.
34+
validateSingleCommit: true
35+
# Related to `validateSingleCommit` you can opt-in to validate that the PR
36+
# title matches a single commit to avoid confusion.
37+
validateSingleCommitMatchesPrTitle: true

.github/workflows/coverage.yml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
types:
9+
- opened
10+
- reopened
11+
- synchronize
12+
branches:
13+
- "main"
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
compliance:
21+
name: "License Compliance"
22+
runs-on: ubuntu-24.04
23+
steps:
24+
- name: "Checkout Code"
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
- name: Check secret
27+
id: checksecret
28+
uses: ./.github/actions/exists
29+
with:
30+
value: ${{ secrets.FOSSA_API_KEY }}
31+
- name: "Run FOSSA Scan"
32+
if: steps.checksecret.outputs.result == 'true'
33+
uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0
34+
with:
35+
api-key: ${{ secrets.FOSSA_API_KEY }}
36+
- name: "Run FOSSA Test"
37+
if: steps.checksecret.outputs.result == 'true'
38+
uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0
39+
with:
40+
api-key: ${{ secrets.FOSSA_API_KEY }}
41+
run-tests: true
42+
sast:
43+
name: "SAST"
44+
runs-on: ubuntu-24.04
45+
env:
46+
GO111MODULE: on
47+
permissions:
48+
security-events: write
49+
actions: read
50+
contents: read
51+
steps:
52+
- name: Checkout Source
53+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
54+
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
55+
with:
56+
go-version-file: 'go.mod'
57+
- name: Run Gosec Security Scanner
58+
uses: securego/gosec@43fee884f668c23601e0bec7a8c095fba226f889 # v2.22.1
59+
with:
60+
args: '-no-fail -fmt sarif -out gosec.sarif ./...'
61+
- name: Upload SARIF file
62+
uses: github/codeql-action/upload-sarif@1bb15d06a6fbb5d9d9ffd228746bf8ee208caec8
63+
with:
64+
sarif_file: gosec.sarif
65+
unit_tests:
66+
name: "Unit tests"
67+
runs-on: ubuntu-24.04
68+
steps:
69+
- name: Checkout
70+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
71+
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
72+
with:
73+
go-version-file: 'go.mod'
74+
- name: Unit Test
75+
run: make test
76+
- name: Check secret
77+
id: checksecret
78+
uses: ./.github/actions/exists
79+
with:
80+
value: ${{ secrets.CODECOV_TOKEN }}
81+
- name: Upload Report to Codecov
82+
if: ${{ steps.checksecret.outputs.result == 'true' }}
83+
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
84+
with:
85+
token: ${{ secrets.CODECOV_TOKEN }}
86+
slug: projectcapsule/cortex-tenant
87+
files: ./coverage.out
88+
fail_ci_if_error: true
89+
verbose: true

.github/workflows/docker-build.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build images
2+
permissions: {}
3+
on:
4+
pull_request:
5+
branches:
6+
- "*"
7+
paths:
8+
- '.github/workflows/docker-*.yml'
9+
- 'api/**'
10+
- 'internal/**'
11+
- 'e2e/*'
12+
- '.ko.yaml'
13+
- 'go.*'
14+
- 'main.go'
15+
- 'Makefile'
16+
17+
jobs:
18+
build-images:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
security-events: write
22+
actions: read
23+
contents: read
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
- name: ko build
28+
run: VERSION=${{ github.sha }} make ko-build-all
29+
- name: Trivy Scan Image
30+
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 # v0.29.0
31+
with:
32+
scan-type: 'fs'
33+
ignore-unfixed: true
34+
format: 'sarif'
35+
output: 'trivy-results.sarif'
36+
severity: 'CRITICAL,HIGH'
37+
env:
38+
# Trivy is returning TOOMANYREQUESTS
39+
# See: https://github.com/aquasecurity/trivy-action/issues/389#issuecomment-2385416577
40+
TRIVY_DB_REPOSITORY: 'public.ecr.aws/aquasecurity/trivy-db:2'
41+
- name: Upload Trivy scan results to GitHub Security tab
42+
uses: github/codeql-action/upload-sarif@1bb15d06a6fbb5d9d9ffd228746bf8ee208caec8
43+
with:
44+
sarif_file: 'trivy-results.sarif'

0 commit comments

Comments
 (0)