Skip to content

Commit 7e47a67

Browse files
Eneman DonatienDonatien26
authored andcommitted
refacto + update dependencies
1 parent 7ef9253 commit 7e47a67

File tree

120 files changed

+8434
-6111
lines changed

Some content is hidden

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

120 files changed

+8434
-6111
lines changed

.dockerignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2-
# Ignore build and test binaries.
3-
bin/
4-
testbin/
1+
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2+
# Ignore build and test binaries.
3+
bin/
4+
testbin/

.github/workflows/ci-chart.yaml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
name: Release Helm
2-
3-
on:
4-
push:
5-
branches:
6-
- main
7-
8-
jobs:
9-
release_helm:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v4
14-
15-
- name: Install Helm on Runner
16-
uses: azure/[email protected]
17-
18-
- name: Lint Chart
19-
run: helm lint .
20-
21-
- name: Configure Git
22-
run: |
23-
git config user.name "$GITHUB_ACTOR"
24-
git config user.email "[email protected]"
25-
26-
- name: Run chart-releaser
27-
uses: helm/[email protected]
28-
with:
29-
charts_dir: deploy/charts
30-
skip_existing: true
31-
env:
32-
CR_TOKEN: "${{ secrets.CR_TOKEN }}"
1+
name: Release Helm
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release_helm:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Install Helm on Runner
16+
uses: azure/[email protected]
17+
18+
- name: Lint Chart
19+
run: helm lint .
20+
21+
- name: Configure Git
22+
run: |
23+
git config user.name "$GITHUB_ACTOR"
24+
git config user.email "[email protected]"
25+
26+
- name: Run chart-releaser
27+
uses: helm/[email protected]
28+
with:
29+
charts_dir: deploy/charts
30+
skip_existing: true
31+
env:
32+
CR_TOKEN: "${{ secrets.CR_TOKEN }}"

.github/workflows/ci.yaml

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
name: build
2-
3-
on: [push]
4-
5-
jobs:
6-
build:
7-
outputs:
8-
version: ${{ steps.get_version.outputs.VERSION }}
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Checkout code
12-
uses: actions/checkout@v4
13-
14-
- name: Docker meta
15-
id: docker_meta
16-
uses: crazy-max/[email protected]
17-
with:
18-
images: inseefrlab/s3-operator # list of Docker images to use as base name for tags
19-
20-
- name: Set up QEMU
21-
uses: docker/setup-qemu-action@v3
22-
23-
- name: Set up Docker Buildx
24-
uses: docker/setup-buildx-action@v3
25-
26-
- name: Login to DockerHub
27-
if: github.event_name != 'pull_request'
28-
uses: docker/login-action@v3
29-
with:
30-
username: ${{ secrets.DOCKERHUB_USERNAME }}
31-
password: ${{ secrets.DOCKERHUB_TOKEN }}
32-
33-
- name: Build and push
34-
uses: docker/build-push-action@v5
35-
with:
36-
context: .
37-
file: ./Dockerfile
38-
push: ${{ github.event_name != 'pull_request' }}
39-
# Use tags computed before and also latest if on master
40-
tags: |
41-
${{ steps.docker_meta.outputs.tags }}
42-
${{ github.ref == 'refs/heads/main' && 'inseefrlab/s3-operator:latest' || '' }}
43-
labels: ${{ steps.docker_meta.outputs.labels }}
44-
platforms: linux/amd64,linux/arm64
45-
46-
- name: Image digest
47-
run: echo ${{ steps.docker_build.outputs.digest }}
1+
name: build
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
outputs:
8+
version: ${{ steps.get_version.outputs.VERSION }}
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Docker meta
15+
id: docker_meta
16+
uses: crazy-max/[email protected]
17+
with:
18+
images: inseefrlab/s3-operator # list of Docker images to use as base name for tags
19+
20+
- name: Set up QEMU
21+
uses: docker/setup-qemu-action@v3
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
26+
- name: Login to DockerHub
27+
if: github.event_name != 'pull_request'
28+
uses: docker/login-action@v3
29+
with:
30+
username: ${{ secrets.DOCKERHUB_USERNAME }}
31+
password: ${{ secrets.DOCKERHUB_TOKEN }}
32+
33+
- name: Build and push
34+
uses: docker/build-push-action@v5
35+
with:
36+
context: .
37+
file: ./Dockerfile
38+
push: ${{ github.event_name != 'pull_request' }}
39+
# Use tags computed before and also latest if on master
40+
tags: |
41+
${{ steps.docker_meta.outputs.tags }}
42+
${{ github.ref == 'refs/heads/main' && 'inseefrlab/s3-operator:latest' || '' }}
43+
labels: ${{ steps.docker_meta.outputs.labels }}
44+
platforms: linux/amd64,linux/arm64
45+
46+
- name: Image digest
47+
run: echo ${{ steps.docker_build.outputs.digest }}

.gitignore

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
1-
2-
# Binaries for programs and plugins
3-
*.exe
4-
*.exe~
5-
*.dll
6-
*.so
7-
*.dylib
8-
bin
9-
testbin/*
10-
Dockerfile.cross
11-
12-
# Test binary, build with `go test -c`
13-
*.test
14-
15-
# Output of the go coverage tool, specifically when used with LiteIDE
16-
*.out
17-
18-
# Kubernetes Generated files - skip generated files, except for vendored files
19-
20-
!vendor/**/zz_generated.*
21-
22-
# editor and IDE paraphernalia
23-
.idea
24-
*.swp
25-
*.swo
26-
*~
27-
.vscode
1+
2+
# Binaries for programs and plugins
3+
*.exe
4+
*.exe~
5+
*.dll
6+
*.so
7+
*.dylib
8+
bin
9+
testbin/*
10+
Dockerfile.cross
11+
12+
# Test binary, build with `go test -c`
13+
*.test
14+
15+
# Output of the go coverage tool, specifically when used with LiteIDE
16+
*.out
17+
18+
# Kubernetes Generated files - skip generated files, except for vendored files
19+
20+
!vendor/**/zz_generated.*
21+
22+
# editor and IDE paraphernalia
23+
.idea
24+
*.swp
25+
*.swo
26+
*~
27+
.vscode
28+
29+
values-local.yaml

Dockerfile

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
# Build the manager binary
2-
FROM golang:1.22 as builder
3-
ARG TARGETOS
4-
ARG TARGETARCH
5-
6-
WORKDIR /workspace
7-
# Copy the Go Modules manifests
8-
COPY go.mod go.mod
9-
COPY go.sum go.sum
10-
# cache deps before building and copying source so that we don't need to re-download as much
11-
# and so that source changes don't invalidate our downloaded layer
12-
RUN go mod download
13-
14-
# Copy the go source
15-
COPY main.go main.go
16-
COPY api/ api/
17-
COPY controllers/ controllers/
18-
COPY internal/ internal/
19-
20-
21-
# Build
22-
# the GOARCH has not a default value to allow the binary be built according to the host where the command
23-
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
24-
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
25-
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
26-
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager main.go
27-
28-
# Use distroless as minimal base image to package the manager binary
29-
# Refer to https://github.com/GoogleContainerTools/distroless for more details
30-
FROM gcr.io/distroless/static:nonroot
31-
WORKDIR /
32-
COPY --from=builder /workspace/manager .
33-
USER 65532:65532
34-
35-
ENTRYPOINT ["/manager"]
1+
# Build the manager binary
2+
FROM golang:1.23 as builder
3+
ARG TARGETOS
4+
ARG TARGETARCH
5+
6+
WORKDIR /workspace
7+
# Copy the Go Modules manifests
8+
COPY go.mod go.mod
9+
COPY go.sum go.sum
10+
# cache deps before building and copying source so that we don't need to re-download as much
11+
# and so that source changes don't invalidate our downloaded layer
12+
RUN go mod download
13+
14+
# Copy the go source
15+
COPY cmd/main.go main.go
16+
COPY api/ api/
17+
COPY controllers/ controllers/
18+
COPY internal/ internal/
19+
20+
21+
# Build
22+
# the GOARCH has not a default value to allow the binary be built according to the host where the command
23+
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
24+
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
25+
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
26+
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager main.go
27+
28+
# Use distroless as minimal base image to package the manager binary
29+
# Refer to https://github.com/GoogleContainerTools/distroless for more details
30+
FROM gcr.io/distroless/static:nonroot
31+
WORKDIR /
32+
COPY --from=builder /workspace/manager .
33+
USER 65532:65532
34+
35+
ENTRYPOINT ["/manager"]

LICENSE

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
MIT License
2-
3-
Copyright (c) 2023 InseeFrLab
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
1+
MIT License
2+
3+
Copyright (c) 2023 InseeFrLab
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)