diff options
| -rw-r--r-- | contributors/devel/api_changes.md | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/contributors/devel/api_changes.md b/contributors/devel/api_changes.md index 2440902e..3c457f25 100644 --- a/contributors/devel/api_changes.md +++ b/contributors/devel/api_changes.md @@ -365,10 +365,14 @@ being required otherwise. ### Edit defaults.go If your change includes new fields for which you will need default values, you -need to add cases to `pkg/apis/<group>/<version>/defaults.go` (the core v1 API -is special, its defaults.go is at `pkg/api/v1/defaults.go`. For simplicity, we -will not mention this special case in the rest of the article). Of course, since -you have added code, you have to add a test: +need to add cases to `pkg/apis/<group>/<version>/defaults.go` + +*Note:* In the past the core v1 API +was special. Its `defaults.go` used to live at `pkg/api/v1/defaults.go`. +If you see code referencing that path, you can be sure its outdated. Now the core v1 api lives at +`pkg/apis/core/v1/defaults.go` which follows the above convention. + +Of course, since you have added code, you have to add a test: `pkg/apis/<group>/<version>/defaults_test.go`. Do use pointers to scalars when you need to distinguish between an unset value |
