/
delta.go
397 lines (389 loc) · 24.8 KB
/
delta.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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license" file accompanying this file. This file 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.
// Code generated by ack-generate. DO NOT EDIT.
package bucket
import (
"bytes"
"reflect"
ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare"
acktags "github.com/aws-controllers-k8s/runtime/pkg/tags"
)
// Hack to avoid import errors during build...
var (
_ = &bytes.Buffer{}
_ = &reflect.Method{}
_ = &acktags.Tags{}
)
// newResourceDelta returns a new `ackcompare.Delta` used to compare two
// resources
func newResourceDelta(
a *resource,
b *resource,
) *ackcompare.Delta {
delta := ackcompare.NewDelta()
if (a == nil && b != nil) ||
(a != nil && b == nil) {
delta.Add("", a, b)
return delta
}
customPreCompare(a, b)
if ackcompare.HasNilDifference(a.ko.Spec.ACL, b.ko.Spec.ACL) {
delta.Add("Spec.ACL", a.ko.Spec.ACL, b.ko.Spec.ACL)
} else if a.ko.Spec.ACL != nil && b.ko.Spec.ACL != nil {
if *a.ko.Spec.ACL != *b.ko.Spec.ACL {
delta.Add("Spec.ACL", a.ko.Spec.ACL, b.ko.Spec.ACL)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.Accelerate, b.ko.Spec.Accelerate) {
delta.Add("Spec.Accelerate", a.ko.Spec.Accelerate, b.ko.Spec.Accelerate)
} else if a.ko.Spec.Accelerate != nil && b.ko.Spec.Accelerate != nil {
if ackcompare.HasNilDifference(a.ko.Spec.Accelerate.Status, b.ko.Spec.Accelerate.Status) {
delta.Add("Spec.Accelerate.Status", a.ko.Spec.Accelerate.Status, b.ko.Spec.Accelerate.Status)
} else if a.ko.Spec.Accelerate.Status != nil && b.ko.Spec.Accelerate.Status != nil {
if *a.ko.Spec.Accelerate.Status != *b.ko.Spec.Accelerate.Status {
delta.Add("Spec.Accelerate.Status", a.ko.Spec.Accelerate.Status, b.ko.Spec.Accelerate.Status)
}
}
}
if len(a.ko.Spec.Analytics) != len(b.ko.Spec.Analytics) {
delta.Add("Spec.Analytics", a.ko.Spec.Analytics, b.ko.Spec.Analytics)
} else if len(a.ko.Spec.Analytics) > 0 {
if !reflect.DeepEqual(a.ko.Spec.Analytics, b.ko.Spec.Analytics) {
delta.Add("Spec.Analytics", a.ko.Spec.Analytics, b.ko.Spec.Analytics)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.CORS, b.ko.Spec.CORS) {
delta.Add("Spec.CORS", a.ko.Spec.CORS, b.ko.Spec.CORS)
} else if a.ko.Spec.CORS != nil && b.ko.Spec.CORS != nil {
if len(a.ko.Spec.CORS.CORSRules) != len(b.ko.Spec.CORS.CORSRules) {
delta.Add("Spec.CORS.CORSRules", a.ko.Spec.CORS.CORSRules, b.ko.Spec.CORS.CORSRules)
} else if len(a.ko.Spec.CORS.CORSRules) > 0 {
if !reflect.DeepEqual(a.ko.Spec.CORS.CORSRules, b.ko.Spec.CORS.CORSRules) {
delta.Add("Spec.CORS.CORSRules", a.ko.Spec.CORS.CORSRules, b.ko.Spec.CORS.CORSRules)
}
}
}
if ackcompare.HasNilDifference(a.ko.Spec.CreateBucketConfiguration, b.ko.Spec.CreateBucketConfiguration) {
delta.Add("Spec.CreateBucketConfiguration", a.ko.Spec.CreateBucketConfiguration, b.ko.Spec.CreateBucketConfiguration)
} else if a.ko.Spec.CreateBucketConfiguration != nil && b.ko.Spec.CreateBucketConfiguration != nil {
if ackcompare.HasNilDifference(a.ko.Spec.CreateBucketConfiguration.LocationConstraint, b.ko.Spec.CreateBucketConfiguration.LocationConstraint) {
delta.Add("Spec.CreateBucketConfiguration.LocationConstraint", a.ko.Spec.CreateBucketConfiguration.LocationConstraint, b.ko.Spec.CreateBucketConfiguration.LocationConstraint)
} else if a.ko.Spec.CreateBucketConfiguration.LocationConstraint != nil && b.ko.Spec.CreateBucketConfiguration.LocationConstraint != nil {
if *a.ko.Spec.CreateBucketConfiguration.LocationConstraint != *b.ko.Spec.CreateBucketConfiguration.LocationConstraint {
delta.Add("Spec.CreateBucketConfiguration.LocationConstraint", a.ko.Spec.CreateBucketConfiguration.LocationConstraint, b.ko.Spec.CreateBucketConfiguration.LocationConstraint)
}
}
}
if ackcompare.HasNilDifference(a.ko.Spec.Encryption, b.ko.Spec.Encryption) {
delta.Add("Spec.Encryption", a.ko.Spec.Encryption, b.ko.Spec.Encryption)
} else if a.ko.Spec.Encryption != nil && b.ko.Spec.Encryption != nil {
if len(a.ko.Spec.Encryption.Rules) != len(b.ko.Spec.Encryption.Rules) {
delta.Add("Spec.Encryption.Rules", a.ko.Spec.Encryption.Rules, b.ko.Spec.Encryption.Rules)
} else if len(a.ko.Spec.Encryption.Rules) > 0 {
if !reflect.DeepEqual(a.ko.Spec.Encryption.Rules, b.ko.Spec.Encryption.Rules) {
delta.Add("Spec.Encryption.Rules", a.ko.Spec.Encryption.Rules, b.ko.Spec.Encryption.Rules)
}
}
}
if ackcompare.HasNilDifference(a.ko.Spec.GrantFullControl, b.ko.Spec.GrantFullControl) {
delta.Add("Spec.GrantFullControl", a.ko.Spec.GrantFullControl, b.ko.Spec.GrantFullControl)
} else if a.ko.Spec.GrantFullControl != nil && b.ko.Spec.GrantFullControl != nil {
if *a.ko.Spec.GrantFullControl != *b.ko.Spec.GrantFullControl {
delta.Add("Spec.GrantFullControl", a.ko.Spec.GrantFullControl, b.ko.Spec.GrantFullControl)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.GrantRead, b.ko.Spec.GrantRead) {
delta.Add("Spec.GrantRead", a.ko.Spec.GrantRead, b.ko.Spec.GrantRead)
} else if a.ko.Spec.GrantRead != nil && b.ko.Spec.GrantRead != nil {
if *a.ko.Spec.GrantRead != *b.ko.Spec.GrantRead {
delta.Add("Spec.GrantRead", a.ko.Spec.GrantRead, b.ko.Spec.GrantRead)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.GrantReadACP, b.ko.Spec.GrantReadACP) {
delta.Add("Spec.GrantReadACP", a.ko.Spec.GrantReadACP, b.ko.Spec.GrantReadACP)
} else if a.ko.Spec.GrantReadACP != nil && b.ko.Spec.GrantReadACP != nil {
if *a.ko.Spec.GrantReadACP != *b.ko.Spec.GrantReadACP {
delta.Add("Spec.GrantReadACP", a.ko.Spec.GrantReadACP, b.ko.Spec.GrantReadACP)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.GrantWrite, b.ko.Spec.GrantWrite) {
delta.Add("Spec.GrantWrite", a.ko.Spec.GrantWrite, b.ko.Spec.GrantWrite)
} else if a.ko.Spec.GrantWrite != nil && b.ko.Spec.GrantWrite != nil {
if *a.ko.Spec.GrantWrite != *b.ko.Spec.GrantWrite {
delta.Add("Spec.GrantWrite", a.ko.Spec.GrantWrite, b.ko.Spec.GrantWrite)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.GrantWriteACP, b.ko.Spec.GrantWriteACP) {
delta.Add("Spec.GrantWriteACP", a.ko.Spec.GrantWriteACP, b.ko.Spec.GrantWriteACP)
} else if a.ko.Spec.GrantWriteACP != nil && b.ko.Spec.GrantWriteACP != nil {
if *a.ko.Spec.GrantWriteACP != *b.ko.Spec.GrantWriteACP {
delta.Add("Spec.GrantWriteACP", a.ko.Spec.GrantWriteACP, b.ko.Spec.GrantWriteACP)
}
}
if len(a.ko.Spec.IntelligentTiering) != len(b.ko.Spec.IntelligentTiering) {
delta.Add("Spec.IntelligentTiering", a.ko.Spec.IntelligentTiering, b.ko.Spec.IntelligentTiering)
} else if len(a.ko.Spec.IntelligentTiering) > 0 {
if !reflect.DeepEqual(a.ko.Spec.IntelligentTiering, b.ko.Spec.IntelligentTiering) {
delta.Add("Spec.IntelligentTiering", a.ko.Spec.IntelligentTiering, b.ko.Spec.IntelligentTiering)
}
}
if len(a.ko.Spec.Inventory) != len(b.ko.Spec.Inventory) {
delta.Add("Spec.Inventory", a.ko.Spec.Inventory, b.ko.Spec.Inventory)
} else if len(a.ko.Spec.Inventory) > 0 {
if !reflect.DeepEqual(a.ko.Spec.Inventory, b.ko.Spec.Inventory) {
delta.Add("Spec.Inventory", a.ko.Spec.Inventory, b.ko.Spec.Inventory)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.Lifecycle, b.ko.Spec.Lifecycle) {
delta.Add("Spec.Lifecycle", a.ko.Spec.Lifecycle, b.ko.Spec.Lifecycle)
} else if a.ko.Spec.Lifecycle != nil && b.ko.Spec.Lifecycle != nil {
if len(a.ko.Spec.Lifecycle.Rules) != len(b.ko.Spec.Lifecycle.Rules) {
delta.Add("Spec.Lifecycle.Rules", a.ko.Spec.Lifecycle.Rules, b.ko.Spec.Lifecycle.Rules)
} else if len(a.ko.Spec.Lifecycle.Rules) > 0 {
if !reflect.DeepEqual(a.ko.Spec.Lifecycle.Rules, b.ko.Spec.Lifecycle.Rules) {
delta.Add("Spec.Lifecycle.Rules", a.ko.Spec.Lifecycle.Rules, b.ko.Spec.Lifecycle.Rules)
}
}
}
if ackcompare.HasNilDifference(a.ko.Spec.Logging, b.ko.Spec.Logging) {
delta.Add("Spec.Logging", a.ko.Spec.Logging, b.ko.Spec.Logging)
} else if a.ko.Spec.Logging != nil && b.ko.Spec.Logging != nil {
if ackcompare.HasNilDifference(a.ko.Spec.Logging.LoggingEnabled, b.ko.Spec.Logging.LoggingEnabled) {
delta.Add("Spec.Logging.LoggingEnabled", a.ko.Spec.Logging.LoggingEnabled, b.ko.Spec.Logging.LoggingEnabled)
} else if a.ko.Spec.Logging.LoggingEnabled != nil && b.ko.Spec.Logging.LoggingEnabled != nil {
if ackcompare.HasNilDifference(a.ko.Spec.Logging.LoggingEnabled.TargetBucket, b.ko.Spec.Logging.LoggingEnabled.TargetBucket) {
delta.Add("Spec.Logging.LoggingEnabled.TargetBucket", a.ko.Spec.Logging.LoggingEnabled.TargetBucket, b.ko.Spec.Logging.LoggingEnabled.TargetBucket)
} else if a.ko.Spec.Logging.LoggingEnabled.TargetBucket != nil && b.ko.Spec.Logging.LoggingEnabled.TargetBucket != nil {
if *a.ko.Spec.Logging.LoggingEnabled.TargetBucket != *b.ko.Spec.Logging.LoggingEnabled.TargetBucket {
delta.Add("Spec.Logging.LoggingEnabled.TargetBucket", a.ko.Spec.Logging.LoggingEnabled.TargetBucket, b.ko.Spec.Logging.LoggingEnabled.TargetBucket)
}
}
if len(a.ko.Spec.Logging.LoggingEnabled.TargetGrants) != len(b.ko.Spec.Logging.LoggingEnabled.TargetGrants) {
delta.Add("Spec.Logging.LoggingEnabled.TargetGrants", a.ko.Spec.Logging.LoggingEnabled.TargetGrants, b.ko.Spec.Logging.LoggingEnabled.TargetGrants)
} else if len(a.ko.Spec.Logging.LoggingEnabled.TargetGrants) > 0 {
if !reflect.DeepEqual(a.ko.Spec.Logging.LoggingEnabled.TargetGrants, b.ko.Spec.Logging.LoggingEnabled.TargetGrants) {
delta.Add("Spec.Logging.LoggingEnabled.TargetGrants", a.ko.Spec.Logging.LoggingEnabled.TargetGrants, b.ko.Spec.Logging.LoggingEnabled.TargetGrants)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.Logging.LoggingEnabled.TargetPrefix, b.ko.Spec.Logging.LoggingEnabled.TargetPrefix) {
delta.Add("Spec.Logging.LoggingEnabled.TargetPrefix", a.ko.Spec.Logging.LoggingEnabled.TargetPrefix, b.ko.Spec.Logging.LoggingEnabled.TargetPrefix)
} else if a.ko.Spec.Logging.LoggingEnabled.TargetPrefix != nil && b.ko.Spec.Logging.LoggingEnabled.TargetPrefix != nil {
if *a.ko.Spec.Logging.LoggingEnabled.TargetPrefix != *b.ko.Spec.Logging.LoggingEnabled.TargetPrefix {
delta.Add("Spec.Logging.LoggingEnabled.TargetPrefix", a.ko.Spec.Logging.LoggingEnabled.TargetPrefix, b.ko.Spec.Logging.LoggingEnabled.TargetPrefix)
}
}
}
}
if len(a.ko.Spec.Metrics) != len(b.ko.Spec.Metrics) {
delta.Add("Spec.Metrics", a.ko.Spec.Metrics, b.ko.Spec.Metrics)
} else if len(a.ko.Spec.Metrics) > 0 {
if !reflect.DeepEqual(a.ko.Spec.Metrics, b.ko.Spec.Metrics) {
delta.Add("Spec.Metrics", a.ko.Spec.Metrics, b.ko.Spec.Metrics)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.Name, b.ko.Spec.Name) {
delta.Add("Spec.Name", a.ko.Spec.Name, b.ko.Spec.Name)
} else if a.ko.Spec.Name != nil && b.ko.Spec.Name != nil {
if *a.ko.Spec.Name != *b.ko.Spec.Name {
delta.Add("Spec.Name", a.ko.Spec.Name, b.ko.Spec.Name)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.Notification, b.ko.Spec.Notification) {
delta.Add("Spec.Notification", a.ko.Spec.Notification, b.ko.Spec.Notification)
} else if a.ko.Spec.Notification != nil && b.ko.Spec.Notification != nil {
if len(a.ko.Spec.Notification.LambdaFunctionConfigurations) != len(b.ko.Spec.Notification.LambdaFunctionConfigurations) {
delta.Add("Spec.Notification.LambdaFunctionConfigurations", a.ko.Spec.Notification.LambdaFunctionConfigurations, b.ko.Spec.Notification.LambdaFunctionConfigurations)
} else if len(a.ko.Spec.Notification.LambdaFunctionConfigurations) > 0 {
if !reflect.DeepEqual(a.ko.Spec.Notification.LambdaFunctionConfigurations, b.ko.Spec.Notification.LambdaFunctionConfigurations) {
delta.Add("Spec.Notification.LambdaFunctionConfigurations", a.ko.Spec.Notification.LambdaFunctionConfigurations, b.ko.Spec.Notification.LambdaFunctionConfigurations)
}
}
if len(a.ko.Spec.Notification.QueueConfigurations) != len(b.ko.Spec.Notification.QueueConfigurations) {
delta.Add("Spec.Notification.QueueConfigurations", a.ko.Spec.Notification.QueueConfigurations, b.ko.Spec.Notification.QueueConfigurations)
} else if len(a.ko.Spec.Notification.QueueConfigurations) > 0 {
if !reflect.DeepEqual(a.ko.Spec.Notification.QueueConfigurations, b.ko.Spec.Notification.QueueConfigurations) {
delta.Add("Spec.Notification.QueueConfigurations", a.ko.Spec.Notification.QueueConfigurations, b.ko.Spec.Notification.QueueConfigurations)
}
}
if len(a.ko.Spec.Notification.TopicConfigurations) != len(b.ko.Spec.Notification.TopicConfigurations) {
delta.Add("Spec.Notification.TopicConfigurations", a.ko.Spec.Notification.TopicConfigurations, b.ko.Spec.Notification.TopicConfigurations)
} else if len(a.ko.Spec.Notification.TopicConfigurations) > 0 {
if !reflect.DeepEqual(a.ko.Spec.Notification.TopicConfigurations, b.ko.Spec.Notification.TopicConfigurations) {
delta.Add("Spec.Notification.TopicConfigurations", a.ko.Spec.Notification.TopicConfigurations, b.ko.Spec.Notification.TopicConfigurations)
}
}
}
if ackcompare.HasNilDifference(a.ko.Spec.ObjectLockEnabledForBucket, b.ko.Spec.ObjectLockEnabledForBucket) {
delta.Add("Spec.ObjectLockEnabledForBucket", a.ko.Spec.ObjectLockEnabledForBucket, b.ko.Spec.ObjectLockEnabledForBucket)
} else if a.ko.Spec.ObjectLockEnabledForBucket != nil && b.ko.Spec.ObjectLockEnabledForBucket != nil {
if *a.ko.Spec.ObjectLockEnabledForBucket != *b.ko.Spec.ObjectLockEnabledForBucket {
delta.Add("Spec.ObjectLockEnabledForBucket", a.ko.Spec.ObjectLockEnabledForBucket, b.ko.Spec.ObjectLockEnabledForBucket)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.ObjectOwnership, b.ko.Spec.ObjectOwnership) {
delta.Add("Spec.ObjectOwnership", a.ko.Spec.ObjectOwnership, b.ko.Spec.ObjectOwnership)
} else if a.ko.Spec.ObjectOwnership != nil && b.ko.Spec.ObjectOwnership != nil {
if *a.ko.Spec.ObjectOwnership != *b.ko.Spec.ObjectOwnership {
delta.Add("Spec.ObjectOwnership", a.ko.Spec.ObjectOwnership, b.ko.Spec.ObjectOwnership)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.OwnershipControls, b.ko.Spec.OwnershipControls) {
delta.Add("Spec.OwnershipControls", a.ko.Spec.OwnershipControls, b.ko.Spec.OwnershipControls)
} else if a.ko.Spec.OwnershipControls != nil && b.ko.Spec.OwnershipControls != nil {
if len(a.ko.Spec.OwnershipControls.Rules) != len(b.ko.Spec.OwnershipControls.Rules) {
delta.Add("Spec.OwnershipControls.Rules", a.ko.Spec.OwnershipControls.Rules, b.ko.Spec.OwnershipControls.Rules)
} else if len(a.ko.Spec.OwnershipControls.Rules) > 0 {
if !reflect.DeepEqual(a.ko.Spec.OwnershipControls.Rules, b.ko.Spec.OwnershipControls.Rules) {
delta.Add("Spec.OwnershipControls.Rules", a.ko.Spec.OwnershipControls.Rules, b.ko.Spec.OwnershipControls.Rules)
}
}
}
if ackcompare.HasNilDifference(a.ko.Spec.Policy, b.ko.Spec.Policy) {
delta.Add("Spec.Policy", a.ko.Spec.Policy, b.ko.Spec.Policy)
} else if a.ko.Spec.Policy != nil && b.ko.Spec.Policy != nil {
if *a.ko.Spec.Policy != *b.ko.Spec.Policy {
delta.Add("Spec.Policy", a.ko.Spec.Policy, b.ko.Spec.Policy)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.PublicAccessBlock, b.ko.Spec.PublicAccessBlock) {
delta.Add("Spec.PublicAccessBlock", a.ko.Spec.PublicAccessBlock, b.ko.Spec.PublicAccessBlock)
} else if a.ko.Spec.PublicAccessBlock != nil && b.ko.Spec.PublicAccessBlock != nil {
if ackcompare.HasNilDifference(a.ko.Spec.PublicAccessBlock.BlockPublicACLs, b.ko.Spec.PublicAccessBlock.BlockPublicACLs) {
delta.Add("Spec.PublicAccessBlock.BlockPublicACLs", a.ko.Spec.PublicAccessBlock.BlockPublicACLs, b.ko.Spec.PublicAccessBlock.BlockPublicACLs)
} else if a.ko.Spec.PublicAccessBlock.BlockPublicACLs != nil && b.ko.Spec.PublicAccessBlock.BlockPublicACLs != nil {
if *a.ko.Spec.PublicAccessBlock.BlockPublicACLs != *b.ko.Spec.PublicAccessBlock.BlockPublicACLs {
delta.Add("Spec.PublicAccessBlock.BlockPublicACLs", a.ko.Spec.PublicAccessBlock.BlockPublicACLs, b.ko.Spec.PublicAccessBlock.BlockPublicACLs)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.PublicAccessBlock.BlockPublicPolicy, b.ko.Spec.PublicAccessBlock.BlockPublicPolicy) {
delta.Add("Spec.PublicAccessBlock.BlockPublicPolicy", a.ko.Spec.PublicAccessBlock.BlockPublicPolicy, b.ko.Spec.PublicAccessBlock.BlockPublicPolicy)
} else if a.ko.Spec.PublicAccessBlock.BlockPublicPolicy != nil && b.ko.Spec.PublicAccessBlock.BlockPublicPolicy != nil {
if *a.ko.Spec.PublicAccessBlock.BlockPublicPolicy != *b.ko.Spec.PublicAccessBlock.BlockPublicPolicy {
delta.Add("Spec.PublicAccessBlock.BlockPublicPolicy", a.ko.Spec.PublicAccessBlock.BlockPublicPolicy, b.ko.Spec.PublicAccessBlock.BlockPublicPolicy)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.PublicAccessBlock.IgnorePublicACLs, b.ko.Spec.PublicAccessBlock.IgnorePublicACLs) {
delta.Add("Spec.PublicAccessBlock.IgnorePublicACLs", a.ko.Spec.PublicAccessBlock.IgnorePublicACLs, b.ko.Spec.PublicAccessBlock.IgnorePublicACLs)
} else if a.ko.Spec.PublicAccessBlock.IgnorePublicACLs != nil && b.ko.Spec.PublicAccessBlock.IgnorePublicACLs != nil {
if *a.ko.Spec.PublicAccessBlock.IgnorePublicACLs != *b.ko.Spec.PublicAccessBlock.IgnorePublicACLs {
delta.Add("Spec.PublicAccessBlock.IgnorePublicACLs", a.ko.Spec.PublicAccessBlock.IgnorePublicACLs, b.ko.Spec.PublicAccessBlock.IgnorePublicACLs)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.PublicAccessBlock.RestrictPublicBuckets, b.ko.Spec.PublicAccessBlock.RestrictPublicBuckets) {
delta.Add("Spec.PublicAccessBlock.RestrictPublicBuckets", a.ko.Spec.PublicAccessBlock.RestrictPublicBuckets, b.ko.Spec.PublicAccessBlock.RestrictPublicBuckets)
} else if a.ko.Spec.PublicAccessBlock.RestrictPublicBuckets != nil && b.ko.Spec.PublicAccessBlock.RestrictPublicBuckets != nil {
if *a.ko.Spec.PublicAccessBlock.RestrictPublicBuckets != *b.ko.Spec.PublicAccessBlock.RestrictPublicBuckets {
delta.Add("Spec.PublicAccessBlock.RestrictPublicBuckets", a.ko.Spec.PublicAccessBlock.RestrictPublicBuckets, b.ko.Spec.PublicAccessBlock.RestrictPublicBuckets)
}
}
}
if ackcompare.HasNilDifference(a.ko.Spec.Replication, b.ko.Spec.Replication) {
delta.Add("Spec.Replication", a.ko.Spec.Replication, b.ko.Spec.Replication)
} else if a.ko.Spec.Replication != nil && b.ko.Spec.Replication != nil {
if ackcompare.HasNilDifference(a.ko.Spec.Replication.Role, b.ko.Spec.Replication.Role) {
delta.Add("Spec.Replication.Role", a.ko.Spec.Replication.Role, b.ko.Spec.Replication.Role)
} else if a.ko.Spec.Replication.Role != nil && b.ko.Spec.Replication.Role != nil {
if *a.ko.Spec.Replication.Role != *b.ko.Spec.Replication.Role {
delta.Add("Spec.Replication.Role", a.ko.Spec.Replication.Role, b.ko.Spec.Replication.Role)
}
}
if len(a.ko.Spec.Replication.Rules) != len(b.ko.Spec.Replication.Rules) {
delta.Add("Spec.Replication.Rules", a.ko.Spec.Replication.Rules, b.ko.Spec.Replication.Rules)
} else if len(a.ko.Spec.Replication.Rules) > 0 {
if !reflect.DeepEqual(a.ko.Spec.Replication.Rules, b.ko.Spec.Replication.Rules) {
delta.Add("Spec.Replication.Rules", a.ko.Spec.Replication.Rules, b.ko.Spec.Replication.Rules)
}
}
}
if ackcompare.HasNilDifference(a.ko.Spec.RequestPayment, b.ko.Spec.RequestPayment) {
delta.Add("Spec.RequestPayment", a.ko.Spec.RequestPayment, b.ko.Spec.RequestPayment)
} else if a.ko.Spec.RequestPayment != nil && b.ko.Spec.RequestPayment != nil {
if ackcompare.HasNilDifference(a.ko.Spec.RequestPayment.Payer, b.ko.Spec.RequestPayment.Payer) {
delta.Add("Spec.RequestPayment.Payer", a.ko.Spec.RequestPayment.Payer, b.ko.Spec.RequestPayment.Payer)
} else if a.ko.Spec.RequestPayment.Payer != nil && b.ko.Spec.RequestPayment.Payer != nil {
if *a.ko.Spec.RequestPayment.Payer != *b.ko.Spec.RequestPayment.Payer {
delta.Add("Spec.RequestPayment.Payer", a.ko.Spec.RequestPayment.Payer, b.ko.Spec.RequestPayment.Payer)
}
}
}
if ackcompare.HasNilDifference(a.ko.Spec.Tagging, b.ko.Spec.Tagging) {
delta.Add("Spec.Tagging", a.ko.Spec.Tagging, b.ko.Spec.Tagging)
} else if a.ko.Spec.Tagging != nil && b.ko.Spec.Tagging != nil {
if !ackcompare.MapStringStringEqual(ToACKTags(a.ko.Spec.Tagging.TagSet), ToACKTags(b.ko.Spec.Tagging.TagSet)) {
delta.Add("Spec.Tagging", a.ko.Spec.Tagging.TagSet, b.ko.Spec.Tagging.TagSet)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.Versioning, b.ko.Spec.Versioning) {
delta.Add("Spec.Versioning", a.ko.Spec.Versioning, b.ko.Spec.Versioning)
} else if a.ko.Spec.Versioning != nil && b.ko.Spec.Versioning != nil {
if ackcompare.HasNilDifference(a.ko.Spec.Versioning.Status, b.ko.Spec.Versioning.Status) {
delta.Add("Spec.Versioning.Status", a.ko.Spec.Versioning.Status, b.ko.Spec.Versioning.Status)
} else if a.ko.Spec.Versioning.Status != nil && b.ko.Spec.Versioning.Status != nil {
if *a.ko.Spec.Versioning.Status != *b.ko.Spec.Versioning.Status {
delta.Add("Spec.Versioning.Status", a.ko.Spec.Versioning.Status, b.ko.Spec.Versioning.Status)
}
}
}
if ackcompare.HasNilDifference(a.ko.Spec.Website, b.ko.Spec.Website) {
delta.Add("Spec.Website", a.ko.Spec.Website, b.ko.Spec.Website)
} else if a.ko.Spec.Website != nil && b.ko.Spec.Website != nil {
if ackcompare.HasNilDifference(a.ko.Spec.Website.ErrorDocument, b.ko.Spec.Website.ErrorDocument) {
delta.Add("Spec.Website.ErrorDocument", a.ko.Spec.Website.ErrorDocument, b.ko.Spec.Website.ErrorDocument)
} else if a.ko.Spec.Website.ErrorDocument != nil && b.ko.Spec.Website.ErrorDocument != nil {
if ackcompare.HasNilDifference(a.ko.Spec.Website.ErrorDocument.Key, b.ko.Spec.Website.ErrorDocument.Key) {
delta.Add("Spec.Website.ErrorDocument.Key", a.ko.Spec.Website.ErrorDocument.Key, b.ko.Spec.Website.ErrorDocument.Key)
} else if a.ko.Spec.Website.ErrorDocument.Key != nil && b.ko.Spec.Website.ErrorDocument.Key != nil {
if *a.ko.Spec.Website.ErrorDocument.Key != *b.ko.Spec.Website.ErrorDocument.Key {
delta.Add("Spec.Website.ErrorDocument.Key", a.ko.Spec.Website.ErrorDocument.Key, b.ko.Spec.Website.ErrorDocument.Key)
}
}
}
if ackcompare.HasNilDifference(a.ko.Spec.Website.IndexDocument, b.ko.Spec.Website.IndexDocument) {
delta.Add("Spec.Website.IndexDocument", a.ko.Spec.Website.IndexDocument, b.ko.Spec.Website.IndexDocument)
} else if a.ko.Spec.Website.IndexDocument != nil && b.ko.Spec.Website.IndexDocument != nil {
if ackcompare.HasNilDifference(a.ko.Spec.Website.IndexDocument.Suffix, b.ko.Spec.Website.IndexDocument.Suffix) {
delta.Add("Spec.Website.IndexDocument.Suffix", a.ko.Spec.Website.IndexDocument.Suffix, b.ko.Spec.Website.IndexDocument.Suffix)
} else if a.ko.Spec.Website.IndexDocument.Suffix != nil && b.ko.Spec.Website.IndexDocument.Suffix != nil {
if *a.ko.Spec.Website.IndexDocument.Suffix != *b.ko.Spec.Website.IndexDocument.Suffix {
delta.Add("Spec.Website.IndexDocument.Suffix", a.ko.Spec.Website.IndexDocument.Suffix, b.ko.Spec.Website.IndexDocument.Suffix)
}
}
}
if ackcompare.HasNilDifference(a.ko.Spec.Website.RedirectAllRequestsTo, b.ko.Spec.Website.RedirectAllRequestsTo) {
delta.Add("Spec.Website.RedirectAllRequestsTo", a.ko.Spec.Website.RedirectAllRequestsTo, b.ko.Spec.Website.RedirectAllRequestsTo)
} else if a.ko.Spec.Website.RedirectAllRequestsTo != nil && b.ko.Spec.Website.RedirectAllRequestsTo != nil {
if ackcompare.HasNilDifference(a.ko.Spec.Website.RedirectAllRequestsTo.HostName, b.ko.Spec.Website.RedirectAllRequestsTo.HostName) {
delta.Add("Spec.Website.RedirectAllRequestsTo.HostName", a.ko.Spec.Website.RedirectAllRequestsTo.HostName, b.ko.Spec.Website.RedirectAllRequestsTo.HostName)
} else if a.ko.Spec.Website.RedirectAllRequestsTo.HostName != nil && b.ko.Spec.Website.RedirectAllRequestsTo.HostName != nil {
if *a.ko.Spec.Website.RedirectAllRequestsTo.HostName != *b.ko.Spec.Website.RedirectAllRequestsTo.HostName {
delta.Add("Spec.Website.RedirectAllRequestsTo.HostName", a.ko.Spec.Website.RedirectAllRequestsTo.HostName, b.ko.Spec.Website.RedirectAllRequestsTo.HostName)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.Website.RedirectAllRequestsTo.Protocol, b.ko.Spec.Website.RedirectAllRequestsTo.Protocol) {
delta.Add("Spec.Website.RedirectAllRequestsTo.Protocol", a.ko.Spec.Website.RedirectAllRequestsTo.Protocol, b.ko.Spec.Website.RedirectAllRequestsTo.Protocol)
} else if a.ko.Spec.Website.RedirectAllRequestsTo.Protocol != nil && b.ko.Spec.Website.RedirectAllRequestsTo.Protocol != nil {
if *a.ko.Spec.Website.RedirectAllRequestsTo.Protocol != *b.ko.Spec.Website.RedirectAllRequestsTo.Protocol {
delta.Add("Spec.Website.RedirectAllRequestsTo.Protocol", a.ko.Spec.Website.RedirectAllRequestsTo.Protocol, b.ko.Spec.Website.RedirectAllRequestsTo.Protocol)
}
}
}
if len(a.ko.Spec.Website.RoutingRules) != len(b.ko.Spec.Website.RoutingRules) {
delta.Add("Spec.Website.RoutingRules", a.ko.Spec.Website.RoutingRules, b.ko.Spec.Website.RoutingRules)
} else if len(a.ko.Spec.Website.RoutingRules) > 0 {
if !reflect.DeepEqual(a.ko.Spec.Website.RoutingRules, b.ko.Spec.Website.RoutingRules) {
delta.Add("Spec.Website.RoutingRules", a.ko.Spec.Website.RoutingRules, b.ko.Spec.Website.RoutingRules)
}
}
}
return delta
}