crossplane
335 строк · 9.6 Кб
1/*
2Copyright 2023 The Crossplane Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17package v1beta1
18
19import (
20corev1 "k8s.io/api/core/v1"
21
22xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
23
24v1 "github.com/crossplane/crossplane/apis/pkg/v1"
25)
26
27// GetCondition of this Function.
28func (f *Function) GetCondition(ct xpv1.ConditionType) xpv1.Condition {
29return f.Status.GetCondition(ct)
30}
31
32// SetConditions of this Function.
33func (f *Function) SetConditions(c ...xpv1.Condition) {
34f.Status.SetConditions(c...)
35}
36
37// CleanConditions removes all conditions
38func (f *Function) CleanConditions() {
39f.Status.Conditions = []xpv1.Condition{}
40}
41
42// GetSource of this Function.
43func (f *Function) GetSource() string {
44return f.Spec.Package
45}
46
47// SetSource of this Function.
48func (f *Function) SetSource(s string) {
49f.Spec.Package = s
50}
51
52// GetActivationPolicy of this Function.
53func (f *Function) GetActivationPolicy() *v1.RevisionActivationPolicy {
54return f.Spec.RevisionActivationPolicy
55}
56
57// SetActivationPolicy of this Function.
58func (f *Function) SetActivationPolicy(a *v1.RevisionActivationPolicy) {
59f.Spec.RevisionActivationPolicy = a
60}
61
62// GetPackagePullSecrets of this Function.
63func (f *Function) GetPackagePullSecrets() []corev1.LocalObjectReference {
64return f.Spec.PackagePullSecrets
65}
66
67// SetPackagePullSecrets of this Function.
68func (f *Function) SetPackagePullSecrets(s []corev1.LocalObjectReference) {
69f.Spec.PackagePullSecrets = s
70}
71
72// GetPackagePullPolicy of this Function.
73func (f *Function) GetPackagePullPolicy() *corev1.PullPolicy {
74return f.Spec.PackagePullPolicy
75}
76
77// SetPackagePullPolicy of this Function.
78func (f *Function) SetPackagePullPolicy(i *corev1.PullPolicy) {
79f.Spec.PackagePullPolicy = i
80}
81
82// GetRevisionHistoryLimit of this Function.
83func (f *Function) GetRevisionHistoryLimit() *int64 {
84return f.Spec.RevisionHistoryLimit
85}
86
87// SetRevisionHistoryLimit of this Function.
88func (f *Function) SetRevisionHistoryLimit(l *int64) {
89f.Spec.RevisionHistoryLimit = l
90}
91
92// GetIgnoreCrossplaneConstraints of this Function.
93func (f *Function) GetIgnoreCrossplaneConstraints() *bool {
94return f.Spec.IgnoreCrossplaneConstraints
95}
96
97// SetIgnoreCrossplaneConstraints of this Function.
98func (f *Function) SetIgnoreCrossplaneConstraints(b *bool) {
99f.Spec.IgnoreCrossplaneConstraints = b
100}
101
102// GetControllerConfigRef of this Function.
103func (f *Function) GetControllerConfigRef() *v1.ControllerConfigReference {
104return nil
105}
106
107// SetControllerConfigRef of this Function.
108func (f *Function) SetControllerConfigRef(*v1.ControllerConfigReference) {}
109
110// GetRuntimeConfigRef of this Function.
111func (f *Function) GetRuntimeConfigRef() *v1.RuntimeConfigReference {
112return f.Spec.RuntimeConfigReference
113}
114
115// SetRuntimeConfigRef of this Function.
116func (f *Function) SetRuntimeConfigRef(r *v1.RuntimeConfigReference) {
117f.Spec.RuntimeConfigReference = r
118}
119
120// GetCurrentRevision of this Function.
121func (f *Function) GetCurrentRevision() string {
122return f.Status.CurrentRevision
123}
124
125// SetCurrentRevision of this Function.
126func (f *Function) SetCurrentRevision(s string) {
127f.Status.CurrentRevision = s
128}
129
130// GetSkipDependencyResolution of this Function.
131func (f *Function) GetSkipDependencyResolution() *bool {
132return f.Spec.SkipDependencyResolution
133}
134
135// SetSkipDependencyResolution of this Function.
136func (f *Function) SetSkipDependencyResolution(b *bool) {
137f.Spec.SkipDependencyResolution = b
138}
139
140// GetCurrentIdentifier of this Function.
141func (f *Function) GetCurrentIdentifier() string {
142return f.Status.CurrentIdentifier
143}
144
145// SetCurrentIdentifier of this Function.
146func (f *Function) SetCurrentIdentifier(s string) {
147f.Status.CurrentIdentifier = s
148}
149
150// GetCommonLabels of this Function.
151func (f *Function) GetCommonLabels() map[string]string {
152return f.Spec.CommonLabels
153}
154
155// SetCommonLabels of this Function.
156func (f *Function) SetCommonLabels(l map[string]string) {
157f.Spec.CommonLabels = l
158}
159
160// GetTLSServerSecretName of this Function.
161func (f *Function) GetTLSServerSecretName() *string {
162return v1.GetSecretNameWithSuffix(f.GetName(), v1.TLSServerSecretNameSuffix)
163}
164
165// GetTLSClientSecretName of this Function.
166func (f *Function) GetTLSClientSecretName() *string {
167return nil
168}
169
170// GetCondition of this FunctionRevision.
171func (r *FunctionRevision) GetCondition(ct xpv1.ConditionType) xpv1.Condition {
172return r.Status.GetCondition(ct)
173}
174
175// SetConditions of this FunctionRevision.
176func (r *FunctionRevision) SetConditions(c ...xpv1.Condition) {
177r.Status.SetConditions(c...)
178}
179
180// CleanConditions removes all conditions
181func (r *FunctionRevision) CleanConditions() {
182r.Status.Conditions = []xpv1.Condition{}
183}
184
185// GetObjects of this FunctionRevision.
186func (r *FunctionRevision) GetObjects() []xpv1.TypedReference {
187return r.Status.ObjectRefs
188}
189
190// SetObjects of this FunctionRevision.
191func (r *FunctionRevision) SetObjects(c []xpv1.TypedReference) {
192r.Status.ObjectRefs = c
193}
194
195// GetSource of this FunctionRevision.
196func (r *FunctionRevision) GetSource() string {
197return r.Spec.Package
198}
199
200// SetSource of this FunctionRevision.
201func (r *FunctionRevision) SetSource(s string) {
202r.Spec.Package = s
203}
204
205// GetPackagePullSecrets of this FunctionRevision.
206func (r *FunctionRevision) GetPackagePullSecrets() []corev1.LocalObjectReference {
207return r.Spec.PackagePullSecrets
208}
209
210// SetPackagePullSecrets of this FunctionRevision.
211func (r *FunctionRevision) SetPackagePullSecrets(s []corev1.LocalObjectReference) {
212r.Spec.PackagePullSecrets = s
213}
214
215// GetPackagePullPolicy of this FunctionRevision.
216func (r *FunctionRevision) GetPackagePullPolicy() *corev1.PullPolicy {
217return r.Spec.PackagePullPolicy
218}
219
220// SetPackagePullPolicy of this FunctionRevision.
221func (r *FunctionRevision) SetPackagePullPolicy(i *corev1.PullPolicy) {
222r.Spec.PackagePullPolicy = i
223}
224
225// GetDesiredState of this FunctionRevision.
226func (r *FunctionRevision) GetDesiredState() v1.PackageRevisionDesiredState {
227return r.Spec.DesiredState
228}
229
230// SetDesiredState of this FunctionRevision.
231func (r *FunctionRevision) SetDesiredState(s v1.PackageRevisionDesiredState) {
232r.Spec.DesiredState = s
233}
234
235// GetRevision of this FunctionRevision.
236func (r *FunctionRevision) GetRevision() int64 {
237return r.Spec.Revision
238}
239
240// SetRevision of this FunctionRevision.
241func (r *FunctionRevision) SetRevision(rev int64) {
242r.Spec.Revision = rev
243}
244
245// GetDependencyStatus of this v.
246func (r *FunctionRevision) GetDependencyStatus() (found, installed, invalid int64) {
247return r.Status.FoundDependencies, r.Status.InstalledDependencies, r.Status.InvalidDependencies
248}
249
250// SetDependencyStatus of this FunctionRevision.
251func (r *FunctionRevision) SetDependencyStatus(found, installed, invalid int64) {
252r.Status.FoundDependencies = found
253r.Status.InstalledDependencies = installed
254r.Status.InvalidDependencies = invalid
255}
256
257// GetIgnoreCrossplaneConstraints of this FunctionRevision.
258func (r *FunctionRevision) GetIgnoreCrossplaneConstraints() *bool {
259return r.Spec.IgnoreCrossplaneConstraints
260}
261
262// SetIgnoreCrossplaneConstraints of this FunctionRevision.
263func (r *FunctionRevision) SetIgnoreCrossplaneConstraints(b *bool) {
264r.Spec.IgnoreCrossplaneConstraints = b
265}
266
267// GetControllerConfigRef of this FunctionRevision.
268func (r *FunctionRevision) GetControllerConfigRef() *v1.ControllerConfigReference {
269return r.Spec.ControllerConfigReference
270}
271
272// SetControllerConfigRef of this FunctionRevision.
273func (r *FunctionRevision) SetControllerConfigRef(ref *v1.ControllerConfigReference) {
274r.Spec.ControllerConfigReference = ref
275}
276
277// GetRuntimeConfigRef of this FunctionRevision.
278func (r *FunctionRevision) GetRuntimeConfigRef() *v1.RuntimeConfigReference {
279return r.Spec.RuntimeConfigReference
280}
281
282// SetRuntimeConfigRef of this FunctionRevision.
283func (r *FunctionRevision) SetRuntimeConfigRef(ref *v1.RuntimeConfigReference) {
284r.Spec.RuntimeConfigReference = ref
285}
286
287// GetSkipDependencyResolution of this FunctionRevision.
288func (r *FunctionRevision) GetSkipDependencyResolution() *bool {
289return r.Spec.SkipDependencyResolution
290}
291
292// SetSkipDependencyResolution of this FunctionRevision.
293func (r *FunctionRevision) SetSkipDependencyResolution(b *bool) {
294r.Spec.SkipDependencyResolution = b
295}
296
297// GetTLSServerSecretName of this FunctionRevision.
298func (r *FunctionRevision) GetTLSServerSecretName() *string {
299return r.Spec.TLSServerSecretName
300}
301
302// SetTLSServerSecretName of this FunctionRevision.
303func (r *FunctionRevision) SetTLSServerSecretName(s *string) {
304r.Spec.TLSServerSecretName = s
305}
306
307// GetTLSClientSecretName of this FunctionRevision.
308func (r *FunctionRevision) GetTLSClientSecretName() *string {
309return r.Spec.TLSClientSecretName
310}
311
312// SetTLSClientSecretName of this FunctionRevision.
313func (r *FunctionRevision) SetTLSClientSecretName(s *string) {
314r.Spec.TLSClientSecretName = s
315}
316
317// GetCommonLabels of this FunctionRevision.
318func (r *FunctionRevision) GetCommonLabels() map[string]string {
319return r.Spec.CommonLabels
320}
321
322// SetCommonLabels of this FunctionRevision.
323func (r *FunctionRevision) SetCommonLabels(l map[string]string) {
324r.Spec.CommonLabels = l
325}
326
327// GetRevisions of this ConfigurationRevisionList.
328func (p *FunctionRevisionList) GetRevisions() []v1.PackageRevision {
329prs := make([]v1.PackageRevision, len(p.Items))
330for i, r := range p.Items {
331r := r // Pin range variable so we can take its address.
332prs[i] = &r
333}
334return prs
335}
336