Skip to content

Commit

Permalink
fix review finding
Browse files Browse the repository at this point in the history
  • Loading branch information
sbueringer committed Jul 6, 2022
1 parent 9f33c8d commit 03350a5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/webhook/admission/defaulter_custom.go
Expand Up @@ -60,7 +60,7 @@ func (h *defaulterForType) Handle(ctx context.Context, req Request) Response {
panic("object should never be nil")
}

ctx = newContextWithRequest(ctx, req)
ctx = NewContextWithRequest(ctx, req)

// Get the object in the request
obj := h.object.DeepCopyObject()
Expand Down
2 changes: 1 addition & 1 deletion pkg/webhook/admission/validator_custom.go
Expand Up @@ -64,7 +64,7 @@ func (h *validatorForType) Handle(ctx context.Context, req Request) Response {
panic("object should never be nil")
}

ctx = newContextWithRequest(ctx, req)
ctx = NewContextWithRequest(ctx, req)

// Get the object in the request
obj := h.object.DeepCopyObject()
Expand Down
4 changes: 2 additions & 2 deletions pkg/webhook/admission/webhook.go
Expand Up @@ -266,8 +266,8 @@ func RequestFromContext(ctx context.Context) (Request, error) {
return Request{}, errors.New("admission.Request not found in context")
}

// newContextWithRequest returns a new Context, derived from ctx, which carries the
// NewContextWithRequest returns a new Context, derived from ctx, which carries the
// provided admission.Request.
func newContextWithRequest(ctx context.Context, req Request) context.Context {
func NewContextWithRequest(ctx context.Context, req Request) context.Context {
return context.WithValue(ctx, requestContextKey{}, req)
}

0 comments on commit 03350a5

Please sign in to comment.