Skip to content

Commit 25e638d

Browse files
committed
Fix error anchor link of multiple-api-versions
Signed-off-by: Kante Yin <[email protected]>
1 parent f032894 commit 25e638d

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:
@@ -997,7 +997,7 @@ cases, objects will be automatically converted to the new version; in other
997997
cases, a manual upgrade may be necessary; a manual upgrade may require downtime
998998
for anything relying on the new feature, and may require manual conversion of
999999
objects to the new version; when manual conversion is necessary, the project
1000-
will provide documentation on the process
1000+
will provide documentation on the process
10011001
- Cluster Reliability: since the feature has e2e tests, enabling the feature
10021002
via a flag should not create new bugs in unrelated features; because the feature
10031003
is new, it may have minor bugs
@@ -1090,7 +1090,7 @@ The preferred approach adds an alpha field to the existing object, and ensures i
10901090
//
10911091
// Add multiple dimensions to frobbers.
10921092
Frobber2D utilfeature.Feature = "Frobber2D"
1093-
1093+
10941094
var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureSpec{
10951095
...
10961096
Frobber2D: {Default: false, PreRelease: utilfeature.Alpha},
@@ -1104,7 +1104,7 @@ The preferred approach adds an alpha field to the existing object, and ensures i
11041104
* add the `// +optional` comment tag
11051105
* ensure the field is entirely absent from API responses when empty (optional fields should be pointers, anyway)
11061106
* include details about the alpha-level in the field description
1107-
1107+
11081108
```go
11091109
// API v6.
11101110
type Frobber struct {
@@ -1130,16 +1130,16 @@ The recommended place to do this is in the REST storage strategy's PrepareForCre
11301130
```go
11311131
func (frobberStrategy) PrepareForCreate(ctx genericapirequest.Context, obj runtime.Object) {
11321132
frobber := obj.(*api.Frobber)
1133-
1133+
11341134
if !utilfeature.DefaultFeatureGate.Enabled(features.Frobber2D) {
11351135
frobber.Width = nil
11361136
}
11371137
}
1138-
1138+
11391139
func (frobberStrategy) PrepareForUpdate(ctx genericapirequest.Context, obj, old runtime.Object) {
11401140
newFrobber := obj.(*api.Frobber)
11411141
oldFrobber := old.(*api.Frobber)
1142-
1142+
11431143
if !utilfeature.DefaultFeatureGate.Enabled(features.Frobber2D) && oldFrobber.Width == nil {
11441144
newFrobber.Width = nil
11451145
}
@@ -1148,8 +1148,8 @@ The recommended place to do this is in the REST storage strategy's PrepareForCre
11481148
11491149
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
11501150
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
1151-
provides some details
1152-
1151+
provides some details
1152+
11531153
```go
11541154
func TestAPI(t *testing.T){
11551155
testCases:= []struct{
@@ -1162,7 +1162,7 @@ provides some details
11621162
// ... test case ..
11631163
},
11641164
}
1165-
1165+
11661166
for _, testCase := range testCases{
11671167
t.Run("..name...", func(t *testing.T){
11681168
// run with gate on
@@ -1175,7 +1175,7 @@ provides some details
11751175
// ... test gate-off testing logic logic ...
11761176
})
11771177
}
1178-
```
1178+
```
11791179

11801180
5. In validation, validate the field if present:
11811181

@@ -1202,7 +1202,7 @@ In future Kubernetes versions:
12021202
Height int32 `json:"height" protobuf:"varint,1,opt,name=height"`
12031203
// param ...
12041204
Param string `json:"param" protobuf:"bytes,2,opt,name=param"`
1205-
1205+
12061206
// +k8s:deprecated=width,protobuf=3
12071207
}
12081208
```
@@ -1265,7 +1265,7 @@ and graduating to beta and enabled by default in release 2.
12651265
//
12661266
// Allow OnTuesday restart policy in frobbers.
12671267
FrobberRestartPolicyOnTuesday utilfeature.Feature = "FrobberRestartPolicyOnTuesday"
1268-
1268+
12691269
var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureSpec{
12701270
...
12711271
FrobberRestartPolicyOnTuesday: {Default: false, PreRelease: utilfeature.Alpha},
@@ -1275,7 +1275,7 @@ and graduating to beta and enabled by default in release 2.
12751275
2. Update the documentation on the API type:
12761276

12771277
* include details about the alpha-level in the field description
1278-
1278+
12791279
```go
12801280
type Frobber struct {
12811281
// restartPolicy may be set to "Always" or "Never" (or "OnTuesday" if the alpha "FrobberRestartPolicyOnTuesday" feature is enabled).
@@ -1297,7 +1297,7 @@ The recommended place to do this is in the REST storage strategy's Validate/Vali
12971297
frobber := obj.(*api.Frobber)
12981298
return validation.ValidateFrobber(frobber, validationOptionsForFrobber(frobber, nil))
12991299
}
1300-
1300+
13011301
func (frobberStrategy) ValidateUpdate(ctx genericapirequest.Context, obj, old runtime.Object) field.ErrorList {
13021302
newFrobber := obj.(*api.Frobber)
13031303
oldFrobber := old.(*api.Frobber)
@@ -1353,7 +1353,7 @@ The recommended place to do this is in the REST storage strategy's Validate/Vali
13531353
//
13541354
// Allow OnTuesday restart policy in frobbers.
13551355
FrobberRestartPolicyOnTuesday utilfeature.Feature = "FrobberRestartPolicyOnTuesday"
1356-
1356+
13571357
var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureSpec{
13581358
...
13591359
FrobberRestartPolicyOnTuesday: {Default: true, PreRelease: utilfeature.Beta},

0 commit comments

Comments
 (0)