forked from openshift/origin
/
types.go
54 lines (43 loc) · 2.18 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package api
import (
kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
)
// Template contains the inputs needed to produce a Config.
type Template struct {
kapi.TypeMeta `json:",inline" yaml:",inline"`
// Required: Name identifies the Template.
Name string `json:"name" yaml:"name"`
// Optional: Description describes the Template.
Description string `json:"description" yaml:"description"`
// Required: Items is an array of Kubernetes resources of Service,
// Pod and/or ReplicationController kind.
// TODO: Handle unregistered types. Define custom []runtime.Object
// type and its unmarshaller instead of []runtime.Object.
Items []runtime.EmbeddedObject `json:"items" yaml:"items"`
// Optional: Parameters is an array of Parameters used during the
// Template to Config transformation.
Parameters []Parameter `json:"parameters,omitempty" yaml:"parameters,omitempty"`
}
// Parameter defines a name/value variable that is to be processed during
// the Template to Config transformation.
type Parameter struct {
// Required: Name uniquely identifies the Parameter. A TemplateProcessor
// searches given Template for all occurances of the Parameter name, ie.
// ${PARAM_NAME}, and replaces it with it's corresponding Parameter value.
Name string `json:"name" yaml:"name"`
// Optional: Description describes the Parameter.
Description string `json:"description,omitempty" yaml:"description,omitempty"`
// Optional: Generate specifies the generator to be used to generate
// random string from an input value specified by From field. The result
// string is stored into Value field. If empty, no generator is being
// used, leaving the result Value untouched.
Generate string `json:"generate,omitempty" yaml:"generate,omitempty"`
// Optional: From is an input value for the generator.
From string `json:"from,omitempty" yaml:"from,omitempty"`
// Optional: Value holds the Parameter data. The Value data can be
// overwritten by the generator. The value replaces all occurances
// of the Parameter ${Name} expression during the Template to Config
// transformation.
Value string `json:"value,omitempty" yaml:"value,omitempty"`
}