@@ -42,38 +42,41 @@ import (
4242//
4343// For *scalar* Go types, the output Go code looks like this:
4444//
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+ // }
5253//
5354// For *struct* Go types, the output Go code looks like this (note that it is a
5455// simple recursive-descent output of all the struct's fields...):
5556//
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+ // }
6769//
6870// For *slice of strings* Go types, the output Go code looks like this:
6971//
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+ // }
7780func CompareResource (
7881 cfg * ackgenconfig.Config ,
7982 r * model.CRD ,
@@ -238,9 +241,9 @@ func CompareResource(
238241//
239242// Output code will look something like this:
240243//
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+ // }
244247func compareNil (
245248 // struct informing code generator how to compare the field values
246249 compareConfig * ackgenconfig.CompareFieldConfig ,
@@ -302,9 +305,9 @@ func compareNil(
302305//
303306// Output code will look something like this:
304307//
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+ // }
308311func compareScalar (
309312 // struct informing code generator how to compare the field values
310313 compareConfig * ackgenconfig.CompareFieldConfig ,
@@ -372,9 +375,9 @@ func compareScalar(
372375//
373376// Output code will look something like this:
374377//
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+ // }
378381func compareMap (
379382 cfg * ackgenconfig.Config ,
380383 r * model.CRD ,
@@ -449,9 +452,9 @@ func compareMap(
449452//
450453// Output code will look something like this:
451454//
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+ // }
455458func compareSlice (
456459 cfg * ackgenconfig.Config ,
457460 r * model.CRD ,
0 commit comments