Skip to content

Commit 8cb8f6f

Browse files
committed
Fix webhook server
Signed-off-by: Tamal Saha <[email protected]>
1 parent 4bd38bd commit 8cb8f6f

6 files changed

Lines changed: 14 additions & 8 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ require (
4343
kmodules.xyz/offshoot-api v0.29.0
4444
kmodules.xyz/openshift v0.29.0
4545
kmodules.xyz/prober v0.29.0
46-
kmodules.xyz/webhook-runtime v0.29.0
46+
kmodules.xyz/webhook-runtime v0.29.1
4747
sigs.k8s.io/controller-runtime v0.17.0
4848
stash.appscode.dev/apimachinery v0.33.0-rc.0
4949
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,8 +1588,8 @@ kmodules.xyz/resource-metadata v0.18.2-0.20240209092240-01f2d51a9f27 h1:MVAZE8rS
15881588
kmodules.xyz/resource-metadata v0.18.2-0.20240209092240-01f2d51a9f27/go.mod h1:I9HeSgkshwzwUy0IDhp4yIfRFbFQJ21syeSf4NsB04o=
15891589
kmodules.xyz/resource-metrics v0.29.0 h1:YBSVCbGdAugUqZK4igHu3fPhxvpYar4xejE6njryNM4=
15901590
kmodules.xyz/resource-metrics v0.29.0/go.mod h1:OuG/QobZ7o8GFHl/u3lqaUR0fDZDegxtV8Vdh+MNBD4=
1591-
kmodules.xyz/webhook-runtime v0.29.0 h1:6W3/MMcaCwLGbEggj6i5+WmOziwV3WwroWpfwe29rTU=
1592-
kmodules.xyz/webhook-runtime v0.29.0/go.mod h1:/TBpnSdTISjjUh4euI3XhNlpFU937CfKYoWjDm39pUY=
1591+
kmodules.xyz/webhook-runtime v0.29.1 h1:SQ8NvwJpxv5CUuXIubSg9g0Bk8BBnj4dhCWEk6Ou8g8=
1592+
kmodules.xyz/webhook-runtime v0.29.1/go.mod h1:WVgNO4NqFdYwYZ82L6QIycN1Ax47y+yXi7XIHekYylo=
15931593
nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
15941594
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
15951595
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=

vendor/kmodules.xyz/webhook-runtime/admission/v1beta1/generic/generic.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type GenericWebhook struct {
4242
plural schema.GroupVersionResource
4343
singular string
4444

45-
srcGroups sets.String
45+
srcGroups sets.Set[string]
4646
target schema.GroupVersionKind
4747
factory api.GetterFactory
4848
get api.GetFunc
@@ -65,7 +65,7 @@ func NewGenericWebhook(
6565
return &GenericWebhook{
6666
plural: plural,
6767
singular: singular,
68-
srcGroups: sets.NewString(srcGroups...),
68+
srcGroups: sets.New[string](srcGroups...),
6969
target: target,
7070
factory: factory,
7171
handler: handler,

vendor/kmodules.xyz/webhook-runtime/admission/v1beta1/workload/workload.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ type WorkloadWebhook struct {
4949
singular string
5050
kind string
5151

52-
srcGroups sets.String
52+
srcGroups sets.Set[string]
5353
factory api.GetterFactory
5454
get api.GetFunc
5555
handler admission.ResourceHandler
@@ -71,7 +71,7 @@ func NewWorkloadWebhook(
7171
plural: plural,
7272
singular: singular,
7373
kind: kind,
74-
srcGroups: sets.NewString(core.GroupName, appsv1.GroupName, extensions.GroupName, batchv1.GroupName),
74+
srcGroups: sets.New[string](core.GroupName, appsv1.GroupName, extensions.GroupName, batchv1.GroupName),
7575
factory: factory,
7676
handler: handler,
7777
}

vendor/kmodules.xyz/webhook-runtime/registry/admissionreview/v1beta1/admission_review.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package v1beta1
1818

1919
import (
2020
"context"
21+
"strings"
2122

2223
admission "k8s.io/api/admission/v1beta1"
2324
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -39,6 +40,7 @@ var (
3940
_ rest.Scoper = &REST{}
4041
_ rest.GroupVersionKindProvider = &REST{}
4142
_ rest.Storage = &REST{}
43+
_ rest.SingularNameProvider = &REST{}
4244
)
4345

4446
func NewREST(hookFn AdmissionHookFunc) *REST {
@@ -55,6 +57,10 @@ func (r *REST) GroupVersionKind(_ schema.GroupVersion) schema.GroupVersionKind {
5557
return admission.SchemeGroupVersion.WithKind("AdmissionReview")
5658
}
5759

60+
func (r *REST) GetSingularName() string {
61+
return strings.ToLower("AdmissionReview")
62+
}
63+
5864
func (r *REST) NamespaceScoped() bool {
5965
return false
6066
}

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1919,7 +1919,7 @@ kmodules.xyz/resource-metrics/core/v1
19191919
kmodules.xyz/resource-metrics/kubedb.com/v1alpha2
19201920
kmodules.xyz/resource-metrics/kubevault.com/v1alpha2
19211921
kmodules.xyz/resource-metrics/ops.kubedb.com/v1alpha1
1922-
# kmodules.xyz/webhook-runtime v0.29.0
1922+
# kmodules.xyz/webhook-runtime v0.29.1
19231923
## explicit; go 1.21.5
19241924
kmodules.xyz/webhook-runtime/admission
19251925
kmodules.xyz/webhook-runtime/admission/v1beta1

0 commit comments

Comments
 (0)