Skip to content

Commit d0e97a2

Browse files
authored
Merge pull request #5307 from smarterclayton/clarify_case
api-conventions: Clarify that constant rules apply to flags and config
2 parents e55b6dd + fb6963a commit d0e97a2

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

contributors/devel/sig-architecture/api-conventions.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,23 @@ selectors, annotations, data), as opposed to sets of subobjects.
543543

544544
Some fields will have a list of allowed values (enumerations). These values will
545545
be strings, and they will be in CamelCase, with an initial uppercase letter.
546-
Examples: `ClusterFirst`, `Pending`, `ClientIP`.
546+
Examples: `ClusterFirst`, `Pending`, `ClientIP`. When an acronym or initialism
547+
each letter in the acronym should be uppercase, such as with `ClientIP` or
548+
`TCPDelay`. When a proper name or the name of a command-line executable is used
549+
as a constant the proper name should be represented in consistent casing -
550+
examples: `systemd`, `iptables`, `IPVS`, `cgroupfs`, `Docker` (as a generic
551+
concept), `docker` (as the command-line executable). If a proper name is used
552+
which has mixed capitalization like `eBFP` that should be preserved in a longer
553+
constant such as `eBPFDelegation`.
554+
555+
All API within Kubernetes must leverage constants in this style, including
556+
flags and configuration files. Where inconsistent constants were previously used,
557+
new flags should be CamelCase only, and over time old flags should be updated to
558+
accept a CamelCase value alongside the inconsistent constant. Example: the
559+
Kubelet accepts a `--topology-manager-policy` flag that has values `none`,
560+
`best-effort`, `restricted`, and `single-numa-node`. This flag should accept
561+
`None`, `BestEffort`, `Restricted`, and `SingleNUMANode` going forward. If new
562+
values are added to the flag, both forms should be supported.
547563

548564
#### Unions
549565

0 commit comments

Comments
 (0)