-
Notifications
You must be signed in to change notification settings - Fork 132
/
application_types.go
125 lines (97 loc) · 3.19 KB
/
application_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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
type Application struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec ApplicationSpec `json:"spec"`
Status ApplicationStatus `json:"status,"`
Operation *Operation `json:"operation,omitempty"`
}
type ApplicationSpec struct {
Source *ApplicationSource `json:"source,omitempty"`
SyncPolicy *SyncPolicy `json:"syncPolicy,omitempty"`
Sources ApplicationSources `json:"sources,omitempty"`
}
type ApplicationSource struct {
RepoURL string `json:"repoURL"`
TargetRevision string `json:"targetRevision,omitempty"`
Helm *ApplicationSourceHelm `json:"helm,omitempty"`
Kustomize *ApplicationSourceKustomize `json:"kustomize,omitempty"`
Chart string `json:"chart,omitempty"`
}
type ApplicationSources []ApplicationSource
type RefreshType string
const (
RefreshTypeHard RefreshType = "hard"
)
type ApplicationSourceHelm struct {
Parameters []HelmParameter `json:"parameters,omitempty"`
}
type HelmParameter struct {
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
}
type KustomizeImage string
type KustomizeImages []KustomizeImage
type ApplicationSourceKustomize struct {
Images KustomizeImages `json:"images,omitempty"`
}
type ApplicationStatus struct {
Health HealthStatus `json:"health,omitempty"`
Sync SyncStatus `json:"sync,omitempty"`
}
type OperationInitiator struct {
Username string `json:"username,omitempty"`
Automated bool `json:"automated,omitempty"`
}
type Operation struct {
Sync *SyncOperation `json:"sync,omitempty"`
InitiatedBy OperationInitiator `json:"initiatedBy,omitempty"`
Info []*Info `json:"info,omitempty"`
Retry RetryStrategy `json:"retry,omitempty"`
}
type SyncOperation struct {
SyncOptions SyncOptions `json:"syncOptions,omitempty"`
Revisions []string `json:"revisions,omitempty"`
}
type Info struct {
Name string `json:"name"`
Value string `json:"value"`
}
type SyncOptions []string
type SyncPolicy struct {
SyncOptions SyncOptions `json:"syncOptions,omitempty"`
Retry *RetryStrategy `json:"retry,omitempty"`
}
type RetryStrategy struct {
Limit int64 `json:"limit,omitempty"`
Backoff *Backoff `json:"backoff,omitempty"`
}
type Backoff struct {
Duration string `json:"duration,omitempty"`
Factor *int64 `json:"factor,omitempty"`
MaxDuration string `json:"maxDuration,omitempty"`
}
//+kubebuilder:object:root=true
type ApplicationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []Application `json:"items"`
}
type SyncStatusCode string
const (
SyncStatusCodeSynced SyncStatusCode = "Synced"
)
type SyncStatus struct {
Status SyncStatusCode `json:"status"`
Revision string `json:"revision,omitempty"`
Revisions []string `json:"revisions,omitempty"`
}
type HealthStatus struct {
Status HealthStatusCode `json:"status,omitempty"`
Message string `json:"message,omitempty"`
}