Skip to content

Commit 8083aaa

Browse files
authored
Merge pull request #7150 from kerthcet/cleanup/fix-anchor
Fix error anchor link of multiple-api-versions
2 parents 0abc1ed + 25e638d commit 8083aaa

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

contributors/devel/sig-architecture/api_changes.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ found at [API Conventions](api-conventions.md).
1212
- [Adding a field](#adding-a-field)
1313
- [Making a singular field plural](#making-a-singular-field-plural)
1414
- [Single-Dual ambiguity](#single-dual-ambiguity)
15-
- [Multiple API versions](multiple-api-versions)
15+
- [Multiple API versions](#multiple-api-versions)
1616
- [Backward compatibility gotchas](#backward-compatibility-gotchas)
1717
- [Incompatible API changes](#incompatible-api-changes)
1818
- [Changing versioned APIs](#changing-versioned-apis)
@@ -473,7 +473,7 @@ worked before the change.
473473
removed value as deprecated but allowed). For enumeration-like fields that expect to add
474474
new values in the future, such as `reason` fields, document that expectation clearly
475475
in the API field description in the first release the field is made available,
476-
and describe how clients should treat an unknown value. Clients should treat such
476+
and describe how clients should treat an unknown value. Clients should treat such
477477
sets of values as potentially open-ended.
478478

479479
* For [Unions](api-conventions.md#unions), sets of fields where at most one should
@@ -558,9 +558,9 @@ For types that need the generated
558558
[DeepCopyObject](https://github.com/kubernetes/kubernetes/commit/8dd0989b395b29b872e1f5e06934721863e4a210#diff-6318847735efb6fae447e7dbf198c8b2R3767)
559559
methods, usually only required by the top-level types like `Pod`, add this line
560560
to the comment
561-
([example](https://github.com/kubernetes/kubernetes/commit/39d95b9b065fffebe5b6f233d978fe1723722085#diff-ab819c2e7a94a3521aecf6b477f9b2a7R30)):
561+
([example](https://github.com/kubernetes/kubernetes/commit/39d95b9b065fffebe5b6f233d978fe1723722085#diff-ab819c2e7a94a3521aecf6b477f9b2a7R30)):
562562

563-
```golang
563+
```golang
564564
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
565565
```
566566

@@ -693,7 +693,7 @@ The `make generated_files` will also regenerate the `zz_generated.deepcopy.go`,
693693
If regeneration is somehow not possible due to compile errors, the easiest
694694
workaround is to remove the files causing errors and rerun the command.
695695

696-
## Generate Code
696+
## Generate Code
697697

698698
Apart from the `defaulter-gen`, `deepcopy-gen`, `conversion-gen` and
699699
`openapi-gen`, there are a few other generators:
@@ -999,7 +999,7 @@ cases, objects will be automatically converted to the new version; in other
999999
cases, a manual upgrade may be necessary; a manual upgrade may require downtime
10001000
for anything relying on the new feature, and may require manual conversion of
10011001
objects to the new version; when manual conversion is necessary, the project
1002-
will provide documentation on the process
1002+
will provide documentation on the process
10031003
- Cluster Reliability: since the feature has e2e tests, enabling the feature
10041004
via a flag should not create new bugs in unrelated features; because the feature
10051005
is new, it may have minor bugs
@@ -1092,7 +1092,7 @@ The preferred approach adds an alpha field to the existing object, and ensures i
10921092
//
10931093
// Add multiple dimensions to frobbers.
10941094
Frobber2D utilfeature.Feature = "Frobber2D"
1095-
1095+
10961096
var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureSpec{
10971097
...
10981098
Frobber2D: {Default: false, PreRelease: utilfeature.Alpha},
@@ -1106,7 +1106,7 @@ The preferred approach adds an alpha field to the existing object, and ensures i
11061106
* add the `// +optional` comment tag
11071107
* ensure the field is entirely absent from API responses when empty (optional fields should be pointers, anyway)
11081108
* include details about the alpha-level in the field description
1109-
1109+
11101110
```go
11111111
// API v6.
11121112
type Frobber struct {
@@ -1132,16 +1132,16 @@ The recommended place to do this is in the REST storage strategy's PrepareForCre
11321132
```go
11331133
func (frobberStrategy) PrepareForCreate(ctx genericapirequest.Context, obj runtime.Object) {
11341134
frobber := obj.(*api.Frobber)
1135-
1135+
11361136
if !utilfeature.DefaultFeatureGate.Enabled(features.Frobber2D) {
11371137
frobber.Width = nil
11381138
}
11391139
}
1140-
1140+
11411141
func (frobberStrategy) PrepareForUpdate(ctx genericapirequest.Context, obj, old runtime.Object) {
11421142
newFrobber := obj.(*api.Frobber)
11431143
oldFrobber := old.(*api.Frobber)
1144-
1144+
11451145
if !utilfeature.DefaultFeatureGate.Enabled(features.Frobber2D) && oldFrobber.Width == nil {
11461146
newFrobber.Width = nil
11471147
}
@@ -1150,8 +1150,8 @@ The recommended place to do this is in the REST storage strategy's PrepareForCre
11501150
11511151
4. To future-proof your API testing, when testing with feature gate on and off, ensure that the gate is deliberately set as desired. Don't assume that gate is off or on. As your feature
11521152
progresses from `alpha` to `beta` and then `stable` the feature might be turned on or off by default across the entire code base. The below example
1153-
provides some details
1154-
1153+
provides some details
1154+
11551155
```go
11561156
func TestAPI(t *testing.T){
11571157
testCases:= []struct{
@@ -1164,7 +1164,7 @@ provides some details
11641164
// ... test case ..
11651165
},
11661166
}
1167-
1167+
11681168
for _, testCase := range testCases{
11691169
t.Run("..name...", func(t *testing.T){
11701170
// run with gate on
@@ -1177,7 +1177,7 @@ provides some details
11771177
// ... test gate-off testing logic logic ...
11781178
})
11791179
}
1180-
```
1180+
```
11811181

11821182
5. In validation, validate the field if present:
11831183

@@ -1204,7 +1204,7 @@ In future Kubernetes versions:
12041204
Height int32 `json:"height" protobuf:"varint,1,opt,name=height"`
12051205
// param ...
12061206
Param string `json:"param" protobuf:"bytes,2,opt,name=param"`
1207-
1207+
12081208
// +k8s:deprecated=width,protobuf=3
12091209
}
12101210
```
@@ -1267,7 +1267,7 @@ and graduating to beta and enabled by default in release 2.
12671267
//
12681268
// Allow OnTuesday restart policy in frobbers.
12691269
FrobberRestartPolicyOnTuesday utilfeature.Feature = "FrobberRestartPolicyOnTuesday"
1270-
1270+
12711271
var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureSpec{
12721272
...
12731273
FrobberRestartPolicyOnTuesday: {Default: false, PreRelease: utilfeature.Alpha},
@@ -1277,7 +1277,7 @@ and graduating to beta and enabled by default in release 2.
12771277
2. Update the documentation on the API type:
12781278

12791279
* include details about the alpha-level in the field description
1280-
1280+
12811281
```go
12821282
type Frobber struct {
12831283
// restartPolicy may be set to "Always" or "Never" (or "OnTuesday" if the alpha "FrobberRestartPolicyOnTuesday" feature is enabled).
@@ -1299,7 +1299,7 @@ The recommended place to do this is in the REST storage strategy's Validate/Vali
12991299
frobber := obj.(*api.Frobber)
13001300
return validation.ValidateFrobber(frobber, validationOptionsForFrobber(frobber, nil))
13011301
}
1302-
1302+
13031303
func (frobberStrategy) ValidateUpdate(ctx genericapirequest.Context, obj, old runtime.Object) field.ErrorList {
13041304
newFrobber := obj.(*api.Frobber)
13051305
oldFrobber := old.(*api.Frobber)
@@ -1355,7 +1355,7 @@ The recommended place to do this is in the REST storage strategy's Validate/Vali
13551355
//
13561356
// Allow OnTuesday restart policy in frobbers.
13571357
FrobberRestartPolicyOnTuesday utilfeature.Feature = "FrobberRestartPolicyOnTuesday"
1358-
1358+
13591359
var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureSpec{
13601360
...
13611361
FrobberRestartPolicyOnTuesday: {Default: true, PreRelease: utilfeature.Beta},

0 commit comments

Comments
 (0)