summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabiano Franz <ffranz@redhat.com>2016-12-19 16:41:26 -0200
committerGitHub <noreply@github.com>2016-12-19 16:41:26 -0200
commit1711e75d348925990abb4f4b710fa6134e90ab90 (patch)
treec6d7cd8e1cb96af04435310a4f9f9a4558d927a5
parent7c3e8af9802c27d3f148cf1876a40c3a96c0e9df (diff)
parent15d8d13f08cd0f3d0ebc7d1a8a707c7cac8a25a9 (diff)
Merge pull request #184 from deads2k/cli-factory
add kubectl factory conventions
-rw-r--r--contributors/devel/kubectl-conventions.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/contributors/devel/kubectl-conventions.md b/contributors/devel/kubectl-conventions.md
index 1e94b3ba..2bb5f49d 100644
--- a/contributors/devel/kubectl-conventions.md
+++ b/contributors/devel/kubectl-conventions.md
@@ -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)
@@ -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