knative / knative/pkg

[webhook] support distribution authors who want to add their custom defaulting and validation

Open
#1,140 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/API kind/feature lifecycle/frozen
Dominant language
Go
Stars
276
Forks
344
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Expected Behavior

As a distribution author it should be easy to include additional defaulting & validation logic without modifying the core API types

Actual Behavior

It's actually non-trivial to add a vendor specific default & validation. We want to avoid leaking things in the upstream API types.

A potential workaround is to define your own stub type but this is error prone because

  1. When defaulting - if your stub doesn't simply passthrough all fields of the type you'll actually remove fields
  2. Keeping stubs up to date with the upstream will be tedious - ie. when new fields are added

Thus we need something better for this situation

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by reviewing the webhook API types and their defaulting and validation paths, along with the linked stub-type examples; done means distribution authors can add vendor-specific logic without modifying upstream API types or maintaining lossy stubs.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.