Skip to content

Commit

Permalink
add kubectl factory conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
deads2k committed Dec 19, 2016
1 parent 52e237a commit 15d8d13
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions contributors/devel/kubectl-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Updated: 8/27/2015
- [Flag conventions](#flag-conventions)
- [Output conventions](#output-conventions)
- [Documentation conventions](#documentation-conventions)
- [kubectl Factory conventions](#kubectl-Factory-conventions)
- [Command implementation conventions](#command-implementation-conventions)
- [Generators](#generators)

Expand Down Expand Up @@ -245,6 +246,21 @@ rather than "RESOURCE" or "KIND"

* Use "NAME" for resource names

## kubectl Factory conventions

The kubectl `Factory` is a large interface which is used to provide access to clients,
polymorphic inspection, and polymorphic mutation. The `Factory` is layered in
"rings" in which one ring may reference inner rings, but not peers or outer rings.
This is done to allow composition by extenders.

In order for composers to be able to provide alternative factory implementations
they need to provide low level pieces of *certain* functions so that when the factory
calls back into itself it uses the custom version of the function. Rather than try
to enumerate everything that someone would want to override we split the factory into
rings, where each ring can depend on methods an earlier ring, but cannot depend upon
peer methods in its own ring.


## Command implementation conventions

For every command there should be a `NewCmd<CommandName>` function that creates
Expand Down

0 comments on commit 15d8d13

Please sign in to comment.