Skip to content

Commit

Permalink
Remove unused YAML tags and GetYAML/SetYAML methods
Browse files Browse the repository at this point in the history
Unneeded after move to ghodss/yaml.
  • Loading branch information
Sam Ghods committed Dec 3, 2014
1 parent 1208946 commit 6399854
Show file tree
Hide file tree
Showing 34 changed files with 980 additions and 1,069 deletions.
6 changes: 3 additions & 3 deletions contrib/enscope/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ $ enscope specFilename configFilename
## Scope schema
```
type EnscopeSpec struct {
NameSuffix string `json:"nameSuffix,omitempty" yaml:"nameSuffix,omitempty"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
NameSuffix string `json:"nameSuffix,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
}
```

Expand Down Expand Up @@ -211,4 +211,4 @@ Output:
name: bar-solo-coolapp-prod
status:
replicas: 0
```
```
4 changes: 2 additions & 2 deletions contrib/enscope/enscope.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ func checkErr(err error) {
// TODO: If name suffix is not specified, deterministically generate it by hashing the labels.

type EnscopeSpec struct {
NameSuffix string `json:"nameSuffix,omitempty" yaml:"nameSuffix,omitempty"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
NameSuffix string `json:"nameSuffix,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
}

func main() {
Expand Down
8 changes: 4 additions & 4 deletions contrib/simplegen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ $ simplegen http://some.blog.site.com/k8s-example.yaml
### Schema
```
// Optional: Defaults to image base name if not specified
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Name string `json:"name,omitempty"`
// Required.
Image string `yaml:"image" json:"image"`
Image string `json:"image"`
// Optional: Defaults to one
Replicas int `yaml:"replicas,omitempty" json:"replicas,omitempty"`
Replicas int `json:"replicas,omitempty"`
// Optional: Creates a service if specified: servicePort:containerPort
PortSpec string `yaml:"portSpec,omitempty" json:"portSpec,omitempty"`
PortSpec string `json:"portSpec,omitempty"`
```

### Example
Expand Down
8 changes: 4 additions & 4 deletions contrib/simplegen/simplegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ const usage = "usage: simplegen filename"

type SimpleService struct {
// Optional: Defaults to image base name if not specified
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Name string `json:"name,omitempty"`
// Required.
Image string `yaml:"image" json:"image"`
Image string `json:"image"`
// Optional: Defaults to one
Replicas int `yaml:"replicas,omitempty" json:"replicas,omitempty"`
Replicas int `json:"replicas,omitempty"`
// Optional: Creates a service if specified: servicePort:containerPort
PortSpec string `yaml:"portSpec,omitempty" json:"portSpec,omitempty"`
PortSpec string `json:"portSpec,omitempty"`
}

func checkErr(err error) {
Expand Down
10 changes: 5 additions & 5 deletions contrib/srvexpand/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ $ srvexpand myservice.yaml
```
type HierarchicalController struct {
// Optional: Defaults to one
Replicas int `yaml:"replicas,omitempty" json:"replicas,omitempty"`
Replicas int `json:"replicas,omitempty"`
// Spec defines the behavior of a pod.
Spec v1beta3.PodSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
Spec v1beta3.PodSpec `json:"spec,omitempty"`
}
type ControllerMap map[string]HierarchicalController
type HierarchicalService struct {
// Optional: Creates a service if specified: servicePort:containerPort
// TODO: Support multiple protocols
PortSpec string `yaml:"portSpec,omitempty" json:"portSpec,omitempty"`
PortSpec string `json:"portSpec,omitempty"`
// Map of replication controllers to create
ControllerMap ControllerMap `json:"controllers,omitempty" yaml:"controllers,omitempty"`
ControllerMap ControllerMap `json:"controllers,omitempty"`
}
type ServiceMap map[string]HierarchicalService
Expand Down Expand Up @@ -213,4 +213,4 @@ Output:
status:
replicas: 0
```
```
8 changes: 4 additions & 4 deletions contrib/srvexpand/srvexpand.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ const usage = "usage: srvexpand filename"

type HierarchicalController struct {
// Optional: Defaults to one
Replicas int `yaml:"replicas,omitempty" json:"replicas,omitempty"`
Replicas int `json:"replicas,omitempty"`
// Spec defines the behavior of a pod.
Spec v1beta3.PodSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
Spec v1beta3.PodSpec `json:"spec,omitempty"`
}

type ControllerMap map[string]HierarchicalController

type HierarchicalService struct {
// Optional: Creates a service if specified: servicePort:containerPort
// TODO: Support multiple protocols
PortSpec string `yaml:"portSpec,omitempty" json:"portSpec,omitempty"`
PortSpec string `json:"portSpec,omitempty"`
// Map of replication controllers to create
ControllerMap ControllerMap `json:"controllers,omitempty" yaml:"controllers,omitempty"`
ControllerMap ControllerMap `json:"controllers,omitempty"`
}

type ServiceMap map[string]HierarchicalService
Expand Down
16 changes: 8 additions & 8 deletions docs/design/namespaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ A *Namespace* is a DNS compatible subdomain.
```
// TypeMeta is shared by all objects sent to, or returned from the client
type TypeMeta struct {
Kind string `json:"kind,omitempty" yaml:"kind,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 uint64 `json:"resourceVersion,omitempty" yaml:"resourceVersion,omitempty"`
APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Kind string `json:"kind,omitempty"`
Uid string `json:"uid,omitempty"`
CreationTimestamp util.Time `json:"creationTimestamp,omitempty"`
SelfLink string `json:"selfLink,omitempty"`
ResourceVersion uint64 `json:"resourceVersion,omitempty"`
APIVersion string `json:"apiVersion,omitempty"`
Namespace string `json:"namespace,omitempty"`
Name string `json:"name,omitempty"`
}
```

Expand Down
82 changes: 41 additions & 41 deletions pkg/api/meta/meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ import (

func TestGenericTypeMeta(t *testing.T) {
type TypeMeta struct {
Kind string `json:"kind,omitempty" yaml:"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"`
APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
Kind string `json:"kind,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"`
APIVersion string `json:"apiVersion,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
}
type Object struct {
TypeMeta `json:",inline" yaml:",inline"`
TypeMeta `json:",inline"`
}
j := Object{
TypeMeta{
Expand Down Expand Up @@ -112,19 +112,19 @@ func TestGenericTypeMeta(t *testing.T) {
}

type InternalTypeMeta struct {
Kind string `json:"kind,omitempty" yaml:"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"`
APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
Kind string `json:"kind,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"`
APIVersion string `json:"apiVersion,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
}
type InternalObject struct {
TypeMeta InternalTypeMeta `json:",inline" yaml:",inline"`
TypeMeta InternalTypeMeta `json:",inline"`
}

func (*InternalObject) IsAnAPIObject() {}
Expand Down Expand Up @@ -269,22 +269,22 @@ func TestGenericTypeMetaAccessor(t *testing.T) {

func TestGenericObjectMeta(t *testing.T) {
type TypeMeta struct {
Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
Kind string `json:"kind,omitempty"`
APIVersion string `json:"apiVersion,omitempty"`
}
type ObjectMeta struct {
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"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,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"`
Labels map[string]string `json:"labels,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
}
type Object struct {
TypeMeta `json:",inline" yaml:",inline"`
ObjectMeta `json:"metadata" yaml:"metadata"`
TypeMeta `json:",inline"`
ObjectMeta `json:"metadata"`
}
j := Object{
TypeMeta{
Expand Down Expand Up @@ -375,16 +375,16 @@ func TestGenericObjectMeta(t *testing.T) {

func TestGenericListMeta(t *testing.T) {
type TypeMeta struct {
Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
Kind string `json:"kind,omitempty"`
APIVersion string `json:"apiVersion,omitempty"`
}
type ListMeta struct {
SelfLink string `json:"selfLink,omitempty" yaml:"selfLink,omitempty"`
ResourceVersion string `json:"resourceVersion,omitempty" yaml:"resourceVersion,omitempty"`
SelfLink string `json:"selfLink,omitempty"`
ResourceVersion string `json:"resourceVersion,omitempty"`
}
type Object struct {
TypeMeta `json:",inline" yaml:",inline"`
ListMeta `json:"metadata" yaml:"metadata"`
TypeMeta `json:",inline"`
ListMeta `json:"metadata"`
}
j := Object{
TypeMeta{
Expand Down Expand Up @@ -442,7 +442,7 @@ func TestGenericListMeta(t *testing.T) {
}

type MyAPIObject struct {
TypeMeta InternalTypeMeta `json:",inline" yaml:",inline"`
TypeMeta InternalTypeMeta `json:",inline"`
}

func (*MyAPIObject) IsAnAPIObject() {}
Expand Down
Loading

0 comments on commit 6399854

Please sign in to comment.