kubelatte-ce

Форк
2
Форк от sbertech/kubelatte-ce
77 строк · 1.9 Кб
1
package validation
2

3
import (
4
	"gitverse.ru/synapse/kubelatte/pkg/api/v1alpha1"
5
)
6

7
const Validation = "validation"
8

9
type Rules struct {
10
	MutationRuleConfig   []v1alpha1.Item
11
	ValidationRuleConfig []v1alpha1.Item
12
}
13

14
type RuleSpec struct {
15
	Type  string          `yaml:"type"`
16
	Items []v1alpha1.Item `yaml:"items,flow"`
17
}
18

19
type Rule struct {
20
	Simples []Simple `yaml:"simples"`
21
	Rego    Rego     `yaml:"rego"`
22
}
23

24
type Rego struct {
25
	Template   string `yaml:"template"`
26
	Parameters string `yaml:"parameters"`
27
}
28

29
type Simple struct {
30
	Name    string `yaml:"name"`
31
	Path    string `yaml:"path"`
32
	Value   string `yaml:"value"`
33
	Action  string `yaml:"action"`
34
	Message string `yaml:"message"`
35
}
36

37
type Match struct {
38
	Kinds               []Kinds           `yaml:"kinds"`
39
	NamespaceSelector   NamespaceSelector `yaml:"namespaceSelector"`
40
	LabelSelector       LabelSelector     `yaml:"labelSelector"`
41
	UserInfo            UserInfo          `yaml:"userInfo"`
42
	Name                string            `yaml:"name"`
43
	Scope               string            `yaml:"scope"`
44
	ExcludedNamespaces  []string          `yaml:"excludedNamespaces"`
45
	Namespaces          []string          `yaml:"namespaces"`
46
	Operations          []string          `yaml:"operations"`
47
	AnnotationNamespace string            `yaml:"annotationNamespace"`
48
	AnnotationTrigger   string            `yaml:"annotationTrigger"`
49
}
50

51
type UserInfo struct {
52
	Username string `yaml:"username"`
53
}
54

55
type Kinds struct {
56
	Kinds     []string `yaml:"kinds"`
57
	ApiGroups []string `yaml:"apiGroups"`
58
}
59

60
type NamespaceSelector struct {
61
	MatchExpressions []MatchExpression `yaml:"matchExpressions"`
62
}
63

64
type LabelSelector struct {
65
	MatchExpressions []MatchExpression `yaml:"matchExpressions"`
66
}
67

68
type MatchExpression struct {
69
	Key      string   `yaml:"key"`
70
	Operator string   `yaml:"operator"`
71
	Values   []string `yaml:"values"`
72
}
73

74
const (
75
	Deny  = "deny"
76
	Allow = "allow"
77
)
78

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.