-
Notifications
You must be signed in to change notification settings - Fork 24
/
config.go
25 lines (23 loc) · 986 Bytes
/
config.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
// +kubebuilder:validation:Optional
// +kubebuilder:object:generate=true
package config
// Entity represents a pod, VM, and so on.
type Entity struct {
// Unique identifier of the entity.
UID string `json:"uid,omitempty" validate:"required"` // @gotags: validate:"required"
// IP address of the entity.
IPAddress string `json:"ip_address,omitempty" validate:"required,ip"` // @gotags: validate:"required,ip"
// Name of the entity. For example, pod name.
Name string `json:"name,omitempty"`
// Namespace of the entity. For example, pod namespace.
Namespace string `json:"namespace,omitempty"`
// Node name of the entity. For example, hostname.
NodeName string ` json:"node_name,omitempty"`
// Services of the entity.
Services []string `json:"services,omitempty" validate:"gt=0"` // @gotags: validate:"gt=0"
}
// StaticDiscoveryConfig for pre-determined list of services.
// swagger:model
type StaticDiscoveryConfig struct {
Entities []Entity `json:"entities,omitempty"`
}