Skip to content

Commit cb1921b

Browse files
committed
chore: upgrade with esv1 api group
Signed-off-by: Sn0rt <wangguohao.2009@gmail.com>
1 parent d997aee commit cb1921b

Some content is hidden

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

53 files changed

+3475
-990
lines changed

.github/workflows/ci.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ on:
88
pull_request: {}
99

1010
env:
11-
ENV: 'TEST'
11+
ENV: "TEST"
1212

1313
jobs:
1414
detect-noop:
1515
permissions:
16-
actions: write # for fkirc/skip-duplicate-actions to skip or stop workflow runs
17-
contents: read # for fkirc/skip-duplicate-actions to read and compare commits
16+
actions: write # for fkirc/skip-duplicate-actions to skip or stop workflow runs
17+
contents: read # for fkirc/skip-duplicate-actions to read and compare commits
1818
runs-on: ubuntu-latest
1919
outputs:
2020
noop: ${{ steps.noop.outputs.should_skip }}
@@ -30,8 +30,8 @@ jobs:
3030

3131
lint:
3232
permissions:
33-
contents: read # for actions/checkout to fetch code
34-
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
33+
contents: read # for actions/checkout to fetch code
34+
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
3535
runs-on: ubuntu-latest
3636
needs: detect-noop
3737
if: needs.detect-noop.outputs.noop != 'true' && github.ref != 'refs/heads/main'
@@ -54,6 +54,7 @@ jobs:
5454
uses: golangci/golangci-lint-action@v6
5555
with:
5656
skip-cache: true
57+
args: --timeout=5m
5758

5859
unit-tests:
5960
runs-on: ubuntu-latest
@@ -93,4 +94,4 @@ jobs:
9394
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
9495
with:
9596
flags: unittests
96-
file: ./cover.out
97+
file: ./cover.out

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
tags:
6-
- 'v*'
6+
- "v*"
77

88
jobs:
99
docker:
@@ -88,7 +88,7 @@ jobs:
8888
- name: Set up Go
8989
uses: actions/setup-go@v2
9090
with:
91-
go-version: '1.22.5'
91+
go-version: "1.24.5"
9292

9393
- name: Set build variables
9494
id: vars

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ go.work
2828
secret2es
2929
secret2es-server
3030
/vendor
31-
31+
.claude
3232
.vercel

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM golang:1.23 AS go-builder
2+
FROM golang:1.24.5 AS go-builder
33

44
# Set the working directory
55
WORKDIR /go/src/github.com/sn0rt/secret2es
@@ -19,11 +19,11 @@ ARG BUILD_TIME
1919

2020
# Build the application
2121
RUN CGO_ENABLED=0 GOOS=linux go build -v -o secret2es \
22-
-ldflags "-X main.version=${VERSION} -X main.buildTime=${BUILD_TIME}" \
23-
cmd/cli/main.go
22+
-ldflags "-X main.version=${VERSION} -X main.buildTime=${BUILD_TIME}" \
23+
cmd/cli/main.go
2424
RUN CGO_ENABLED=0 GOOS=linux go build -v -o secret2es-server \
25-
-ldflags "-X main.version=${VERSION} -X main.buildTime=${BUILD_TIME}" \
26-
cmd/server/main.go cmd/server/convert.go
25+
-ldflags "-X main.version=${VERSION} -X main.buildTime=${BUILD_TIME}" \
26+
cmd/server/main.go cmd/server/convert.go
2727

2828
FROM node:18-alpine AS base
2929

cmd/cli/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package main
22

33
import (
44
"fmt"
5-
esv1beta1 "github.com/external-secrets/external-secrets/apis/externalsecrets/v1beta1"
5+
esv1 "github.com/external-secrets/external-secrets/apis/externalsecrets/v1"
66
"os"
77

88
"github.com/spf13/cobra"
@@ -66,7 +66,7 @@ func extSecretGenCmd() *cobra.Command {
6666
return err
6767
}
6868

69-
err = converter.ConvertSecret(inputPath, storeType, storeName, esv1beta1.ExternalSecretCreationPolicy(creationPolicy), resolve)
69+
err = converter.ConvertSecret(inputPath, storeType, storeName, esv1.ExternalSecretCreationPolicy(creationPolicy), resolve)
7070
if err != nil {
7171
return err
7272
}

cmd/server/convert.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"net/http"
1212
"strings"
1313

14-
esv1beta1 "github.com/external-secrets/external-secrets/apis/externalsecrets/v1beta1"
14+
esv1 "github.com/external-secrets/external-secrets/apis/externalsecrets/v1"
1515

1616
"github.com/Sn0rt/secret2es/pkg/converter"
1717
)
@@ -75,13 +75,18 @@ func Handler(w http.ResponseWriter, r *http.Request) {
7575
[]byte(request.Content),
7676
request.StoreType,
7777
request.StoreName,
78-
esv1beta1.ExternalSecretCreationPolicy(request.CreationPolicy),
78+
esv1.ExternalSecretCreationPolicy(request.CreationPolicy),
7979
request.Resolve,
8080
request.EnvVars,
8181
)
8282

8383
if err != nil {
84-
http.Error(w, "Conversion error: "+err.Error(), http.StatusInternalServerError)
84+
errorResponse := map[string]string{
85+
"error": "Conversion error: " + err.Error(),
86+
}
87+
w.Header().Set("Content-Type", "application/json")
88+
w.WriteHeader(http.StatusInternalServerError)
89+
_ = json.NewEncoder(w).Encode(errorResponse)
8590
return
8691
}
8792

e2e/css_approle1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: external-secrets.io/v1beta1
1+
apiVersion: external-secrets.io/v1
22
kind: ClusterSecretStore
33
metadata:
44
name: tenant-approle1

e2e/css_root.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: external-secrets.io/v1beta1
1+
apiVersion: external-secrets.io/v1
22
kind: ClusterSecretStore
33
metadata:
44
name: tenant-b

go.mod

Lines changed: 43 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,69 @@
11
module github.com/Sn0rt/secret2es
22

3-
go 1.23.0
3+
go 1.24.4
44

5-
toolchain go1.24.0
5+
toolchain go1.24.5
66

77
require (
8-
github.com/external-secrets/external-secrets v0.10.2
9-
github.com/gin-gonic/gin v1.10.0
10-
github.com/google/go-cmp v0.6.0
8+
github.com/external-secrets/external-secrets v0.18.2
9+
github.com/google/go-cmp v0.7.0
1110
github.com/pkg/errors v0.9.1
12-
github.com/spf13/cobra v1.8.1
13-
k8s.io/api v0.31.0
14-
k8s.io/apimachinery v0.31.0
15-
sigs.k8s.io/yaml v1.4.0
11+
github.com/spf13/cobra v1.9.1
12+
k8s.io/api v0.33.2
13+
k8s.io/apimachinery v0.33.2
14+
sigs.k8s.io/yaml v1.5.0
1615
)
1716

1817
require (
1918
github.com/beorn7/perks v1.0.1 // indirect
20-
github.com/bytedance/sonic v1.11.6 // indirect
21-
github.com/bytedance/sonic/loader v0.1.1 // indirect
2219
github.com/cespare/xxhash/v2 v2.3.0 // indirect
23-
github.com/cloudwego/base64x v0.1.4 // indirect
24-
github.com/cloudwego/iasm v0.2.0 // indirect
2520
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
26-
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
27-
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
28-
github.com/fsnotify/fsnotify v1.7.0 // indirect
29-
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
30-
github.com/gabriel-vasile/mimetype v1.4.5 // indirect
31-
github.com/gin-contrib/sse v0.1.0 // indirect
32-
github.com/go-logr/logr v1.4.2 // indirect
33-
github.com/go-openapi/jsonpointer v0.21.0 // indirect
21+
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
22+
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
23+
github.com/fsnotify/fsnotify v1.9.0 // indirect
24+
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
25+
github.com/go-logr/logr v1.4.3 // indirect
26+
github.com/go-openapi/jsonpointer v0.21.1 // indirect
3427
github.com/go-openapi/jsonreference v0.21.0 // indirect
35-
github.com/go-openapi/swag v0.23.0 // indirect
36-
github.com/go-playground/locales v0.14.1 // indirect
37-
github.com/go-playground/universal-translator v0.18.1 // indirect
38-
github.com/go-playground/validator/v10 v10.22.0 // indirect
39-
github.com/goccy/go-json v0.10.3 // indirect
28+
github.com/go-openapi/swag v0.23.1 // indirect
4029
github.com/gogo/protobuf v1.3.2 // indirect
41-
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
42-
github.com/golang/protobuf v1.5.4 // indirect
43-
github.com/google/gnostic-models v0.6.8 // indirect
44-
github.com/google/gofuzz v1.2.0 // indirect
30+
github.com/google/btree v1.1.3 // indirect
31+
github.com/google/gnostic-models v0.7.0 // indirect
4532
github.com/google/uuid v1.6.0 // indirect
46-
github.com/imdario/mergo v0.3.16 // indirect
4733
github.com/inconshreveable/mousetrap v1.1.0 // indirect
4834
github.com/josharian/intern v1.0.0 // indirect
4935
github.com/json-iterator/go v1.1.12 // indirect
50-
github.com/klauspost/compress v1.17.9 // indirect
51-
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
52-
github.com/leodido/go-urn v1.4.0 // indirect
53-
github.com/mailru/easyjson v0.7.7 // indirect
54-
github.com/mattn/go-isatty v0.0.20 // indirect
36+
github.com/mailru/easyjson v0.9.0 // indirect
5537
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
5638
github.com/modern-go/reflect2 v1.0.2 // indirect
5739
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
58-
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
59-
github.com/prometheus/client_golang v1.20.2 // indirect
60-
github.com/prometheus/client_model v0.6.1 // indirect
61-
github.com/prometheus/common v0.55.0 // indirect
62-
github.com/prometheus/procfs v0.15.1 // indirect
63-
github.com/spf13/pflag v1.0.5 // indirect
64-
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
65-
github.com/ugorji/go/codec v1.2.12 // indirect
40+
github.com/prometheus/client_golang v1.22.0 // indirect
41+
github.com/prometheus/client_model v0.6.2 // indirect
42+
github.com/prometheus/common v0.65.0 // indirect
43+
github.com/prometheus/procfs v0.16.1 // indirect
44+
github.com/spf13/pflag v1.0.6 // indirect
6645
github.com/x448/float16 v0.8.4 // indirect
67-
golang.org/x/arch v0.8.0 // indirect
68-
golang.org/x/crypto v0.36.0 // indirect
69-
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
70-
golang.org/x/net v0.37.0 // indirect
71-
golang.org/x/oauth2 v0.22.0 // indirect
72-
golang.org/x/sys v0.31.0 // indirect
73-
golang.org/x/term v0.30.0 // indirect
74-
golang.org/x/text v0.23.0 // indirect
75-
golang.org/x/time v0.6.0 // indirect
76-
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
77-
google.golang.org/protobuf v1.34.2 // indirect
46+
go.yaml.in/yaml/v2 v2.4.2 // indirect
47+
go.yaml.in/yaml/v3 v3.0.4 // indirect
48+
golang.org/x/net v0.41.0 // indirect
49+
golang.org/x/oauth2 v0.30.0 // indirect
50+
golang.org/x/sync v0.15.0 // indirect
51+
golang.org/x/sys v0.33.0 // indirect
52+
golang.org/x/term v0.32.0 // indirect
53+
golang.org/x/text v0.26.0 // indirect
54+
golang.org/x/time v0.12.0 // indirect
55+
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
56+
google.golang.org/protobuf v1.36.6 // indirect
57+
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
7858
gopkg.in/inf.v0 v0.9.1 // indirect
79-
gopkg.in/yaml.v2 v2.4.0 // indirect
8059
gopkg.in/yaml.v3 v3.0.1 // indirect
81-
k8s.io/apiextensions-apiserver v0.31.0 // indirect
82-
k8s.io/client-go v0.31.0 // indirect
60+
k8s.io/apiextensions-apiserver v0.33.2 // indirect
61+
k8s.io/client-go v0.33.2 // indirect
8362
k8s.io/klog/v2 v2.130.1 // indirect
84-
k8s.io/kube-openapi v0.0.0-20240822171749-76de80e0abd9 // indirect
85-
k8s.io/utils v0.0.0-20240821151609-f90d01438635 // indirect
86-
sigs.k8s.io/controller-runtime v0.19.0 // indirect
87-
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
88-
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
63+
k8s.io/kube-openapi v0.0.0-20250628140032-d90c4fd18f59 // indirect
64+
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
65+
sigs.k8s.io/controller-runtime v0.21.0 // indirect
66+
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
67+
sigs.k8s.io/randfill v1.0.0 // indirect
68+
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
8969
)

0 commit comments

Comments
 (0)