Matthias Andreas Benkard | 832a54e | 2019-01-29 09:27:38 +0100 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2014 The Kubernetes Authors. |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | // Package runtime includes helper functions for working with API objects |
| 18 | // that follow the kubernetes API object conventions, which are: |
| 19 | // |
| 20 | // 0. Your API objects have a common metadata struct member, TypeMeta. |
| 21 | // 1. Your code refers to an internal set of API objects. |
| 22 | // 2. In a separate package, you have an external set of API objects. |
| 23 | // 3. The external set is considered to be versioned, and no breaking |
| 24 | // changes are ever made to it (fields may be added but not changed |
| 25 | // or removed). |
| 26 | // 4. As your api evolves, you'll make an additional versioned package |
| 27 | // with every major change. |
| 28 | // 5. Versioned packages have conversion functions which convert to |
| 29 | // and from the internal version. |
| 30 | // 6. You'll continue to support older versions according to your |
| 31 | // deprecation policy, and you can easily provide a program/library |
| 32 | // to update old versions into new versions because of 5. |
| 33 | // 7. All of your serializations and deserializations are handled in a |
| 34 | // centralized place. |
| 35 | // |
| 36 | // Package runtime provides a conversion helper to make 5 easy, and the |
| 37 | // Encode/Decode/DecodeInto trio to accomplish 7. You can also register |
| 38 | // additional "codecs" which use a version of your choice. It's |
| 39 | // recommended that you register your types with runtime in your |
| 40 | // package's init function. |
| 41 | // |
| 42 | // As a bonus, a few common types useful from all api objects and versions |
| 43 | // are provided in types.go. |
| 44 | |
| 45 | package runtime // import "k8s.io/apimachinery/pkg/runtime" |