-
Notifications
You must be signed in to change notification settings - Fork 12
/
ast.go
40 lines (34 loc) · 932 Bytes
/
ast.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
package resource
import (
corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
)
func (ast *Ast) AppendOperation(operationType OperationType, resource client.Object) {
ast.Operations = append(ast.Operations, Operation{
Operation: operationType,
Resource: resource,
})
}
type Ast struct {
Operations Operations
// For podSpec
Annotations map[string]string
Containers []corev1.Container
Env []corev1.EnvVar
EnvFrom []corev1.EnvFromSource
InitContainers []corev1.Container
Labels map[string]string
Volumes []corev1.Volume
VolumeMounts []corev1.VolumeMount
}
func NewAst() *Ast {
return &Ast{
Operations: []Operation{},
Annotations: map[string]string{},
Containers: []corev1.Container{},
Env: []corev1.EnvVar{},
Labels: map[string]string{},
Volumes: []corev1.Volume{},
VolumeMounts: []corev1.VolumeMount{},
}
}