Skip to content

Commit 15f70d9

Browse files
authored
Merge pull request #294 from h3poteto/feat/webhook
Stop using kubewebhook
2 parents b7a15da + e01a08a commit 15f70d9

File tree

9 files changed

+910
-660
lines changed

9 files changed

+910
-660
lines changed

cmd/webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (o *webhookOption) run(cmd *cobra.Command, args []string) {
3333
logrus.Fatal("tls-key-file is required parameter")
3434
}
3535

36-
if err := webhook.StartServer(o.tlsCertFile, o.tlsKeyFile); err != nil {
36+
if err := webhook.Server(int32(8080), o.tlsCertFile, o.tlsKeyFile); err != nil {
3737
logrus.Fatal(err)
3838
}
3939
}

config/crd/operator.h3poteto.dev_sidecarinjectors.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.13.0
6+
controller-gen.kubebuilder.io/version: v0.14.0
77
name: sidecarinjectors.operator.h3poteto.dev
88
spec:
99
group: operator.h3poteto.dev
@@ -21,14 +21,19 @@ spec:
2121
it.
2222
properties:
2323
apiVersion:
24-
description: 'APIVersion defines the versioned schema of this representation
25-
of an object. Servers should convert recognized schemas to the latest
26-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
24+
description: |-
25+
APIVersion defines the versioned schema of this representation of an object.
26+
Servers should convert recognized schemas to the latest internal value, and
27+
may reject unrecognized values.
28+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
2729
type: string
2830
kind:
29-
description: 'Kind is a string value representing the REST resource this
30-
object represents. Servers may infer this from the endpoint the client
31-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
31+
description: |-
32+
Kind is a string value representing the REST resource this object represents.
33+
Servers may infer this from the endpoint the client submits requests to.
34+
Cannot be updated.
35+
In CamelCase.
36+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
3237
type: string
3338
metadata:
3439
type: object

e2e/e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/h3poteto/fluentd-sidecar-injector/e2e/pkg/util"
1111
clientset "github.com/h3poteto/fluentd-sidecar-injector/pkg/client/clientset/versioned"
1212
"github.com/h3poteto/fluentd-sidecar-injector/pkg/controller/sidecarinjector"
13-
pkgwebhook "github.com/h3poteto/fluentd-sidecar-injector/pkg/webhook"
13+
pkgwebhook "github.com/h3poteto/fluentd-sidecar-injector/pkg/webhook/sidecarinjector"
1414

1515
. "github.com/onsi/ginkgo/v2"
1616
. "github.com/onsi/gomega"

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ require (
99
github.com/onsi/ginkgo/v2 v2.22.0
1010
github.com/onsi/gomega v1.36.0
1111
github.com/sirupsen/logrus v1.9.3
12-
github.com/slok/kubewebhook/v2 v2.6.0
1312
github.com/spf13/cobra v1.8.1
1413
github.com/spf13/viper v1.19.0
14+
gomodules.xyz/jsonpatch/v2 v2.4.0
1515
gopkg.in/yaml.v3 v3.0.1
1616
k8s.io/api v0.30.7
1717
k8s.io/apimachinery v0.30.7
@@ -68,7 +68,6 @@ require (
6868
golang.org/x/text v0.19.0 // indirect
6969
golang.org/x/time v0.5.0 // indirect
7070
golang.org/x/tools v0.26.0 // indirect
71-
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
7271
google.golang.org/appengine v1.6.8 // indirect
7372
google.golang.org/protobuf v1.35.1 // indirect
7473
gopkg.in/inf.v0 v0.9.1 // indirect

go.sum

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6g
9797
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
9898
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
9999
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
100-
github.com/slok/kubewebhook/v2 v2.6.0 h1:NMDDXx219OcNDc17ZYpqGXW81/jkBNmkdEwFDcZDVcA=
101-
github.com/slok/kubewebhook/v2 v2.6.0/go.mod h1:EoPfBo8lzgU1lmI1DSY/Fpwu+cdr4lZnzY4Tmg5sHe0=
102100
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
103101
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
104102
github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
@@ -114,7 +112,6 @@ github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+
114112
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
115113
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
116114
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
117-
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
118115
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
119116
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
120117
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=

0 commit comments

Comments
 (0)