forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
62 lines (49 loc) · 2.37 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
55
56
57
58
59
60
61
62
package v1beta3
import (
"k8s.io/kubernetes/pkg/api/unversioned"
kapi "k8s.io/kubernetes/pkg/api/v1beta3"
"k8s.io/kubernetes/pkg/runtime"
)
// Template contains the inputs needed to produce a Config.
type Template struct {
unversioned.TypeMeta `json:",inline"`
kapi.ObjectMeta `json:"metadata,omitempty"`
// Required: Objects is an array of objects to include in this template
Objects []runtime.RawExtension `json:"objects"`
// Optional: Parameters is an array of Parameters used during the
// Template to Config transformation.
Parameters []Parameter `json:"parameters,omitempty"`
// Optional: Labels is a set of labels that are applied to every
// object during the Template to Config transformation
Labels map[string]string `json:"labels,omitempty"`
}
// TemplateList is a list of Template objects.
type TemplateList struct {
unversioned.TypeMeta `json:",inline"`
unversioned.ListMeta `json:"metadata,omitempty"`
Items []Template `json:"items"`
}
// Parameter defines a name/value variable that is to be processed during
// the Template to Config transformation.
type Parameter struct {
// Required: Parameter name must be set and it can be referenced in Template
// Items using ${PARAMETER_NAME}
Name string `json:"name"`
// Optional: The name that will show in UI instead of parameter 'Name'
DisplayName string `json:"displayName,omitempty" description:"optional: provides human readable name for the parameter"`
// Optional: Parameter can have description
Description string `json:"description,omitempty"`
// Optional: Value holds the Parameter data. If specified, the generator
// will be ignored. The value replaces all occurrences of the Parameter
// ${Name} expression during the Template to Config transformation.
Value string `json:"value,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"`
// Optional: From is an input value for the generator.
From string `json:"from,omitempty"`
// Optional: Indicates the parameter must have a value. Defaults to false.
Required bool `json:"required,omitempty" description:"indicates the parameter must have a non-empty value or be generated"`
}