-
Notifications
You must be signed in to change notification settings - Fork 33
/
param.go
42 lines (32 loc) · 1.02 KB
/
param.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
package v1
import (
"encoding/json"
v1 "k8s.io/api/core/v1"
)
// Param represents a key-value pair
type Param struct {
// Name representing the key.
Name string `json:"name"`
// A parameter may have attributes (e.g. message hub topic might have partitions)
// +optional
Attributes map[string]ParamValue `json:"attributes,omitempty"`
// Mutual exclusive: no more than one of the following may be specified.
// Defaults to null.
// +optional
Value *ParamValue `json:"value,omitempty"`
// Source for the value. Cannot be used if value is not empty.
// +optional
ValueFrom *ParamSource `json:"valueFrom,omitempty"`
}
// ParamSource represents a source for the value of a Param.
type ParamSource struct {
// Selects a key of a ConfigMap.
// +optional
ConfigMapKeyRef *v1.ConfigMapKeySelector `json:"configMapKeyRef,omitempty"`
// Selects a key of a secret in the resource namespace
// +optional
SecretKeyRef *v1.SecretKeySelector `json:"secretKeyRef,omitempty"`
}
type ParamValue struct {
json.RawMessage `json:"-"`
}