@@ -42,38 +42,41 @@ import (
42
42
//
43
43
// For *scalar* Go types, the output Go code looks like this:
44
44
//
45
- // if ackcompare.HasNilDifference(a.ko.Spec.GrantFullControl, b.ko.Spec.GrantFullControl) {
46
- // delta.Add("Spec.GrantFullControl", a.ko.Spec.GrantFullControl, b.ko.Spec.GrantFullControl)
47
- // } else if a.ko.Spec.GrantFullControl != nil && b.ko.Spec.GrantFullControl != nil {
48
- // if *a.ko.Spec.GrantFullControl != *b.ko.Spec.GrantFullControl {
49
- // delta.Add("Spec.GrantFullControl", a.ko.Spec.GrantFullControl, b.ko.Spec.GrantFullControl)
50
- // }
51
- // }
45
+ // if ackcompare.HasNilDifference(a.ko.Spec.GrantFullControl, b.ko.Spec.GrantFullControl) {
46
+ // delta.Add("Spec.GrantFullControl", a.ko.Spec.GrantFullControl, b.ko.Spec.GrantFullControl)
47
+ // } else if a.ko.Spec.GrantFullControl != nil && b.ko.Spec.GrantFullControl != nil {
48
+ //
49
+ // if *a.ko.Spec.GrantFullControl != *b.ko.Spec.GrantFullControl {
50
+ // delta.Add("Spec.GrantFullControl", a.ko.Spec.GrantFullControl, b.ko.Spec.GrantFullControl)
51
+ // }
52
+ // }
52
53
//
53
54
// For *struct* Go types, the output Go code looks like this (note that it is a
54
55
// simple recursive-descent output of all the struct's fields...):
55
56
//
56
- // if ackcompare.HasNilDifference(a.ko.Spec.CreateBucketConfiguration, b.ko.Spec.CreateBucketConfiguration) {
57
- // delta.Add("Spec.CreateBucketConfiguration", a.ko.Spec.CreateBucketConfiguration, b.ko.Spec.CreateBucketConfiguration)
58
- // } else if a.ko.Spec.CreateBucketConfiguration != nil && b.ko.Spec.CreateBucketConfiguration != nil {
59
- // if ackcompare.HasNilDifference(a.ko.Spec.CreateBucketConfiguration.LocationConstraint, b.ko.Spec.CreateBucketConfiguration.LocationConstraint) {
60
- // delta.Add("Spec.CreateBucketConfiguration.LocationConstraint", a.ko.Spec.CreateBucketConfiguration.LocationConstraint, b.ko.Spec.CreateBucketConfiguration.LocationConstraint)
61
- // } else if a.ko.Spec.CreateBucketConfiguration.LocationConstraint != nil && b.ko.Spec.CreateBucketConfiguration.LocationConstraint != nil {
62
- // if *a.ko.Spec.CreateBucketConfiguration.LocationConstraint != *b.ko.Spec.CreateBucketConfiguration.LocationConstraint {
63
- // delta.Add("Spec.CreateBucketConfiguration.LocationConstraint", a.ko.Spec.CreateBucketConfiguration.LocationConstraint, b.ko.Spec.CreateBucketConfiguration.LocationConstraint)
64
- // }
65
- // }
66
- // }
57
+ // if ackcompare.HasNilDifference(a.ko.Spec.CreateBucketConfiguration, b.ko.Spec.CreateBucketConfiguration) {
58
+ // delta.Add("Spec.CreateBucketConfiguration", a.ko.Spec.CreateBucketConfiguration, b.ko.Spec.CreateBucketConfiguration)
59
+ // } else if a.ko.Spec.CreateBucketConfiguration != nil && b.ko.Spec.CreateBucketConfiguration != nil {
60
+ //
61
+ // if ackcompare.HasNilDifference(a.ko.Spec.CreateBucketConfiguration.LocationConstraint, b.ko.Spec.CreateBucketConfiguration.LocationConstraint) {
62
+ // delta.Add("Spec.CreateBucketConfiguration.LocationConstraint", a.ko.Spec.CreateBucketConfiguration.LocationConstraint, b.ko.Spec.CreateBucketConfiguration.LocationConstraint)
63
+ // } else if a.ko.Spec.CreateBucketConfiguration.LocationConstraint != nil && b.ko.Spec.CreateBucketConfiguration.LocationConstraint != nil {
64
+ // if *a.ko.Spec.CreateBucketConfiguration.LocationConstraint != *b.ko.Spec.CreateBucketConfiguration.LocationConstraint {
65
+ // delta.Add("Spec.CreateBucketConfiguration.LocationConstraint", a.ko.Spec.CreateBucketConfiguration.LocationConstraint, b.ko.Spec.CreateBucketConfiguration.LocationConstraint)
66
+ // }
67
+ // }
68
+ // }
67
69
//
68
70
// For *slice of strings* Go types, the output Go code looks like this:
69
71
//
70
- // if ackcompare.HasNilDifference(a.ko.Spec.AllowedPublishers, b.ko.Spec.AllowedPublishers) {
71
- // delta.Add("Spec.AllowedPublishers", a.ko.Spec.AllowedPublishers, b.ko.Spec.AllowedPublishers)
72
- // } else if a.ko.Spec.AllowedPublishers != nil && b.ko.Spec.AllowedPublishers != nil {
73
- // if !ackcompare.SliceStringPEqual(a.ko.Spec.AllowedPublishers.SigningProfileVersionARNs, b.ko.Spec.AllowedPublishers.SigningProfileVersionARNs) {
74
- // delta.Add("Spec.AllowedPublishers.SigningProfileVersionARNs", a.ko.Spec.AllowedPublishers.SigningProfileVersionARNs, b.ko.Spec.AllowedPublishers.SigningProfileVersionARNs)
75
- // }
76
- // }
72
+ // if ackcompare.HasNilDifference(a.ko.Spec.AllowedPublishers, b.ko.Spec.AllowedPublishers) {
73
+ // delta.Add("Spec.AllowedPublishers", a.ko.Spec.AllowedPublishers, b.ko.Spec.AllowedPublishers)
74
+ // } else if a.ko.Spec.AllowedPublishers != nil && b.ko.Spec.AllowedPublishers != nil {
75
+ //
76
+ // if !ackcompare.SliceStringPEqual(a.ko.Spec.AllowedPublishers.SigningProfileVersionARNs, b.ko.Spec.AllowedPublishers.SigningProfileVersionARNs) {
77
+ // delta.Add("Spec.AllowedPublishers.SigningProfileVersionARNs", a.ko.Spec.AllowedPublishers.SigningProfileVersionARNs, b.ko.Spec.AllowedPublishers.SigningProfileVersionARNs)
78
+ // }
79
+ // }
77
80
func CompareResource (
78
81
cfg * ackgenconfig.Config ,
79
82
r * model.CRD ,
@@ -238,9 +241,9 @@ func CompareResource(
238
241
//
239
242
// Output code will look something like this:
240
243
//
241
- // if ackcompare.HasNilDifferenceStringP(a.ko.Spec.Name, b.ko.Spec.Name == nil) {
242
- // delta.Add("Spec.Name", a.ko.Spec.Name, b.ko.Spec.Name)
243
- // }
244
+ // if ackcompare.HasNilDifferenceStringP(a.ko.Spec.Name, b.ko.Spec.Name == nil) {
245
+ // delta.Add("Spec.Name", a.ko.Spec.Name, b.ko.Spec.Name)
246
+ // }
244
247
func compareNil (
245
248
// struct informing code generator how to compare the field values
246
249
compareConfig * ackgenconfig.CompareFieldConfig ,
@@ -302,9 +305,9 @@ func compareNil(
302
305
//
303
306
// Output code will look something like this:
304
307
//
305
- // if *a.ko.Spec.Name != *b.ko.Spec.Name) {
306
- // delta.Add("Spec.Name", a.ko.Spec.Name, b.ko.Spec.Name)
307
- // }
308
+ // if *a.ko.Spec.Name != *b.ko.Spec.Name) {
309
+ // delta.Add("Spec.Name", a.ko.Spec.Name, b.ko.Spec.Name)
310
+ // }
308
311
func compareScalar (
309
312
// struct informing code generator how to compare the field values
310
313
compareConfig * ackgenconfig.CompareFieldConfig ,
@@ -372,9 +375,9 @@ func compareScalar(
372
375
//
373
376
// Output code will look something like this:
374
377
//
375
- // if !ackcompare.MapStringStringPEqual(a.ko.Spec.Tags, b.ko.Spec.Tags) {
376
- // delta.Add("Spec.Tags", a.ko.Spec.Tags, b.ko.Spec.Tags)
377
- // }
378
+ // if !ackcompare.MapStringStringPEqual(a.ko.Spec.Tags, b.ko.Spec.Tags) {
379
+ // delta.Add("Spec.Tags", a.ko.Spec.Tags, b.ko.Spec.Tags)
380
+ // }
378
381
func compareMap (
379
382
cfg * ackgenconfig.Config ,
380
383
r * model.CRD ,
@@ -449,9 +452,9 @@ func compareMap(
449
452
//
450
453
// Output code will look something like this:
451
454
//
452
- // if !ackcompare.SliceStringPEqual(a.ko.Spec.SecurityGroupIDs, b.ko.Spec.SecurityGroupIDs) {
453
- // delta.Add("Spec.SecurityGroupIDs", a.ko.Spec.SecurityGroupIDs, b.ko.Spec.SecurityGroupIDs)
454
- // }
455
+ // if !ackcompare.SliceStringPEqual(a.ko.Spec.SecurityGroupIDs, b.ko.Spec.SecurityGroupIDs) {
456
+ // delta.Add("Spec.SecurityGroupIDs", a.ko.Spec.SecurityGroupIDs, b.ko.Spec.SecurityGroupIDs)
457
+ // }
455
458
func compareSlice (
456
459
cfg * ackgenconfig.Config ,
457
460
r * model.CRD ,
0 commit comments