Skip to content

Commit 1802c77

Browse files
authored
feat: update olm deps and ci (#21)
* feat: update olm deps * chore: update ignorefile * ci: udpate gh action
1 parent 12b2edc commit 1802c77

File tree

5 files changed

+76
-197
lines changed

5 files changed

+76
-197
lines changed

.dockerignore

+4-47
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@
33
bin/
44
testbin/
55
### VisualStudioCode template
6-
.vscode/*
7-
!.vscode/settings.json
8-
!.vscode/tasks.json
9-
!.vscode/launch.json
10-
!.vscode/extensions.json
11-
!.vscode/*.code-snippets
6+
.vscode
127

138
# Local History for Visual Studio Code
149
.history/
@@ -17,47 +12,7 @@ testbin/
1712
*.vsix
1813

1914
### JetBrains template
20-
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
21-
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
22-
23-
# User-specific stuff
24-
.idea/**/workspace.xml
25-
.idea/**/tasks.xml
26-
.idea/**/usage.statistics.xml
27-
.idea/**/dictionaries
28-
.idea/**/shelf
29-
30-
# AWS User-specific
31-
.idea/**/aws.xml
32-
33-
# Generated files
34-
.idea/**/contentModel.xml
35-
36-
# Sensitive or high-churn files
37-
.idea/**/dataSources/
38-
.idea/**/dataSources.ids
39-
.idea/**/dataSources.local.xml
40-
.idea/**/sqlDataSources.xml
41-
.idea/**/dynamic.xml
42-
.idea/**/uiDesigner.xml
43-
.idea/**/dbnavigator.xml
44-
45-
# Gradle
46-
.idea/**/gradle.xml
47-
.idea/**/libraries
48-
49-
# Gradle and Maven with auto-import
50-
# When using Gradle or Maven with auto-import, you should exclude module files,
51-
# since they will be recreated, and may cause churn. Uncomment if using
52-
# auto-import.
53-
# .idea/artifacts
54-
# .idea/compiler.xml
55-
# .idea/jarRepositories.xml
56-
# .idea/modules.xml
57-
# .idea/*.iml
58-
# .idea/modules
59-
# *.iml
60-
# *.ipr
15+
.idea
6116

6217
# CMake
6318
cmake-build-*/
@@ -164,3 +119,5 @@ Network Trash Folder
164119
Temporary Items
165120
.apdisk
166121

122+
bundle
123+
bundle.Dockerfile

.github/workflows/ci.yml

+64-96
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,78 @@
1-
# 定义工作流的名称
21
name: CI
32

4-
on:
5-
workflow_dispatch: # 允许手动触发工作流
6-
push: # 当有代码推送事件发生时
7-
branches:
8-
- main # 只有推送到 main 分支时才触发
9-
tags:
10-
- '*'
11-
pull_request:
3+
on: ['push', 'pull_request']
124

13-
14-
# 定义工作流的任务
155
jobs:
16-
build:
17-
# 定义运行此任务的环境:最新版本的 ubuntu
18-
runs-on: ubuntu-latest
19-
20-
# 定义任务中的步骤
6+
test:
7+
runs-on: ubuntu-22.04
8+
strategy:
9+
matrix:
10+
go-version: ['1.20', '1.21.x']
2111
steps:
22-
# 检出代码。只检出最新的1次提交
23-
- uses: actions/checkout@v3
24-
with:
25-
fetch-depth: 1
26-
27-
# 设置 QEMU 模拟器,这通常用于多平台的 Docker 构建
28-
- name: Set up QEMU
29-
uses: docker/setup-qemu-action@v2
12+
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 1
15+
- uses: actions/checkout@v4
16+
- name: Setup Go ${{ matrix.go-version }}
17+
uses: actions/setup-go@v4
18+
with:
19+
go-version: ${{ matrix.go-version }}
20+
- name: Display Go version
21+
run: go version
22+
- name: Install dependencies
23+
run: go get ./...
24+
- name: Test with Go
25+
run: go test ./... -json > TestResults-${{ matrix.go-version }}.json
26+
- name: Upload Go test results
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: Go-results-${{ matrix.go-version }}
30+
path: TestResults-${{ matrix.go-version }}.json
3031

31-
# 设置 Docker Buildx,用于构建多平台的 Docker 镜像
32-
- name: Set up Build
33-
uses: docker/setup-buildx-action@v2
34-
- run: |
35-
make build
36-
3732
linting:
3833
name: Lint Code Base
39-
runs-on: ubuntu-latest
34+
runs-on: ubuntu-22.04
4035
steps:
41-
- name: Checkout Code
42-
uses: actions/checkout@v3
43-
with:
44-
# Full git history is needed to get a proper list of changed files within `super-linter`
45-
fetch-depth: 0
46-
- name: Lint Code Base
47-
uses: github/super-linter@v4
48-
env:
49-
VALIDATE_MARKDOWN: true
50-
VALIDATE_ALL_CODEBASE: false
51-
DEFAULT_BRANCH: main
52-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Checkout Code
37+
uses: actions/checkout@v3
38+
with:
39+
fetch-depth: 0
40+
- name: Lint Code Base
41+
uses: github/super-linter@v4
42+
env:
43+
VALIDATE_MARKDOWN: true
44+
VALIDATE_ALL_CODEBASE: false
45+
DEFAULT_BRANCH: main
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
LINTER_RULES_PATH: /
48+
MARKDOWN_CONFIG_FILE: .markdownlint.yml
5349

54-
LINTER_RULES_PATH: /
55-
MARKDOWN_CONFIG_FILE: .markdownlint.yml
56-
57-
main:
58-
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'zncdata-labs/hive-metastore-operator'
59-
runs-on: ubuntu-latest
50+
deploy-quay:
51+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'zncdata-labs/spark-k8s-operator'
52+
runs-on: ubuntu-22.04
6053
needs:
61-
- build
62-
- linting
63-
64-
steps:
65-
# 检出代码。只检出最新的1次提交
66-
- uses: actions/checkout@v3
67-
with:
68-
fetch-depth: 1
69-
70-
# 登录到 QUAY Hub
71-
- name: Login to quay.io
72-
uses: docker/login-action@v2
73-
with:
74-
registry: quay.io
75-
username: ${{ secrets.QUAY_USERNAME }} # 使用存储在 GitHub Secrets 中的 QUAY 用户名
76-
password: ${{ secrets.QUAY_PASSWORD }} # 使用存储在 GitHub Secrets 中的 QUAY 密码
77-
78-
- name: Build and push Docker image
79-
run: |
80-
make docker-buildx
81-
make bundle
82-
make bundle-buildx
83-
84-
tags:
85-
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'zncdata-labs/hive-metastore-operator'
86-
runs-on: ubuntu-latest
87-
needs:
88-
- build
89-
- linting
90-
54+
- test
55+
- linting
9156
steps:
92-
# 检出代码。只检出最新的1次提交
93-
- uses: actions/checkout@v3
94-
with:
95-
fetch-depth: 1
57+
- uses: actions/checkout@v3
58+
with:
59+
fetch-depth: 1
60+
- name: Set up QEMU
61+
uses: docker/setup-qemu-action@v3
62+
- name: Set up Docker Buildx
63+
uses: docker/setup-buildx-action@v3
64+
- name: Login to quay.io
65+
uses: docker/login-action@v2
66+
with:
67+
registry: quay.io
68+
username: ${{ secrets.QUAY_USERNAME }}
69+
password: ${{ secrets.QUAY_PASSWORD }}
9670

97-
# 登录到 QUAY Hub
98-
- name: Login to quay.io
99-
uses: docker/login-action@v2
100-
with:
101-
registry: quay.io
102-
username: ${{ secrets.QUAY_USERNAME }} # 使用存储在 GitHub Secrets 中的 QUAY 用户名
103-
password: ${{ secrets.QUAY_PASSWORD }} # 使用存储在 GitHub Secrets 中的 QUAY 密码
71+
- name: Build and push operator
72+
run: |
73+
make docker-buildx
10474
105-
- name: Build and push Docker image
106-
run: |
107-
export VERSION=$GITHUB_REF_NAME
108-
make docker-buildx
109-
make bundle
110-
make bundle-buildx
75+
- name: Build and push operator bundle
76+
run: |
77+
make bundle
78+
make bundle-buildx

.gitignore

+5-51
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,9 @@ Dockerfile.cross
2424
*.swp
2525
*.swo
2626
*~
27-
.vscode### VisualStudioCode template
28-
.vscode/*
29-
!.vscode/settings.json
30-
!.vscode/tasks.json
31-
!.vscode/launch.json
32-
!.vscode/extensions.json
33-
!.vscode/*.code-snippets
27+
28+
### VisualStudioCode template
29+
.vscode
3430

3531
# Local History for Visual Studio Code
3632
.history/
@@ -39,47 +35,7 @@ Dockerfile.cross
3935
*.vsix
4036

4137
### JetBrains template
42-
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
43-
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
44-
45-
# User-specific stuff
46-
.idea/**/workspace.xml
47-
.idea/**/tasks.xml
48-
.idea/**/usage.statistics.xml
49-
.idea/**/dictionaries
50-
.idea/**/shelf
51-
52-
# AWS User-specific
53-
.idea/**/aws.xml
54-
55-
# Generated files
56-
.idea/**/contentModel.xml
57-
58-
# Sensitive or high-churn files
59-
.idea/**/dataSources/
60-
.idea/**/dataSources.ids
61-
.idea/**/dataSources.local.xml
62-
.idea/**/sqlDataSources.xml
63-
.idea/**/dynamic.xml
64-
.idea/**/uiDesigner.xml
65-
.idea/**/dbnavigator.xml
66-
67-
# Gradle
68-
.idea/**/gradle.xml
69-
.idea/**/libraries
70-
71-
# Gradle and Maven with auto-import
72-
# When using Gradle or Maven with auto-import, you should exclude module files,
73-
# since they will be recreated, and may cause churn. Uncomment if using
74-
# auto-import.
75-
# .idea/artifacts
76-
# .idea/compiler.xml
77-
# .idea/jarRepositories.xml
78-
# .idea/modules.xml
79-
# .idea/*.iml
80-
# .idea/modules
81-
# *.iml
82-
# *.ipr
38+
.idea
8339

8440
# CMake
8541
cmake-build-*/
@@ -186,8 +142,6 @@ Network Trash Folder
186142
Temporary Items
187143
.apdisk
188144

189-
.vscode
190-
191-
# operator
145+
# olm
192146
bundle
193147
bundle.Dockerfile

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ endif
5050

5151
# Set the Operator SDK version to use. By default, what is installed on the system is used.
5252
# This is useful for CI or a project to utilize a specific version of the operator-sdk toolkit.
53-
OPERATOR_SDK_VERSION ?= v1.31.0
53+
OPERATOR_SDK_VERSION ?= v1.33.0
5454

5555
# Image URL to use all building/pushing image targets
5656
IMG ?= $(REGISTRY)/hive-metastore-operator:$(VERSION)
@@ -185,7 +185,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
185185
ENVTEST ?= $(LOCALBIN)/setup-envtest
186186

187187
## Tool Versions
188-
KUSTOMIZE_VERSION ?= v5.2.1
188+
KUSTOMIZE_VERSION ?= v5.3.0
189189
CONTROLLER_TOOLS_VERSION ?= v0.13.0
190190

191191
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"

PROJECT

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# More info: https://book.kubebuilder.io/reference/project-config.html
55
domain: zncdata.net
66
layout:
7-
- go.kubebuilder.io/v4-alpha
7+
- go.kubebuilder.io/v4
88
plugins:
99
manifests.sdk.operatorframework.io/v2: {}
1010
scorecard.sdk.operatorframework.io/v2: {}

0 commit comments

Comments
 (0)