Skip to content

Commit 940673e

Browse files
committed
feat: initial commit
0 parents  commit 940673e

Some content is hidden

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

70 files changed

+4410
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
#### Describe the bug
11+
A clear and concise description of what the bug is.
12+
13+
#### To Reproduce
14+
Steps to reproduce the behavior:
15+
16+
#### Expected behavior
17+
A clear and concise description of what you expected to happen.
18+
19+
#### Environment
20+
- controller version: [e.g. v0.1.0]
21+
- kubernetes version: [e.g. v1.23.0]
22+
23+
#### Additional context
24+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Change request
3+
about: Propose a change for an already implemented solution
4+
title: ''
5+
labels: change
6+
assignees: ''
7+
8+
---
9+
10+
#### Describe the change
11+
A clear and concise description of what the change is about.
12+
13+
#### Current situation
14+
Describe the current situation.
15+
16+
#### Should
17+
Describe the changes you would like to propose.
18+
19+
#### Additional context
20+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: feature
6+
assignees: ''
7+
8+
---
9+
10+
#### Is your feature request related to a problem? Please describe
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
#### Describe the solution you'd like
14+
A clear and concise description of what you want to happen.
15+
16+
#### Describe alternatives you've considered
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
#### Additional context
20+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Current situation
2+
<!--- Shortly describe the current situation -->
3+
4+
## Proposal
5+
<!--- Describe what this PR is intended to achieve -->

.github/workflows/main.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: main
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
14+
- name: Setup Go
15+
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
16+
with:
17+
go-version: 1.20.x
18+
- name: Restore Go cache
19+
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
20+
with:
21+
path: ~/go/pkg/mod
22+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
23+
restore-keys: |
24+
${{ runner.os }}-go-
25+
- name: Tests
26+
run: make test
27+
- name: Send go coverage report
28+
uses: shogo82148/actions-goveralls@31ee804b8576ae49f6dc3caa22591bc5080e7920 #v1.6.0
29+
with:
30+
path-to-profile: coverage.out

.github/workflows/pr-build.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: pr-build
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
10+
jobs:
11+
e2e:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b #v3
16+
- name: Setup Go
17+
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 #v3.5.0
18+
with:
19+
go-version: 1.20.x
20+
- name: Restore Go cache
21+
uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d #v3.2.2
22+
with:
23+
path: ~/go/pkg/mod
24+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
25+
restore-keys: |
26+
${{ runner.os }}-go-
27+
- name: fmt
28+
run: make fmt
29+
- name: vet
30+
run: make vet
31+
- name: lint
32+
run: make lint
33+
- name: test
34+
run: make test
35+
- name: build
36+
run: make build
37+
- name: Send go coverage report
38+
uses: shogo82148/actions-goveralls@31ee804b8576ae49f6dc3caa22591bc5080e7920 #v1.6.0
39+
with:
40+
path-to-profile: coverage.out
41+
- name: Check if working tree is dirty
42+
run: |
43+
if [[ $(git diff --stat) != '' ]]; then
44+
git --no-pager diff
45+
echo 'run <make test> and commit changes'
46+
exit 1
47+
fi
48+
- name: Build container image
49+
run: |
50+
make docker-build
51+
- name: Setup Kubernetes
52+
uses: engineerd/setup-kind@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0 #v0.5.0
53+
with:
54+
version: v0.17.0
55+
- name: Setup Kustomize
56+
uses: imranismail/setup-kustomize@6691bdeb1b0a3286fb7f70fd1423c10e81e5375f # v2.0.0
57+
- name: Run test
58+
run: |
59+
make kind-test
60+
- name: Debug failure
61+
if: failure()
62+
run: |
63+
kubectl -n kube-system describe pods
64+
kubectl -n k8sreq-system describe pods
65+
kubectl -n k8sreq-system get all
66+
kubectl -n k8sreq-system logs deploy/k8sreq-duplicator-controller manager

.github/workflows/pr-chart.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: pr-chart
2+
3+
on: pull_request
4+
5+
jobs:
6+
lint-test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b #v3
11+
with:
12+
fetch-depth: 0
13+
14+
- name: Set up Helm
15+
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 #v3.5
16+
with:
17+
version: v3.4.0
18+
19+
- uses: actions/setup-python@5ccb29d8773c3f3f653e1705f474dfaa8a06a912 #v4.4.0
20+
with:
21+
python-version: 3.7
22+
23+
- name: Set up chart-testing
24+
uses: helm/chart-testing-action@afea100a513515fbd68b0e72a7bb0ae34cb62aec #v2.3.1
25+
26+
- name: Run chart-testing (list-changed)
27+
id: list-changed
28+
run: |
29+
changed=$(ct list-changed --target-branch=master --chart-dirs chart)
30+
if [[ -n "$changed" ]]; then
31+
echo "::set-output name=changed::true"
32+
fi
33+
34+
- name: Run chart-testing (lint)
35+
run: ct lint --target-branch=master --chart-dirs chart
36+
37+
- name: Create kind cluster
38+
uses: helm/kind-action@d8ccf8fb623ce1bb360ae2f45f323d9d5c5e9f00 #v1.5.0
39+
if: steps.list-changed.outputs.changed == 'true'
40+
41+
- name: Run chart-testing (install)
42+
run: ct install --target-branch=master --chart-dirs chart

.github/workflows/pr-label.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: pr-label
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
size-label:
8+
runs-on: ubuntu-latest
9+
if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
10+
steps:
11+
- name: size-label
12+
uses: "pascalgn/size-label-action@1619680c5ac1ef360b944bb56a57587ba4aa2af8"
13+
env:
14+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/rebase.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: rebase
2+
3+
on:
4+
pull_request:
5+
types: [opened]
6+
issue_comment:
7+
types: [created]
8+
9+
jobs:
10+
rebase:
11+
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && (github.event.comment.author_association == 'CONTRIBUTOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout the latest code
15+
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b #v3
16+
with:
17+
fetch-depth: 0
18+
- name: Automatic Rebase
19+
uses: cirrus-actions/rebase@b87d48154a87a85666003575337e27b8cd65f691 #1.8
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: release-chart
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b #v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Install Helm
18+
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 #v3.5
19+
20+
- name: Login to Github Container Registry using helm
21+
run: echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin
22+
23+
- name: Package helm charts
24+
run: |
25+
helm package chart/k8sreq-duplicator-controller -d chart
26+
27+
- name: Publish helm charts to Github Container Registry
28+
run: |
29+
repository=$(echo "${{ github.repository_owner }}" | tr [:upper:] [:lower:])
30+
helm push ${{ github.workspace }}/chart/k8sreq-duplicator-controller-*.tgz oci://ghcr.io/$repository/charts

0 commit comments

Comments
 (0)