<p dir="auto">The message <code class="notranslate">valid_resources</code> should instead be a list of "primary resources", their shortcuts, and an optional description returned by the <code class="notranslate">Factory</code> (and probably generated by the same code that is used to resolve resource names, so as not to duplicate it).  Or it should be generated by p.HandledResources (although that doesn't have shortcut info).</p>
<p dir="auto">Ideal structure:</p>
<ul dir="auto">
<li>get invokes p.HandledResources and iterates</li>
<li>it retrieves shortcut (if any) from the RESTMapper or factory</li>
<li>it retrieves a short description from the description we generate for swagger (first sentence?)</li>
</ul>
<p dir="auto">As is, it is easy for someone to miss.</p>
<p dir="auto">Continued from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="44511031" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/1518" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/1518/hovercard" href="https://github.com/kubernetes/kubernetes/issues/1518">#1518</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="52354377" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/3024" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/3024/hovercard" href="https://github.com/kubernetes/kubernetes/issues/3024">#3024</a>, and also relates to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="45130990" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/1624" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/1624/hovercard" href="https://github.com/kubernetes/kubernetes/issues/1624">#1624</a>.</p>
<p dir="auto">Since there will necessarily be a higher barrier to entry for new objects, we should make replication controller composable (e.g., with auto-scalers and deployment managers), pluggable, hookable (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="51375798" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/2804" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/2804/hovercard" href="https://github.com/kubernetes/kubernetes/issues/2804">#2804</a>), to delegate decisions like which pod to kill to decrease the replica count, when pods should be killed and replaced (esp. moving to new nodes), when the whole collection should terminate (for RestartPolicyOnFailure), etc.</p>
<p dir="auto">For jobs that terminate (RestartPolicyOnFailure), I'd make the count auto-decrement on success. I'm tempted to say we should support terminating jobs of the per-node variety, but then we'd have to keep track on which nodes the pods had executed, which seems ugly.</p>
<p dir="auto">It should support graceful termination (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="44641725" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/1535" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/1535/hovercard" href="https://github.com/kubernetes/kubernetes/issues/1535">#1535</a>), but I've removed that from this sketch, since it's not specific to replication controller.</p>
<p dir="auto">Stab at a definition, also using my latest proposed name change:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="type OverseerSpec struct {
    ReplicationPolicy *ReplicationPolicy `json:&quot;replicationPolicy,omitempty&quot;`
    Selector map[string]string `json:&quot;selector,omitempty&quot;`
    TemplateRef *ObjectReference `json:&quot;templateRef,omitempty&quot;`
    Template *PodTemplateSpec `json:&quot;template,omitempty&quot;`
}
type ReplicationPolicy struct {
    Count *ReplicationPolicyCount    `json:&quot;count,omitempty&quot;`
    PerNode *ReplicationPolicyPerNode `json:&quot;perNode,omitempty&quot;`
}
type ReplicationPolicyCount struct {
    Count int `json:&quot;count&quot;`
}
type ReplicationPolicyPerNode struct {
}"><pre class="notranslate"><code class="notranslate">type OverseerSpec struct {
    ReplicationPolicy *ReplicationPolicy `json:"replicationPolicy,omitempty"`
    Selector map[string]string `json:"selector,omitempty"`
    TemplateRef *ObjectReference `json:"templateRef,omitempty"`
    Template *PodTemplateSpec `json:"template,omitempty"`
}
type ReplicationPolicy struct {
    Count *ReplicationPolicyCount    `json:"count,omitempty"`
    PerNode *ReplicationPolicyPerNode `json:"perNode,omitempty"`
}
type ReplicationPolicyCount struct {
    Count int `json:"count"`
}
type ReplicationPolicyPerNode struct {
}
</code></pre></div>
<p dir="auto">Forgiveness example was moved to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="44849943" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/1574" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/1574/hovercard" href="https://github.com/kubernetes/kubernetes/issues/1574">#1574</a>.</p>
<p dir="auto">Additional example policies have been removed.</p>
<p dir="auto">/cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/smarterclayton/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/smarterclayton">@smarterclayton</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/thockin/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/thockin">@thockin</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/brendandburns/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/brendandburns">@brendandburns</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/erictune/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/erictune">@erictune</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lavalamp/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lavalamp">@lavalamp</a></p>