Skip to content

Commit 86c6b62

Browse files
committed
Document how to use new metadata in feature gate description file
1 parent b1873fc commit 86c6b62

File tree

1 file changed

+50
-9
lines changed

1 file changed

+50
-9
lines changed

content/en/docs/contribute/new-content/new-features.md

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,28 @@ content is not received, the feature may be removed from the milestone.
129129
#### Feature gates {#ready-for-review-feature-gates}
130130

131131
If your feature is an Alpha or Beta feature and is behind a feature gate,
132-
make sure you add it to [Alpha/Beta Feature gates](/docs/reference/command-line-tools-reference/feature-gates/#feature-gates-for-alpha-or-beta-features)
133-
table as part of your pull request. With net new feature gates, a separate
132+
you need a feature gate file for it inside
133+
`content/en/docs/reference/command-line-tools-reference/feature-gates/`.
134+
The name of the file should be the feature gate, converted from `UpperCamelCase`
135+
to `kebab-case`, with `.md` as the suffix.
136+
You can look at other files already in the same directory for a hint about what yours
137+
should look like. Usually a single paragraph is enough; for longer explanations,
138+
add documentation elsewhere and link to that.
139+
140+
Also,
141+
to ensure your feature gate appears in the [Alpha/Beta Feature gates](/docs/reference/command-line-tools-reference/feature-gates/#feature-gates-for-alpha-or-beta-features) table, include the following details
142+
in the [front matter](https://gohugo.io/content-management/front-matter/) of your Markdown
143+
description file:
144+
145+
```yaml
146+
stages:
147+
- stage: <alpha/beta/stable/deprecated> # Specify the development stage of the feature gate
148+
defaultValue: <true or false> # Set to true if enabled by default, false otherwise
149+
fromVersion: <Version> # Version from which the feature gate is available
150+
toVersion: <Version> # (Optional) The version until which the feature gate is available
151+
```
152+
153+
With net new feature gates, a separate
134154
description of the feature gate is also required; create a new Markdown file
135155
inside `content/en/docs/reference/command-line-tools-reference/feature-gates/`
136156
(use other files as a template).
@@ -147,14 +167,35 @@ feature gates). Watch out for language such as ”The `exampleSetting` field
147167
is a beta field and disabled by default. You can enable it by enabling the
148168
`ProcessExampleThings` feature gate.”
149169

150-
If your feature is GA'ed or deprecated, make sure to move it from the
170+
If your feature is GA'ed or deprecated,
171+
include an additional `stage` entry within the `stages` block in the description file.
172+
Ensure that the Alpha and Beta stages remain intact.
173+
This step transitions the feature gate from the
151174
[Feature gates for Alpha/Feature](/docs/reference/command-line-tools-reference/feature-gates/#feature-gates-for-alpha-or-beta-features) table
152-
to [Feature gates for graduated or deprecated features](/docs/reference/command-line-tools-reference/feature-gates-removed/#feature-gates-that-are-removed)
153-
table with Alpha and Beta history intact.
154-
155-
Eventually, Kubernetes will stop including the feature gate at all.
156-
In that case, you move it from [Feature gates for graduated or deprecated features](/docs/reference/command-line-tools-reference/feature-gates-removed/#feature-gates-that-are-removed)
157-
and into a separate page, [Feature Gates (removed)](/docs/reference/command-line-tools-reference/feature-gates-removed/).
175+
to [Feature gates for graduated or deprecated features](/docs/reference/command-line-tools-reference/feature-gates/#feature-gates-for-graduated-or-deprecated-features) table. For example:
176+
177+
{{< highlight yaml "linenos=false,hl_lines=10-15" >}}
178+
stages:
179+
- stage: alpha
180+
defaultValue: false
181+
fromVersion: "1.12"
182+
toVersion: "1.12"
183+
- stage: beta
184+
defaultValue: true
185+
fromVersion: "1.13"
186+
toVersion: "1.18"
187+
# Added 'stable' stage block to existing stages.
188+
- stage: stable
189+
defaultValue: true
190+
fromVersion: "1.19"
191+
toVersion: "1.27"
192+
{{< / highlight >}}
193+
194+
Eventually, Kubernetes will stop including the feature gate at all. To signify the removal of a feature gate,
195+
include `removed: true` in the front matter of the respective description file.
196+
This action triggers the transition of the feature gate
197+
from [Feature gates for graduated or deprecated features](/docs/reference/command-line-tools-reference/feature-gates-removed/#feature-gates-that-are-removed) section to a dedicated page titled
198+
[Feature Gates (removed)](/docs/reference/command-line-tools-reference/feature-gates-removed/).
158199

159200
Also make sure to move the relevant list entry and
160201
[`feature-gate-description` shortcode](/docs/contribute/style/hugo-shortcodes/#feature-gate-description) into the

0 commit comments

Comments
 (0)