crossplane

Форк
0
/
function_interfaces.go 
335 строк · 9.6 Кб
1
/*
2
Copyright 2023 The Crossplane Authors.
3

4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7

8
    http://www.apache.org/licenses/LICENSE-2.0
9

10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16

17
package v1beta1
18

19
import (
20
	corev1 "k8s.io/api/core/v1"
21

22
	xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
23

24
	v1 "github.com/crossplane/crossplane/apis/pkg/v1"
25
)
26

27
// GetCondition of this Function.
28
func (f *Function) GetCondition(ct xpv1.ConditionType) xpv1.Condition {
29
	return f.Status.GetCondition(ct)
30
}
31

32
// SetConditions of this Function.
33
func (f *Function) SetConditions(c ...xpv1.Condition) {
34
	f.Status.SetConditions(c...)
35
}
36

37
// CleanConditions removes all conditions
38
func (f *Function) CleanConditions() {
39
	f.Status.Conditions = []xpv1.Condition{}
40
}
41

42
// GetSource of this Function.
43
func (f *Function) GetSource() string {
44
	return f.Spec.Package
45
}
46

47
// SetSource of this Function.
48
func (f *Function) SetSource(s string) {
49
	f.Spec.Package = s
50
}
51

52
// GetActivationPolicy of this Function.
53
func (f *Function) GetActivationPolicy() *v1.RevisionActivationPolicy {
54
	return f.Spec.RevisionActivationPolicy
55
}
56

57
// SetActivationPolicy of this Function.
58
func (f *Function) SetActivationPolicy(a *v1.RevisionActivationPolicy) {
59
	f.Spec.RevisionActivationPolicy = a
60
}
61

62
// GetPackagePullSecrets of this Function.
63
func (f *Function) GetPackagePullSecrets() []corev1.LocalObjectReference {
64
	return f.Spec.PackagePullSecrets
65
}
66

67
// SetPackagePullSecrets of this Function.
68
func (f *Function) SetPackagePullSecrets(s []corev1.LocalObjectReference) {
69
	f.Spec.PackagePullSecrets = s
70
}
71

72
// GetPackagePullPolicy of this Function.
73
func (f *Function) GetPackagePullPolicy() *corev1.PullPolicy {
74
	return f.Spec.PackagePullPolicy
75
}
76

77
// SetPackagePullPolicy of this Function.
78
func (f *Function) SetPackagePullPolicy(i *corev1.PullPolicy) {
79
	f.Spec.PackagePullPolicy = i
80
}
81

82
// GetRevisionHistoryLimit of this Function.
83
func (f *Function) GetRevisionHistoryLimit() *int64 {
84
	return f.Spec.RevisionHistoryLimit
85
}
86

87
// SetRevisionHistoryLimit of this Function.
88
func (f *Function) SetRevisionHistoryLimit(l *int64) {
89
	f.Spec.RevisionHistoryLimit = l
90
}
91

92
// GetIgnoreCrossplaneConstraints of this Function.
93
func (f *Function) GetIgnoreCrossplaneConstraints() *bool {
94
	return f.Spec.IgnoreCrossplaneConstraints
95
}
96

97
// SetIgnoreCrossplaneConstraints of this Function.
98
func (f *Function) SetIgnoreCrossplaneConstraints(b *bool) {
99
	f.Spec.IgnoreCrossplaneConstraints = b
100
}
101

102
// GetControllerConfigRef of this Function.
103
func (f *Function) GetControllerConfigRef() *v1.ControllerConfigReference {
104
	return nil
105
}
106

107
// SetControllerConfigRef of this Function.
108
func (f *Function) SetControllerConfigRef(*v1.ControllerConfigReference) {}
109

110
// GetRuntimeConfigRef of this Function.
111
func (f *Function) GetRuntimeConfigRef() *v1.RuntimeConfigReference {
112
	return f.Spec.RuntimeConfigReference
113
}
114

115
// SetRuntimeConfigRef of this Function.
116
func (f *Function) SetRuntimeConfigRef(r *v1.RuntimeConfigReference) {
117
	f.Spec.RuntimeConfigReference = r
118
}
119

120
// GetCurrentRevision of this Function.
121
func (f *Function) GetCurrentRevision() string {
122
	return f.Status.CurrentRevision
123
}
124

125
// SetCurrentRevision of this Function.
126
func (f *Function) SetCurrentRevision(s string) {
127
	f.Status.CurrentRevision = s
128
}
129

130
// GetSkipDependencyResolution of this Function.
131
func (f *Function) GetSkipDependencyResolution() *bool {
132
	return f.Spec.SkipDependencyResolution
133
}
134

135
// SetSkipDependencyResolution of this Function.
136
func (f *Function) SetSkipDependencyResolution(b *bool) {
137
	f.Spec.SkipDependencyResolution = b
138
}
139

140
// GetCurrentIdentifier of this Function.
141
func (f *Function) GetCurrentIdentifier() string {
142
	return f.Status.CurrentIdentifier
143
}
144

145
// SetCurrentIdentifier of this Function.
146
func (f *Function) SetCurrentIdentifier(s string) {
147
	f.Status.CurrentIdentifier = s
148
}
149

150
// GetCommonLabels of this Function.
151
func (f *Function) GetCommonLabels() map[string]string {
152
	return f.Spec.CommonLabels
153
}
154

155
// SetCommonLabels of this Function.
156
func (f *Function) SetCommonLabels(l map[string]string) {
157
	f.Spec.CommonLabels = l
158
}
159

160
// GetTLSServerSecretName of this Function.
161
func (f *Function) GetTLSServerSecretName() *string {
162
	return v1.GetSecretNameWithSuffix(f.GetName(), v1.TLSServerSecretNameSuffix)
163
}
164

165
// GetTLSClientSecretName of this Function.
166
func (f *Function) GetTLSClientSecretName() *string {
167
	return nil
168
}
169

170
// GetCondition of this FunctionRevision.
171
func (r *FunctionRevision) GetCondition(ct xpv1.ConditionType) xpv1.Condition {
172
	return r.Status.GetCondition(ct)
173
}
174

175
// SetConditions of this FunctionRevision.
176
func (r *FunctionRevision) SetConditions(c ...xpv1.Condition) {
177
	r.Status.SetConditions(c...)
178
}
179

180
// CleanConditions removes all conditions
181
func (r *FunctionRevision) CleanConditions() {
182
	r.Status.Conditions = []xpv1.Condition{}
183
}
184

185
// GetObjects of this FunctionRevision.
186
func (r *FunctionRevision) GetObjects() []xpv1.TypedReference {
187
	return r.Status.ObjectRefs
188
}
189

190
// SetObjects of this FunctionRevision.
191
func (r *FunctionRevision) SetObjects(c []xpv1.TypedReference) {
192
	r.Status.ObjectRefs = c
193
}
194

195
// GetSource of this FunctionRevision.
196
func (r *FunctionRevision) GetSource() string {
197
	return r.Spec.Package
198
}
199

200
// SetSource of this FunctionRevision.
201
func (r *FunctionRevision) SetSource(s string) {
202
	r.Spec.Package = s
203
}
204

205
// GetPackagePullSecrets of this FunctionRevision.
206
func (r *FunctionRevision) GetPackagePullSecrets() []corev1.LocalObjectReference {
207
	return r.Spec.PackagePullSecrets
208
}
209

210
// SetPackagePullSecrets of this FunctionRevision.
211
func (r *FunctionRevision) SetPackagePullSecrets(s []corev1.LocalObjectReference) {
212
	r.Spec.PackagePullSecrets = s
213
}
214

215
// GetPackagePullPolicy of this FunctionRevision.
216
func (r *FunctionRevision) GetPackagePullPolicy() *corev1.PullPolicy {
217
	return r.Spec.PackagePullPolicy
218
}
219

220
// SetPackagePullPolicy of this FunctionRevision.
221
func (r *FunctionRevision) SetPackagePullPolicy(i *corev1.PullPolicy) {
222
	r.Spec.PackagePullPolicy = i
223
}
224

225
// GetDesiredState of this FunctionRevision.
226
func (r *FunctionRevision) GetDesiredState() v1.PackageRevisionDesiredState {
227
	return r.Spec.DesiredState
228
}
229

230
// SetDesiredState of this FunctionRevision.
231
func (r *FunctionRevision) SetDesiredState(s v1.PackageRevisionDesiredState) {
232
	r.Spec.DesiredState = s
233
}
234

235
// GetRevision of this FunctionRevision.
236
func (r *FunctionRevision) GetRevision() int64 {
237
	return r.Spec.Revision
238
}
239

240
// SetRevision of this FunctionRevision.
241
func (r *FunctionRevision) SetRevision(rev int64) {
242
	r.Spec.Revision = rev
243
}
244

245
// GetDependencyStatus of this v.
246
func (r *FunctionRevision) GetDependencyStatus() (found, installed, invalid int64) {
247
	return r.Status.FoundDependencies, r.Status.InstalledDependencies, r.Status.InvalidDependencies
248
}
249

250
// SetDependencyStatus of this FunctionRevision.
251
func (r *FunctionRevision) SetDependencyStatus(found, installed, invalid int64) {
252
	r.Status.FoundDependencies = found
253
	r.Status.InstalledDependencies = installed
254
	r.Status.InvalidDependencies = invalid
255
}
256

257
// GetIgnoreCrossplaneConstraints of this FunctionRevision.
258
func (r *FunctionRevision) GetIgnoreCrossplaneConstraints() *bool {
259
	return r.Spec.IgnoreCrossplaneConstraints
260
}
261

262
// SetIgnoreCrossplaneConstraints of this FunctionRevision.
263
func (r *FunctionRevision) SetIgnoreCrossplaneConstraints(b *bool) {
264
	r.Spec.IgnoreCrossplaneConstraints = b
265
}
266

267
// GetControllerConfigRef of this FunctionRevision.
268
func (r *FunctionRevision) GetControllerConfigRef() *v1.ControllerConfigReference {
269
	return r.Spec.ControllerConfigReference
270
}
271

272
// SetControllerConfigRef of this FunctionRevision.
273
func (r *FunctionRevision) SetControllerConfigRef(ref *v1.ControllerConfigReference) {
274
	r.Spec.ControllerConfigReference = ref
275
}
276

277
// GetRuntimeConfigRef of this FunctionRevision.
278
func (r *FunctionRevision) GetRuntimeConfigRef() *v1.RuntimeConfigReference {
279
	return r.Spec.RuntimeConfigReference
280
}
281

282
// SetRuntimeConfigRef of this FunctionRevision.
283
func (r *FunctionRevision) SetRuntimeConfigRef(ref *v1.RuntimeConfigReference) {
284
	r.Spec.RuntimeConfigReference = ref
285
}
286

287
// GetSkipDependencyResolution of this FunctionRevision.
288
func (r *FunctionRevision) GetSkipDependencyResolution() *bool {
289
	return r.Spec.SkipDependencyResolution
290
}
291

292
// SetSkipDependencyResolution of this FunctionRevision.
293
func (r *FunctionRevision) SetSkipDependencyResolution(b *bool) {
294
	r.Spec.SkipDependencyResolution = b
295
}
296

297
// GetTLSServerSecretName of this FunctionRevision.
298
func (r *FunctionRevision) GetTLSServerSecretName() *string {
299
	return r.Spec.TLSServerSecretName
300
}
301

302
// SetTLSServerSecretName of this FunctionRevision.
303
func (r *FunctionRevision) SetTLSServerSecretName(s *string) {
304
	r.Spec.TLSServerSecretName = s
305
}
306

307
// GetTLSClientSecretName of this FunctionRevision.
308
func (r *FunctionRevision) GetTLSClientSecretName() *string {
309
	return r.Spec.TLSClientSecretName
310
}
311

312
// SetTLSClientSecretName of this FunctionRevision.
313
func (r *FunctionRevision) SetTLSClientSecretName(s *string) {
314
	r.Spec.TLSClientSecretName = s
315
}
316

317
// GetCommonLabels of this FunctionRevision.
318
func (r *FunctionRevision) GetCommonLabels() map[string]string {
319
	return r.Spec.CommonLabels
320
}
321

322
// SetCommonLabels of this FunctionRevision.
323
func (r *FunctionRevision) SetCommonLabels(l map[string]string) {
324
	r.Spec.CommonLabels = l
325
}
326

327
// GetRevisions of this ConfigurationRevisionList.
328
func (p *FunctionRevisionList) GetRevisions() []v1.PackageRevision {
329
	prs := make([]v1.PackageRevision, len(p.Items))
330
	for i, r := range p.Items {
331
		r := r // Pin range variable so we can take its address.
332
		prs[i] = &r
333
	}
334
	return prs
335
}
336

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

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

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

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