Skip to content

Commit 820ca4d

Browse files
authored
Merge pull request #533 from mengqiy/webhook_client_comment
[doc] add comments about how to use the client in webhook handler
2 parents 2a270c1 + 35dabc3 commit 820ca4d

File tree

6 files changed

+24
-0
lines changed

6 files changed

+24
-0
lines changed

pkg/scaffold/webhook/admissionhandler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ func init() {
9999
100100
// {{ .Resource.Kind }}{{ .OperationsString }}Handler handles {{ .Resource.Kind }}
101101
type {{ .Resource.Kind }}{{ .OperationsString }}Handler struct {
102+
// To use the client, you need to do the following:
103+
// - uncomment it
104+
// - import sigs.k8s.io/controller-runtime/pkg/client
105+
// - uncomment the InjectClient method at the bottom of this file.
102106
// Client client.Client
103107
104108
// Decoder decodes objects

test/project/pkg/webhook/default_server/firstmate/mutating/firstmate_create_update_handler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ func init() {
3636

3737
// FirstMateCreateUpdateHandler handles FirstMate
3838
type FirstMateCreateUpdateHandler struct {
39+
// To use the client, you need to do the following:
40+
// - uncomment it
41+
// - import sigs.k8s.io/controller-runtime/pkg/client
42+
// - uncomment the InjectClient method at the bottom of this file.
3943
// Client client.Client
4044

4145
// Decoder decodes objects

test/project/pkg/webhook/default_server/firstmate/mutating/firstmate_delete_handler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ func init() {
3636

3737
// FirstMateDeleteHandler handles FirstMate
3838
type FirstMateDeleteHandler struct {
39+
// To use the client, you need to do the following:
40+
// - uncomment it
41+
// - import sigs.k8s.io/controller-runtime/pkg/client
42+
// - uncomment the InjectClient method at the bottom of this file.
3943
// Client client.Client
4044

4145
// Decoder decodes objects

test/project/pkg/webhook/default_server/frigate/validating/frigate_update_handler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ func init() {
3636

3737
// FrigateUpdateHandler handles Frigate
3838
type FrigateUpdateHandler struct {
39+
// To use the client, you need to do the following:
40+
// - uncomment it
41+
// - import sigs.k8s.io/controller-runtime/pkg/client
42+
// - uncomment the InjectClient method at the bottom of this file.
3943
// Client client.Client
4044

4145
// Decoder decodes objects

test/project/pkg/webhook/default_server/kraken/validating/kraken_create_handler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ func init() {
3636

3737
// KrakenCreateHandler handles Kraken
3838
type KrakenCreateHandler struct {
39+
// To use the client, you need to do the following:
40+
// - uncomment it
41+
// - import sigs.k8s.io/controller-runtime/pkg/client
42+
// - uncomment the InjectClient method at the bottom of this file.
3943
// Client client.Client
4044

4145
// Decoder decodes objects

test/project/pkg/webhook/default_server/namespace/mutating/namespace_update_handler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ func init() {
3636

3737
// NamespaceUpdateHandler handles Namespace
3838
type NamespaceUpdateHandler struct {
39+
// To use the client, you need to do the following:
40+
// - uncomment it
41+
// - import sigs.k8s.io/controller-runtime/pkg/client
42+
// - uncomment the InjectClient method at the bottom of this file.
3943
// Client client.Client
4044

4145
// Decoder decodes objects

0 commit comments

Comments
 (0)