Remove unused YAML tags and GetYAML/SetYAML methods
Unneeded after move to ghodss/yaml.
This commit is contained in:
@@ -26,7 +26,7 @@ import (
|
||||
// TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type,
|
||||
// like this:
|
||||
// type MyAwesomeAPIObject struct {
|
||||
// runtime.TypeMeta `yaml:",inline" json:",inline"`
|
||||
// runtime.TypeMeta `json:",inline"`
|
||||
// ... // other fields
|
||||
// }
|
||||
// func (*MyAwesomeAPIObject) IsAnAPIObject() {}
|
||||
@@ -35,21 +35,21 @@ import (
|
||||
// your own with the same fields.
|
||||
//
|
||||
type TypeMeta struct {
|
||||
APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
|
||||
Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
|
||||
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
|
||||
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||
UID string `json:"uid,omitempty" yaml:"uid,omitempty"`
|
||||
CreationTimestamp util.Time `json:"creationTimestamp,omitempty" yaml:"creationTimestamp,omitempty"`
|
||||
SelfLink string `json:"selfLink,omitempty" yaml:"selfLink,omitempty"`
|
||||
ResourceVersion string `json:"resourceVersion,omitempty" yaml:"resourceVersion,omitempty"`
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
UID string `json:"uid,omitempty"`
|
||||
CreationTimestamp util.Time `json:"creationTimestamp,omitempty"`
|
||||
SelfLink string `json:"selfLink,omitempty"`
|
||||
ResourceVersion string `json:"resourceVersion,omitempty"`
|
||||
}
|
||||
|
||||
// PluginBase is like TypeMeta, but it's intended for plugin objects that won't ever be encoded
|
||||
// except while embedded in other objects.
|
||||
type PluginBase struct {
|
||||
Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
|
||||
Kind string `json:"kind,omitempty"`
|
||||
}
|
||||
|
||||
// EmbeddedObject has appropriate encoder and decoder functions, such that on the wire, it's
|
||||
@@ -74,22 +74,22 @@ type EmbeddedObject struct {
|
||||
//
|
||||
// // Internal package:
|
||||
// type MyAPIObject struct {
|
||||
// runtime.TypeMeta `yaml:",inline" json:",inline"`
|
||||
// MyPlugin runtime.EmbeddedObject `json:"myPlugin" yaml:"myPlugin"`
|
||||
// runtime.TypeMeta `json:",inline"`
|
||||
// MyPlugin runtime.EmbeddedObject `json:"myPlugin"`
|
||||
// }
|
||||
// type PluginA struct {
|
||||
// runtime.PluginBase `yaml:",inline" json:",inline"`
|
||||
// AOption string `yaml:"aOption" json:"aOption"`
|
||||
// runtime.PluginBase `json:",inline"`
|
||||
// AOption string `json:"aOption"`
|
||||
// }
|
||||
//
|
||||
// // External package:
|
||||
// type MyAPIObject struct {
|
||||
// runtime.TypeMeta `yaml:",inline" json:",inline"`
|
||||
// MyPlugin runtime.RawExtension `json:"myPlugin" yaml:"myPlugin"`
|
||||
// runtime.TypeMeta `json:",inline"`
|
||||
// MyPlugin runtime.RawExtension `json:"myPlugin"`
|
||||
// }
|
||||
// type PluginA struct {
|
||||
// runtime.PluginBase `yaml:",inline" json:",inline"`
|
||||
// AOption string `yaml:"aOption" json:"aOption"`
|
||||
// runtime.PluginBase `json:",inline"`
|
||||
// AOption string `json:"aOption"`
|
||||
// }
|
||||
//
|
||||
// // On the wire, the JSON will look something like this:
|
||||
@@ -118,7 +118,7 @@ type RawExtension struct {
|
||||
// TypeMeta features-- kind, version, resourceVersion, etc.
|
||||
// TODO: Not implemented yet!
|
||||
type Unknown struct {
|
||||
TypeMeta `yaml:",inline" json:",inline"`
|
||||
TypeMeta `json:",inline"`
|
||||
// RawJSON will hold the complete JSON of the object which couldn't be matched
|
||||
// with a registered type. Most likely, nothing should be done with this
|
||||
// except for passing it through the system.
|
||||
|
Reference in New Issue
Block a user