mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 06:02:18 +00:00
Remove unused YAML tags and GetYAML/SetYAML methods
Unneeded after move to ghodss/yaml.
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
```
|
||||
|
||||
@@ -211,4 +211,4 @@ Output:
|
||||
name: bar-solo-coolapp-prod
|
||||
status:
|
||||
replicas: 0
|
||||
```
|
||||
```
|
||||
|
@@ -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() {
|
||||
|
@@ -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
|
||||
|
@@ -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) {
|
||||
|
@@ -15,9 +15,9 @@ $ 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
|
||||
@@ -25,9 +25,9 @@ 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
|
||||
@@ -213,4 +213,4 @@ Output:
|
||||
status:
|
||||
replicas: 0
|
||||
|
||||
```
|
||||
```
|
||||
|
@@ -62,9 +62,9 @@ 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
|
||||
@@ -72,9 +72,9 @@ 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
|
||||
|
Reference in New Issue
Block a user