Skip to content

Commit 7545627

Browse files
Merge branch 'master' into f-min-ready-seconds
2 parents 285f63e + 0dddaea commit 7545627

File tree

475 files changed

+81521
-7643
lines changed

Some content is hidden

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

475 files changed

+81521
-7643
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: shubham-cmyk drivebyer

.github/cherry-pick-bot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
enabled: true
2+
preservePullRequestTitle: true

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: /
5+
schedule:
6+
interval: daily
7+
- package-ecosystem: github-actions
8+
directory: /
9+
schedule:
10+
interval: daily

.github/workflows/ci.yaml

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
push:
7+
branches:
8+
- master
9+
10+
permissions:
11+
contents: read
12+
13+
env:
14+
GOLANG_VERSION: 1.21
15+
APPLICATION_NAME: redis-operator
16+
DockerImagName: docker.io/opstree/redis-operator
17+
BuildDocs: true
18+
AppVersion: "v0.15.2"
19+
DOCKERFILE_PATH: "**/Dockerfile"
20+
21+
jobs:
22+
gotest:
23+
name: Go Test
24+
runs-on: ubuntu-latest
25+
needs:
26+
- lint
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Set up Go
30+
uses: actions/setup-go@v5
31+
with:
32+
go-version: ${{ env.GOLANG_VERSION }}
33+
- name: Install integration test dependencies
34+
run: make integration-test-setup
35+
- name: Run Go Tests with coverage
36+
run: go test ./... -coverprofile=coverage.txt -covermode=atomic
37+
- name: Upload coverage to Codecov
38+
uses: codecov/codecov-action@v4
39+
with:
40+
file: ./coverage.txt
41+
fail_ci_if_error: false
42+
verbose: true
43+
44+
lint:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
- name: Set up Go
49+
uses: actions/setup-go@v5
50+
with:
51+
go-version: ${{ env.GOLANG_VERSION }}
52+
cache: false
53+
54+
- name: Run GolangCI-Lint
55+
uses: golangci/golangci-lint-action@v6
56+
with:
57+
version: v1.54.0
58+
59+
container_quality_dockerfile_lint:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Checkout code
63+
uses: actions/checkout@v4
64+
65+
- name: Execute dockerlinter
66+
uses: hadolint/hadolint-action@v3.1.0
67+
with:
68+
dockerfile: Dockerfile
69+
ignore: DL3007,DL3018
70+
71+
build_go_binary:
72+
needs: [lint]
73+
runs-on: ubuntu-latest
74+
strategy:
75+
matrix:
76+
arch: ["amd64", "arm64"]
77+
steps:
78+
- name: Checkout Code
79+
uses: actions/checkout@v4
80+
- name: Setup Go Environment
81+
uses: actions/setup-go@v5
82+
with:
83+
go-version: ${{ env.GOLANG_VERSION }}
84+
- name: Set GOARCH
85+
run: echo "GOARCH=${{ matrix.arch }}" >> $GITHUB_ENV
86+
- name: Build Go Binary
87+
run: go build -o ${{ github.workspace }}/${{ env.APPLICATION_NAME }}
88+
- name: Archive Binary
89+
run: |
90+
mkdir -p ${{ github.workspace }}/compiled/${{ matrix.arch }}
91+
zip ${{ github.workspace }}/compiled/${{ matrix.arch }}/${{ env.APPLICATION_NAME }}-${{ matrix.arch }}.zip ${{ github.workspace }}/${{ env.APPLICATION_NAME }}
92+
build_scan_container_image:
93+
needs: [container_quality_dockerfile_lint]
94+
runs-on: ubuntu-latest
95+
steps:
96+
- name: Checkout
97+
uses: actions/checkout@v4
98+
99+
- name: Set up Docker Buildx
100+
uses: docker/setup-buildx-action@v3
101+
102+
- name: Build multi-arch image
103+
uses: docker/build-push-action@v6
104+
with:
105+
context: .
106+
platforms: linux/arm64,linux/amd64
107+
push: false
108+
tags: ${{ env.DockerImagName }}:latest
109+
110+
gosec_scan:
111+
needs: [build_go_binary]
112+
runs-on: ubuntu-latest
113+
114+
steps:
115+
- name: Checkout Code
116+
uses: actions/checkout@v4
117+
- name: Gosec Scan
118+
uses: securego/gosec@master
119+
with:
120+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121+
122+
GOSEC_OUTPUT: "junit-xml:/github/workspace/gosec-results.xml"
123+
124+
validate-yaml:
125+
name: Validate YAML
126+
runs-on: ubuntu-latest
127+
needs:
128+
- gotest
129+
steps:
130+
- name: Checkout code
131+
uses: actions/checkout@v4
132+
- name: Install yamllint
133+
run: sudo apt-get install -y yamllint
134+
- name: Lint YAML files
135+
run: yamllint --strict ./tests/
136+
137+
e2e-test:
138+
needs: [validate-yaml]
139+
name: ${{ matrix.testpath }}
140+
runs-on: ubuntu-latest
141+
strategy:
142+
matrix:
143+
testpath:
144+
- ./tests/e2e-chainsaw/v1beta2/teardown/
145+
- ./tests/e2e-chainsaw/v1beta2/setup/
146+
- ./tests/e2e-chainsaw/v1beta2/hostnetwork/
147+
- ./tests/e2e-chainsaw/v1beta2/password/
148+
- ./tests/e2e-chainsaw/v1beta2/ha-setup/
149+
- ./tests/e2e-chainsaw/v1beta2/ha-failover/
150+
- ./tests/e2e-chainsaw/v1beta2/nodeport/
151+
- ./tests/e2e-chainsaw/v1beta2/pvc-name/
152+
- ./tests/e2e-chainsaw/v1beta2/keep-pvc/
153+
- ./tests/e2e-chainsaw/v1beta2/acl-user/
154+
- ./tests/e2e-chainsaw/v1beta2/scaling/
155+
- ./tests/e2e-chainsaw/v1beta2/ignore-annots/
156+
157+
steps:
158+
- name: Checkout code
159+
uses: actions/checkout@v4
160+
161+
- name: Build Dockerfile
162+
run: docker build . --file Dockerfile --tag redis-operator:e2e
163+
164+
- name: Install chainsaw
165+
uses: kyverno/chainsaw/.github/actions/install@v0.0.9
166+
with:
167+
release: v0.1.7
168+
169+
- name: Check install
170+
run: chainsaw version
171+
172+
- name: Install kubectl
173+
run: |
174+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
175+
chmod +x kubectl
176+
sudo mv kubectl /usr/local/bin/
177+
178+
# - name: Install Redis
179+
# uses: shogo82148/actions-setup-redis@v1
180+
181+
- name: Create k8s Kind Cluster
182+
uses: helm/kind-action@v1.10.0
183+
with:
184+
config: tests/_config/kind-config.yaml
185+
cluster_name: kind
186+
187+
- name: Load Docker image into Kind
188+
run: |
189+
kubectl cluster-info --context kind-kind
190+
kind load docker-image redis-operator:e2e --name kind
191+
192+
- name: Install Redis Operator
193+
run: |
194+
make deploy IMG=redis-operator:e2e
195+
196+
- name: Wait for Redis Operator to be ready
197+
run: |
198+
kubectl wait --for=condition=available --timeout=300s deployment/redis-operator-redis-operator -n redis-operator-system
199+
200+
- name: Run chainsaw test
201+
run: chainsaw test --test-dir ${{ matrix.testpath }} --config tests/_config/chainsaw-configuration.yaml

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ jobs:
3939

4040
steps:
4141
- name: Checkout repository
42-
uses: actions/checkout@v2
42+
uses: actions/checkout@v4
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v1
46+
uses: github/codeql-action/init@v3
4747
with:
4848
languages: ${{ matrix.language }}
4949
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -54,7 +54,7 @@ jobs:
5454
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5555
# If this step fails, then you should remove it and run the build manually (see below)
5656
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v1
57+
uses: github/codeql-action/autobuild@v3
5858

5959
# ℹ️ Command-line programs to run using the OS shell.
6060
# 📚 https://git.io/JvXDl
@@ -68,4 +68,4 @@ jobs:
6868
# make release
6969

7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v1
71+
uses: github/codeql-action/analyze@v3

.github/workflows/operator-ci.yaml

Lines changed: 0 additions & 129 deletions
This file was deleted.

0 commit comments

Comments
 (0)