-
Notifications
You must be signed in to change notification settings - Fork 910
/
function_interfaces.go
335 lines (267 loc) · 9.63 KB
/
function_interfaces.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
/*
Copyright 2023 The Crossplane Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
corev1 "k8s.io/api/core/v1"
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
v1 "github.com/crossplane/crossplane/apis/pkg/v1"
)
// GetCondition of this Function.
func (f *Function) GetCondition(ct xpv1.ConditionType) xpv1.Condition {
return f.Status.GetCondition(ct)
}
// SetConditions of this Function.
func (f *Function) SetConditions(c ...xpv1.Condition) {
f.Status.SetConditions(c...)
}
// CleanConditions removes all conditions.
func (f *Function) CleanConditions() {
f.Status.Conditions = []xpv1.Condition{}
}
// GetSource of this Function.
func (f *Function) GetSource() string {
return f.Spec.Package
}
// SetSource of this Function.
func (f *Function) SetSource(s string) {
f.Spec.Package = s
}
// GetActivationPolicy of this Function.
func (f *Function) GetActivationPolicy() *v1.RevisionActivationPolicy {
return f.Spec.RevisionActivationPolicy
}
// SetActivationPolicy of this Function.
func (f *Function) SetActivationPolicy(a *v1.RevisionActivationPolicy) {
f.Spec.RevisionActivationPolicy = a
}
// GetPackagePullSecrets of this Function.
func (f *Function) GetPackagePullSecrets() []corev1.LocalObjectReference {
return f.Spec.PackagePullSecrets
}
// SetPackagePullSecrets of this Function.
func (f *Function) SetPackagePullSecrets(s []corev1.LocalObjectReference) {
f.Spec.PackagePullSecrets = s
}
// GetPackagePullPolicy of this Function.
func (f *Function) GetPackagePullPolicy() *corev1.PullPolicy {
return f.Spec.PackagePullPolicy
}
// SetPackagePullPolicy of this Function.
func (f *Function) SetPackagePullPolicy(i *corev1.PullPolicy) {
f.Spec.PackagePullPolicy = i
}
// GetRevisionHistoryLimit of this Function.
func (f *Function) GetRevisionHistoryLimit() *int64 {
return f.Spec.RevisionHistoryLimit
}
// SetRevisionHistoryLimit of this Function.
func (f *Function) SetRevisionHistoryLimit(l *int64) {
f.Spec.RevisionHistoryLimit = l
}
// GetIgnoreCrossplaneConstraints of this Function.
func (f *Function) GetIgnoreCrossplaneConstraints() *bool {
return f.Spec.IgnoreCrossplaneConstraints
}
// SetIgnoreCrossplaneConstraints of this Function.
func (f *Function) SetIgnoreCrossplaneConstraints(b *bool) {
f.Spec.IgnoreCrossplaneConstraints = b
}
// GetControllerConfigRef of this Function.
func (f *Function) GetControllerConfigRef() *v1.ControllerConfigReference {
return nil
}
// SetControllerConfigRef of this Function.
func (f *Function) SetControllerConfigRef(*v1.ControllerConfigReference) {}
// GetRuntimeConfigRef of this Function.
func (f *Function) GetRuntimeConfigRef() *v1.RuntimeConfigReference {
return f.Spec.RuntimeConfigReference
}
// SetRuntimeConfigRef of this Function.
func (f *Function) SetRuntimeConfigRef(r *v1.RuntimeConfigReference) {
f.Spec.RuntimeConfigReference = r
}
// GetCurrentRevision of this Function.
func (f *Function) GetCurrentRevision() string {
return f.Status.CurrentRevision
}
// SetCurrentRevision of this Function.
func (f *Function) SetCurrentRevision(s string) {
f.Status.CurrentRevision = s
}
// GetSkipDependencyResolution of this Function.
func (f *Function) GetSkipDependencyResolution() *bool {
return f.Spec.SkipDependencyResolution
}
// SetSkipDependencyResolution of this Function.
func (f *Function) SetSkipDependencyResolution(b *bool) {
f.Spec.SkipDependencyResolution = b
}
// GetCurrentIdentifier of this Function.
func (f *Function) GetCurrentIdentifier() string {
return f.Status.CurrentIdentifier
}
// SetCurrentIdentifier of this Function.
func (f *Function) SetCurrentIdentifier(s string) {
f.Status.CurrentIdentifier = s
}
// GetCommonLabels of this Function.
func (f *Function) GetCommonLabels() map[string]string {
return f.Spec.CommonLabels
}
// SetCommonLabels of this Function.
func (f *Function) SetCommonLabels(l map[string]string) {
f.Spec.CommonLabels = l
}
// GetTLSServerSecretName of this Function.
func (f *Function) GetTLSServerSecretName() *string {
return v1.GetSecretNameWithSuffix(f.GetName(), v1.TLSServerSecretNameSuffix)
}
// GetTLSClientSecretName of this Function.
func (f *Function) GetTLSClientSecretName() *string {
return nil
}
// GetCondition of this FunctionRevision.
func (r *FunctionRevision) GetCondition(ct xpv1.ConditionType) xpv1.Condition {
return r.Status.GetCondition(ct)
}
// SetConditions of this FunctionRevision.
func (r *FunctionRevision) SetConditions(c ...xpv1.Condition) {
r.Status.SetConditions(c...)
}
// CleanConditions removes all conditions.
func (r *FunctionRevision) CleanConditions() {
r.Status.Conditions = []xpv1.Condition{}
}
// GetObjects of this FunctionRevision.
func (r *FunctionRevision) GetObjects() []xpv1.TypedReference {
return r.Status.ObjectRefs
}
// SetObjects of this FunctionRevision.
func (r *FunctionRevision) SetObjects(c []xpv1.TypedReference) {
r.Status.ObjectRefs = c
}
// GetSource of this FunctionRevision.
func (r *FunctionRevision) GetSource() string {
return r.Spec.Package
}
// SetSource of this FunctionRevision.
func (r *FunctionRevision) SetSource(s string) {
r.Spec.Package = s
}
// GetPackagePullSecrets of this FunctionRevision.
func (r *FunctionRevision) GetPackagePullSecrets() []corev1.LocalObjectReference {
return r.Spec.PackagePullSecrets
}
// SetPackagePullSecrets of this FunctionRevision.
func (r *FunctionRevision) SetPackagePullSecrets(s []corev1.LocalObjectReference) {
r.Spec.PackagePullSecrets = s
}
// GetPackagePullPolicy of this FunctionRevision.
func (r *FunctionRevision) GetPackagePullPolicy() *corev1.PullPolicy {
return r.Spec.PackagePullPolicy
}
// SetPackagePullPolicy of this FunctionRevision.
func (r *FunctionRevision) SetPackagePullPolicy(i *corev1.PullPolicy) {
r.Spec.PackagePullPolicy = i
}
// GetDesiredState of this FunctionRevision.
func (r *FunctionRevision) GetDesiredState() v1.PackageRevisionDesiredState {
return r.Spec.DesiredState
}
// SetDesiredState of this FunctionRevision.
func (r *FunctionRevision) SetDesiredState(s v1.PackageRevisionDesiredState) {
r.Spec.DesiredState = s
}
// GetRevision of this FunctionRevision.
func (r *FunctionRevision) GetRevision() int64 {
return r.Spec.Revision
}
// SetRevision of this FunctionRevision.
func (r *FunctionRevision) SetRevision(rev int64) {
r.Spec.Revision = rev
}
// GetDependencyStatus of this v.
func (r *FunctionRevision) GetDependencyStatus() (found, installed, invalid int64) {
return r.Status.FoundDependencies, r.Status.InstalledDependencies, r.Status.InvalidDependencies
}
// SetDependencyStatus of this FunctionRevision.
func (r *FunctionRevision) SetDependencyStatus(found, installed, invalid int64) {
r.Status.FoundDependencies = found
r.Status.InstalledDependencies = installed
r.Status.InvalidDependencies = invalid
}
// GetIgnoreCrossplaneConstraints of this FunctionRevision.
func (r *FunctionRevision) GetIgnoreCrossplaneConstraints() *bool {
return r.Spec.IgnoreCrossplaneConstraints
}
// SetIgnoreCrossplaneConstraints of this FunctionRevision.
func (r *FunctionRevision) SetIgnoreCrossplaneConstraints(b *bool) {
r.Spec.IgnoreCrossplaneConstraints = b
}
// GetControllerConfigRef of this FunctionRevision.
func (r *FunctionRevision) GetControllerConfigRef() *v1.ControllerConfigReference {
return r.Spec.ControllerConfigReference
}
// SetControllerConfigRef of this FunctionRevision.
func (r *FunctionRevision) SetControllerConfigRef(ref *v1.ControllerConfigReference) {
r.Spec.ControllerConfigReference = ref
}
// GetRuntimeConfigRef of this FunctionRevision.
func (r *FunctionRevision) GetRuntimeConfigRef() *v1.RuntimeConfigReference {
return r.Spec.RuntimeConfigReference
}
// SetRuntimeConfigRef of this FunctionRevision.
func (r *FunctionRevision) SetRuntimeConfigRef(ref *v1.RuntimeConfigReference) {
r.Spec.RuntimeConfigReference = ref
}
// GetSkipDependencyResolution of this FunctionRevision.
func (r *FunctionRevision) GetSkipDependencyResolution() *bool {
return r.Spec.SkipDependencyResolution
}
// SetSkipDependencyResolution of this FunctionRevision.
func (r *FunctionRevision) SetSkipDependencyResolution(b *bool) {
r.Spec.SkipDependencyResolution = b
}
// GetTLSServerSecretName of this FunctionRevision.
func (r *FunctionRevision) GetTLSServerSecretName() *string {
return r.Spec.TLSServerSecretName
}
// SetTLSServerSecretName of this FunctionRevision.
func (r *FunctionRevision) SetTLSServerSecretName(s *string) {
r.Spec.TLSServerSecretName = s
}
// GetTLSClientSecretName of this FunctionRevision.
func (r *FunctionRevision) GetTLSClientSecretName() *string {
return r.Spec.TLSClientSecretName
}
// SetTLSClientSecretName of this FunctionRevision.
func (r *FunctionRevision) SetTLSClientSecretName(s *string) {
r.Spec.TLSClientSecretName = s
}
// GetCommonLabels of this FunctionRevision.
func (r *FunctionRevision) GetCommonLabels() map[string]string {
return r.Spec.CommonLabels
}
// SetCommonLabels of this FunctionRevision.
func (r *FunctionRevision) SetCommonLabels(l map[string]string) {
r.Spec.CommonLabels = l
}
// GetRevisions of this ConfigurationRevisionList.
func (p *FunctionRevisionList) GetRevisions() []v1.PackageRevision {
prs := make([]v1.PackageRevision, len(p.Items))
for i, r := range p.Items {
r := r // Pin range variable so we can take its address.
prs[i] = &r
}
return prs
}