<p dir="auto">As part of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="180557319" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/33900" data-hovercard-type="pull_request" data-hovercard-url="/kubernetes/kubernetes/pull/33900/hovercard" href="https://github.com/kubernetes/kubernetes/pull/33900">#33900</a> and also long running desires to clean up some incomplete abstractions, we need to normalize and resolve the status of <code class="notranslate">pkg/api/unversioned</code> (which is versioned) by moving it to a versioned package.</p>
<ol dir="auto">
<li>All "common" server logic will be in <code class="notranslate">pkg/apis/meta/v1</code>, or associated with that package.</li>
<li>Any internal versions of those objects will be in <code class="notranslate">pkg/apis/meta/internalversion</code></li>
<li>All other objects (versioned or internal) will directly reference the types in <code class="notranslate">pkg/apis/meta/v1</code></li>
<li>Any interfaces or abstractions that deal with ObjectMeta in its "v1" form will be located in that package (like unstructured and the ListAccessor interfaces)</li>
<li>Types in other groups that duplicate these objects will be removed (eg. v1.ListOptions)</li>
<li>External and internal group versions will call a <code class="notranslate">AddToGroupVersion</code> method from <code class="notranslate">pkg/apis/meta/v1</code> that registers common types, and other group versions will stop directly registering <code class="notranslate">*Options</code> and other reusable types.</li>
<li>'pkg/watch/versioned' is part of this interface and should be folded in to <code class="notranslate">pkg/apis/meta/v1</code></li>
</ol>
<p dir="auto">Refactors to perform:</p>
<ol dir="auto">
<li><strong>Move</strong> <code class="notranslate">pkg/api/unversioned</code> to <code class="notranslate">pkg/apis/meta/v1</code> and use <code class="notranslate">metav1</code> to reference it<br>
This identifies that these types are "versioned" and will be part of the "meta.k8s.io" API group in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="180557319" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/33900" data-hovercard-type="pull_request" data-hovercard-url="/kubernetes/kubernetes/pull/33900/hovercard" href="https://github.com/kubernetes/kubernetes/pull/33900">#33900</a>.  This group composes all of our common, cross group reusable bits. We use <code class="notranslate">metav1</code> to reference it internally to be consistent with our other versioned API package names.</li>
<li><strong>Move</strong> <code class="notranslate">pkg/watch/versioned</code> into <code class="notranslate">pkg/apis/meta/v1</code>, and move the decoder/encoder in that package into <code class="notranslate">pkg/client/restclient/watch</code><br>
The watch event is versioned and has minor conversion logic.  The decoders and encoders are used only be <code class="notranslate">pkg/apiserver</code> and <code class="notranslate">pkg/client/restclient</code>.</li>
<li><strong>Move</strong> <code class="notranslate">pkg/runtime/unstructured*.go</code> into <code class="notranslate">pkg/apis/meta/v1/unstructured</code><br>
The unstructured types implicitly depend on the metav1 schema (they cannot be used against any other type) and should be identified as versioned locked.  In the future, we could introduce abstractions that let us pick the appropriate unstructured type.</li>
<li><strong>Move</strong> <code class="notranslate">pkg/api/types.go#ListOptions|ExportOptions|DeleteOptions</code> to <code class="notranslate">pkg/apis/meta</code><br>
These are internal types deserialized from client input and used by client libraries and <code class="notranslate">pkg/apiserver</code>.</li>
<li><strong>Move</strong> <code class="notranslate">ObjectMeta</code> into <code class="notranslate">pkg/apis/meta/v1</code> and remove the internal <code class="notranslate">ObjectMeta</code><br>
ObjectMeta is part of the metav1 api (used by unstructured) and so should not be represented differently.  All internal code should be adapted to use this field.</li>
<li><strong>Remove</strong> <code class="notranslate">pkg/api/meta/metatypes</code> and use <code class="notranslate">pkg/apis/meta/v1</code> instead</li>
<li><strong>Remove</strong> most methods from <code class="notranslate">pkg/api/meta</code> in favor of methods in <code class="notranslate">pkg/apis/meta/v1</code>.</li>
<li><strong>Copy</strong> a temporary version of <code class="notranslate">pkg/api/unversioned</code> as required by <code class="notranslate">heapster/metrics/v1alpha</code> temporarily to preserve internal code until we can update heapster to use the new package.</li>
</ol>
<p dir="auto">Forked from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="45532851" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/1743" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/1743/hovercard" href="https://github.com/kubernetes/kubernetes/issues/1743">#1743</a></p>
<p dir="auto">One of the critical features we're lacking on the configuration front is template parameterization. We should decide on what approach we want to take.</p>
<p dir="auto">Working list of requirements:</p>
<ul dir="auto">
<li>It should be schema-respecting, not arbitrary textual transformation, in order to facilitate schema validation and independent substitution/decoration passes.</li>
<li>Input parameters should be clearly declared, such as to facilitate form generation, as discussed in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="56786189" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/4210" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/4210/hovercard" href="https://github.com/kubernetes/kubernetes/issues/4210">#4210</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="66715189" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/6487" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/6487/hovercard" href="https://github.com/kubernetes/kubernetes/issues/6487">#6487</a>.</li>
<li>Substitution should be independent of reconciliation, as per <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ghodss/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ghodss">@ghodss</a>'s comment.</li>
</ul>