diff --git a/go.mod b/go.mod index 2cc0dfd730..315fa7880a 100644 --- a/go.mod +++ b/go.mod @@ -28,15 +28,14 @@ require ( github.com/aws/aws-sdk-go-v2/service/sqs v1.14.0 github.com/aws/aws-sdk-go-v2/service/sts v1.12.0 github.com/aws/smithy-go v1.13.3 - github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df github.com/crossplane/crossplane-runtime v0.20.0 github.com/crossplane/crossplane-tools v0.0.0-20230714144037-2684f4bc7638 github.com/evanphx/json-patch v4.12.0+incompatible github.com/go-ini/ini v1.67.0 github.com/golang/mock v1.5.0 github.com/google/go-cmp v0.5.9 + github.com/jmattheis/goverter v0.18.0 github.com/mattbaird/jsonpatch v0.0.0-20200820163806-098863c1fc24 - github.com/mitchellh/copystructure v1.0.0 github.com/onsi/gomega v1.27.7 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.15.1 @@ -70,7 +69,7 @@ require ( github.com/blang/semver/v4 v4.0.0 // indirect github.com/cenkalti/backoff/v3 v3.0.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/dave/jennifer v1.4.1 // indirect + github.com/dave/jennifer v1.6.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dlclark/regexp2 v1.4.0 // indirect github.com/emicklei/go-restful/v3 v3.10.2 // indirect @@ -117,7 +116,6 @@ require ( github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/mitchellh/reflectwalk v1.0.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect diff --git a/go.sum b/go.sum index 7fbd8da796..ae567b2fe1 100644 --- a/go.sum +++ b/go.sum @@ -173,8 +173,6 @@ github.com/aws/smithy-go v1.11.2/go.mod h1:3xHYmszWVx2c0kIwQeEVf9uSm4fYZt67FBJnw github.com/aws/smithy-go v1.12.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.13.3 h1:l7LYxGuzK6/K+NzJ2mC+VvLUbae0sL3bXU//04MkmnA= github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df h1:GSoSVRLoBaFpOOds6QyY1L8AX7uoY+Ln3BHc22W40X0= -github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df/go.mod h1:hiVxq5OP2bUGBRNS3Z/bt/reCLFNbdcST6gISi1fiOM= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -225,8 +223,15 @@ github.com/crossplane/crossplane-runtime v0.20.0 h1:MlPNrK6ELKLQdeHaIdKxQpZW2LSi github.com/crossplane/crossplane-runtime v0.20.0/go.mod h1:FuKIC8Mg8hE2gIAMyf2wCPkxkFPz+VnMQiYWBq1/p5A= github.com/crossplane/crossplane-tools v0.0.0-20230714144037-2684f4bc7638 h1:NPbGG7jLyM+LbSMFQXilM70EOxbxk4z2CFvdSRtxc1s= github.com/crossplane/crossplane-tools v0.0.0-20230714144037-2684f4bc7638/go.mod h1:+e4OaFlOcmr0JvINHl/yvEYBrZawzTgj6pQumOH1SS0= -github.com/dave/jennifer v1.4.1 h1:XyqG6cn5RQsTj3qlWQTKlRGAyrTcsk1kUmWdZBzRjDw= -github.com/dave/jennifer v1.4.1/go.mod h1:7jEdnm+qBcxl8PC0zyp7vxcpSRnzXSt9r39tpTVGlwA= +github.com/dave/astrid v0.0.0-20170323122508-8c2895878b14/go.mod h1:Sth2QfxfATb/nW4EsrSi2KyJmbcniZ8TgTaji17D6ms= +github.com/dave/brenda v1.1.0/go.mod h1:4wCUr6gSlu5/1Tk7akE5X7UorwiQ8Rij0SKH3/BGMOM= +github.com/dave/courtney v0.3.0/go.mod h1:BAv3hA06AYfNUjfjQr+5gc6vxeBVOupLqrColj+QSD8= +github.com/dave/gopackages v0.0.0-20170318123100-46e7023ec56e/go.mod h1:i00+b/gKdIDIxuLDFob7ustLAVqhsZRk2qVZrArELGQ= +github.com/dave/jennifer v1.6.0 h1:MQ/6emI2xM7wt0tJzJzyUik2Q3Tcn2eE0vtYgh4GPVI= +github.com/dave/jennifer v1.6.0/go.mod h1:AxTG893FiZKqxy3FP1kL80VMshSMuz2G+EgvszgGRnk= +github.com/dave/kerr v0.0.0-20170318121727-bc25dd6abe8e/go.mod h1:qZqlPyPvfsDJt+3wHJ1EvSXDuVjFTK0j2p/ca+gtsb8= +github.com/dave/patsy v0.0.0-20210517141501-957256f50cba/go.mod h1:qfR88CgEGLoiqDaE+xxDCi5QA5v4vUoW0UCX2Nd5Tlc= +github.com/dave/rebecca v0.9.1/go.mod h1:N6XYdMD/OKw3lkF3ywh8Z6wPGuwNFDNtWYEMFWEmXBA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -528,6 +533,8 @@ github.com/jaypipes/envutil v1.0.0/go.mod h1:vgIRDly+xgBq0eeZRcflOHMMobMwgC6MkMb github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jmattheis/goverter v0.18.0 h1:tOeDCSZQaq+Z+KKR1Y6g/pJgxUvlcT5VvbqxEial6zs= +github.com/jmattheis/goverter v0.18.0/go.mod h1:cKOfZ0hADOS3Ef0+raoD3uBEgs2Qzbd3DhE3JXEnqJo= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -603,8 +610,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfr github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mikefarah/yq/v3 v3.0.0-20201202084205-8846255d1c37/go.mod h1:dYWq+UWoFCDY1TndvFUQuhBbIYmZpjreC8adEAx93zE= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -617,8 +622,6 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -781,6 +784,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -876,7 +880,9 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -927,9 +933,11 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -955,6 +963,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1021,17 +1030,20 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1045,6 +1057,7 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1121,7 +1134,9 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.11.0 h1:EMCa6U9S2LtZXLAMoWiR/R8dAQFRqbAitmbJ2UKhoi8= golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/pkg/clients/elasticache/convert/converter_generate.go b/pkg/clients/elasticache/convert/converter_generate.go new file mode 100644 index 0000000000..4c16c242ec --- /dev/null +++ b/pkg/clients/elasticache/convert/converter_generate.go @@ -0,0 +1,26 @@ +//go:build generate +// +build generate + +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License 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. +*/ + +package convert + +//go:generate go run -tags generate github.com/jmattheis/goverter/cmd/goverter -output zz_converter.go -packageName convert . + +import ( + _ "github.com/jmattheis/goverter/cmd/goverter" //nolint:typecheck +) diff --git a/pkg/clients/elasticache/convert/converter_types.go b/pkg/clients/elasticache/convert/converter_types.go new file mode 100644 index 0000000000..6201dc3f12 --- /dev/null +++ b/pkg/clients/elasticache/convert/converter_types.go @@ -0,0 +1,27 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License 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. +*/ + +package convert + +import ( + "github.com/aws/aws-sdk-go-v2/service/elasticache/types" +) + +// goverter:converter +// goverter:ignoreUnexported +type Converter interface { + DeepCopyAWSCacheCluster(*types.CacheCluster) *types.CacheCluster +} diff --git a/pkg/clients/elasticache/convert/zz_converter.go b/pkg/clients/elasticache/convert/zz_converter.go new file mode 100755 index 0000000000..54e43bbe95 --- /dev/null +++ b/pkg/clients/elasticache/convert/zz_converter.go @@ -0,0 +1,417 @@ +// Code generated by github.com/jmattheis/goverter, DO NOT EDIT. + +package convert + +import ( + types "github.com/aws/aws-sdk-go-v2/service/elasticache/types" + "time" +) + +type ConverterImpl struct{} + +func (c *ConverterImpl) DeepCopyAWSCacheCluster(source *types.CacheCluster) *types.CacheCluster { + var pTypesCacheCluster *types.CacheCluster + if source != nil { + var typesCacheCluster types.CacheCluster + var pString *string + if (*source).ARN != nil { + xstring := *(*source).ARN + pString = &xstring + } + typesCacheCluster.ARN = pString + var pBool *bool + if (*source).AtRestEncryptionEnabled != nil { + xbool := *(*source).AtRestEncryptionEnabled + pBool = &xbool + } + typesCacheCluster.AtRestEncryptionEnabled = pBool + var pBool2 *bool + if (*source).AuthTokenEnabled != nil { + xbool2 := *(*source).AuthTokenEnabled + pBool2 = &xbool2 + } + typesCacheCluster.AuthTokenEnabled = pBool2 + typesCacheCluster.AuthTokenLastModifiedDate = c.pTimeTimeToPTimeTime((*source).AuthTokenLastModifiedDate) + typesCacheCluster.AutoMinorVersionUpgrade = (*source).AutoMinorVersionUpgrade + typesCacheCluster.CacheClusterCreateTime = c.pTimeTimeToPTimeTime((*source).CacheClusterCreateTime) + var pString2 *string + if (*source).CacheClusterId != nil { + xstring2 := *(*source).CacheClusterId + pString2 = &xstring2 + } + typesCacheCluster.CacheClusterId = pString2 + var pString3 *string + if (*source).CacheClusterStatus != nil { + xstring3 := *(*source).CacheClusterStatus + pString3 = &xstring3 + } + typesCacheCluster.CacheClusterStatus = pString3 + var pString4 *string + if (*source).CacheNodeType != nil { + xstring4 := *(*source).CacheNodeType + pString4 = &xstring4 + } + typesCacheCluster.CacheNodeType = pString4 + var typesCacheNodeList []types.CacheNode + if (*source).CacheNodes != nil { + typesCacheNodeList = make([]types.CacheNode, len((*source).CacheNodes)) + for i := 0; i < len((*source).CacheNodes); i++ { + typesCacheNodeList[i] = c.typesCacheNodeToTypesCacheNode((*source).CacheNodes[i]) + } + } + typesCacheCluster.CacheNodes = typesCacheNodeList + typesCacheCluster.CacheParameterGroup = c.pTypesCacheParameterGroupStatusToPTypesCacheParameterGroupStatus((*source).CacheParameterGroup) + var typesCacheSecurityGroupMembershipList []types.CacheSecurityGroupMembership + if (*source).CacheSecurityGroups != nil { + typesCacheSecurityGroupMembershipList = make([]types.CacheSecurityGroupMembership, len((*source).CacheSecurityGroups)) + for j := 0; j < len((*source).CacheSecurityGroups); j++ { + typesCacheSecurityGroupMembershipList[j] = c.typesCacheSecurityGroupMembershipToTypesCacheSecurityGroupMembership((*source).CacheSecurityGroups[j]) + } + } + typesCacheCluster.CacheSecurityGroups = typesCacheSecurityGroupMembershipList + var pString5 *string + if (*source).CacheSubnetGroupName != nil { + xstring5 := *(*source).CacheSubnetGroupName + pString5 = &xstring5 + } + typesCacheCluster.CacheSubnetGroupName = pString5 + var pString6 *string + if (*source).ClientDownloadLandingPage != nil { + xstring6 := *(*source).ClientDownloadLandingPage + pString6 = &xstring6 + } + typesCacheCluster.ClientDownloadLandingPage = pString6 + typesCacheCluster.ConfigurationEndpoint = c.pTypesEndpointToPTypesEndpoint((*source).ConfigurationEndpoint) + var pString7 *string + if (*source).Engine != nil { + xstring7 := *(*source).Engine + pString7 = &xstring7 + } + typesCacheCluster.Engine = pString7 + var pString8 *string + if (*source).EngineVersion != nil { + xstring8 := *(*source).EngineVersion + pString8 = &xstring8 + } + typesCacheCluster.EngineVersion = pString8 + var typesLogDeliveryConfigurationList []types.LogDeliveryConfiguration + if (*source).LogDeliveryConfigurations != nil { + typesLogDeliveryConfigurationList = make([]types.LogDeliveryConfiguration, len((*source).LogDeliveryConfigurations)) + for k := 0; k < len((*source).LogDeliveryConfigurations); k++ { + typesLogDeliveryConfigurationList[k] = c.typesLogDeliveryConfigurationToTypesLogDeliveryConfiguration((*source).LogDeliveryConfigurations[k]) + } + } + typesCacheCluster.LogDeliveryConfigurations = typesLogDeliveryConfigurationList + typesCacheCluster.NotificationConfiguration = c.pTypesNotificationConfigurationToPTypesNotificationConfiguration((*source).NotificationConfiguration) + var pInt32 *int32 + if (*source).NumCacheNodes != nil { + xint32 := *(*source).NumCacheNodes + pInt32 = &xint32 + } + typesCacheCluster.NumCacheNodes = pInt32 + typesCacheCluster.PendingModifiedValues = c.pTypesPendingModifiedValuesToPTypesPendingModifiedValues((*source).PendingModifiedValues) + var pString9 *string + if (*source).PreferredAvailabilityZone != nil { + xstring9 := *(*source).PreferredAvailabilityZone + pString9 = &xstring9 + } + typesCacheCluster.PreferredAvailabilityZone = pString9 + var pString10 *string + if (*source).PreferredMaintenanceWindow != nil { + xstring10 := *(*source).PreferredMaintenanceWindow + pString10 = &xstring10 + } + typesCacheCluster.PreferredMaintenanceWindow = pString10 + var pString11 *string + if (*source).PreferredOutpostArn != nil { + xstring11 := *(*source).PreferredOutpostArn + pString11 = &xstring11 + } + typesCacheCluster.PreferredOutpostArn = pString11 + var pString12 *string + if (*source).ReplicationGroupId != nil { + xstring12 := *(*source).ReplicationGroupId + pString12 = &xstring12 + } + typesCacheCluster.ReplicationGroupId = pString12 + typesCacheCluster.ReplicationGroupLogDeliveryEnabled = (*source).ReplicationGroupLogDeliveryEnabled + var typesSecurityGroupMembershipList []types.SecurityGroupMembership + if (*source).SecurityGroups != nil { + typesSecurityGroupMembershipList = make([]types.SecurityGroupMembership, len((*source).SecurityGroups)) + for l := 0; l < len((*source).SecurityGroups); l++ { + typesSecurityGroupMembershipList[l] = c.typesSecurityGroupMembershipToTypesSecurityGroupMembership((*source).SecurityGroups[l]) + } + } + typesCacheCluster.SecurityGroups = typesSecurityGroupMembershipList + var pInt322 *int32 + if (*source).SnapshotRetentionLimit != nil { + xint322 := *(*source).SnapshotRetentionLimit + pInt322 = &xint322 + } + typesCacheCluster.SnapshotRetentionLimit = pInt322 + var pString13 *string + if (*source).SnapshotWindow != nil { + xstring13 := *(*source).SnapshotWindow + pString13 = &xstring13 + } + typesCacheCluster.SnapshotWindow = pString13 + var pBool3 *bool + if (*source).TransitEncryptionEnabled != nil { + xbool3 := *(*source).TransitEncryptionEnabled + pBool3 = &xbool3 + } + typesCacheCluster.TransitEncryptionEnabled = pBool3 + pTypesCacheCluster = &typesCacheCluster + } + return pTypesCacheCluster +} +func (c *ConverterImpl) pTimeTimeToPTimeTime(source *time.Time) *time.Time { + var pTimeTime *time.Time + if source != nil { + var timeTime time.Time + _ = (*source) + pTimeTime = &timeTime + } + return pTimeTime +} +func (c *ConverterImpl) pTypesCacheParameterGroupStatusToPTypesCacheParameterGroupStatus(source *types.CacheParameterGroupStatus) *types.CacheParameterGroupStatus { + var pTypesCacheParameterGroupStatus *types.CacheParameterGroupStatus + if source != nil { + var typesCacheParameterGroupStatus types.CacheParameterGroupStatus + var stringList []string + if (*source).CacheNodeIdsToReboot != nil { + stringList = make([]string, len((*source).CacheNodeIdsToReboot)) + for i := 0; i < len((*source).CacheNodeIdsToReboot); i++ { + stringList[i] = (*source).CacheNodeIdsToReboot[i] + } + } + typesCacheParameterGroupStatus.CacheNodeIdsToReboot = stringList + var pString *string + if (*source).CacheParameterGroupName != nil { + xstring := *(*source).CacheParameterGroupName + pString = &xstring + } + typesCacheParameterGroupStatus.CacheParameterGroupName = pString + var pString2 *string + if (*source).ParameterApplyStatus != nil { + xstring2 := *(*source).ParameterApplyStatus + pString2 = &xstring2 + } + typesCacheParameterGroupStatus.ParameterApplyStatus = pString2 + pTypesCacheParameterGroupStatus = &typesCacheParameterGroupStatus + } + return pTypesCacheParameterGroupStatus +} +func (c *ConverterImpl) pTypesCloudWatchLogsDestinationDetailsToPTypesCloudWatchLogsDestinationDetails(source *types.CloudWatchLogsDestinationDetails) *types.CloudWatchLogsDestinationDetails { + var pTypesCloudWatchLogsDestinationDetails *types.CloudWatchLogsDestinationDetails + if source != nil { + var typesCloudWatchLogsDestinationDetails types.CloudWatchLogsDestinationDetails + var pString *string + if (*source).LogGroup != nil { + xstring := *(*source).LogGroup + pString = &xstring + } + typesCloudWatchLogsDestinationDetails.LogGroup = pString + pTypesCloudWatchLogsDestinationDetails = &typesCloudWatchLogsDestinationDetails + } + return pTypesCloudWatchLogsDestinationDetails +} +func (c *ConverterImpl) pTypesDestinationDetailsToPTypesDestinationDetails(source *types.DestinationDetails) *types.DestinationDetails { + var pTypesDestinationDetails *types.DestinationDetails + if source != nil { + var typesDestinationDetails types.DestinationDetails + typesDestinationDetails.CloudWatchLogsDetails = c.pTypesCloudWatchLogsDestinationDetailsToPTypesCloudWatchLogsDestinationDetails((*source).CloudWatchLogsDetails) + typesDestinationDetails.KinesisFirehoseDetails = c.pTypesKinesisFirehoseDestinationDetailsToPTypesKinesisFirehoseDestinationDetails((*source).KinesisFirehoseDetails) + pTypesDestinationDetails = &typesDestinationDetails + } + return pTypesDestinationDetails +} +func (c *ConverterImpl) pTypesEndpointToPTypesEndpoint(source *types.Endpoint) *types.Endpoint { + var pTypesEndpoint *types.Endpoint + if source != nil { + var typesEndpoint types.Endpoint + var pString *string + if (*source).Address != nil { + xstring := *(*source).Address + pString = &xstring + } + typesEndpoint.Address = pString + typesEndpoint.Port = (*source).Port + pTypesEndpoint = &typesEndpoint + } + return pTypesEndpoint +} +func (c *ConverterImpl) pTypesKinesisFirehoseDestinationDetailsToPTypesKinesisFirehoseDestinationDetails(source *types.KinesisFirehoseDestinationDetails) *types.KinesisFirehoseDestinationDetails { + var pTypesKinesisFirehoseDestinationDetails *types.KinesisFirehoseDestinationDetails + if source != nil { + var typesKinesisFirehoseDestinationDetails types.KinesisFirehoseDestinationDetails + var pString *string + if (*source).DeliveryStream != nil { + xstring := *(*source).DeliveryStream + pString = &xstring + } + typesKinesisFirehoseDestinationDetails.DeliveryStream = pString + pTypesKinesisFirehoseDestinationDetails = &typesKinesisFirehoseDestinationDetails + } + return pTypesKinesisFirehoseDestinationDetails +} +func (c *ConverterImpl) pTypesNotificationConfigurationToPTypesNotificationConfiguration(source *types.NotificationConfiguration) *types.NotificationConfiguration { + var pTypesNotificationConfiguration *types.NotificationConfiguration + if source != nil { + var typesNotificationConfiguration types.NotificationConfiguration + var pString *string + if (*source).TopicArn != nil { + xstring := *(*source).TopicArn + pString = &xstring + } + typesNotificationConfiguration.TopicArn = pString + var pString2 *string + if (*source).TopicStatus != nil { + xstring2 := *(*source).TopicStatus + pString2 = &xstring2 + } + typesNotificationConfiguration.TopicStatus = pString2 + pTypesNotificationConfiguration = &typesNotificationConfiguration + } + return pTypesNotificationConfiguration +} +func (c *ConverterImpl) pTypesPendingModifiedValuesToPTypesPendingModifiedValues(source *types.PendingModifiedValues) *types.PendingModifiedValues { + var pTypesPendingModifiedValues *types.PendingModifiedValues + if source != nil { + var typesPendingModifiedValues types.PendingModifiedValues + typesPendingModifiedValues.AuthTokenStatus = types.AuthTokenUpdateStatus((*source).AuthTokenStatus) + var stringList []string + if (*source).CacheNodeIdsToRemove != nil { + stringList = make([]string, len((*source).CacheNodeIdsToRemove)) + for i := 0; i < len((*source).CacheNodeIdsToRemove); i++ { + stringList[i] = (*source).CacheNodeIdsToRemove[i] + } + } + typesPendingModifiedValues.CacheNodeIdsToRemove = stringList + var pString *string + if (*source).CacheNodeType != nil { + xstring := *(*source).CacheNodeType + pString = &xstring + } + typesPendingModifiedValues.CacheNodeType = pString + var pString2 *string + if (*source).EngineVersion != nil { + xstring2 := *(*source).EngineVersion + pString2 = &xstring2 + } + typesPendingModifiedValues.EngineVersion = pString2 + var typesPendingLogDeliveryConfigurationList []types.PendingLogDeliveryConfiguration + if (*source).LogDeliveryConfigurations != nil { + typesPendingLogDeliveryConfigurationList = make([]types.PendingLogDeliveryConfiguration, len((*source).LogDeliveryConfigurations)) + for j := 0; j < len((*source).LogDeliveryConfigurations); j++ { + typesPendingLogDeliveryConfigurationList[j] = c.typesPendingLogDeliveryConfigurationToTypesPendingLogDeliveryConfiguration((*source).LogDeliveryConfigurations[j]) + } + } + typesPendingModifiedValues.LogDeliveryConfigurations = typesPendingLogDeliveryConfigurationList + var pInt32 *int32 + if (*source).NumCacheNodes != nil { + xint32 := *(*source).NumCacheNodes + pInt32 = &xint32 + } + typesPendingModifiedValues.NumCacheNodes = pInt32 + pTypesPendingModifiedValues = &typesPendingModifiedValues + } + return pTypesPendingModifiedValues +} +func (c *ConverterImpl) typesCacheNodeToTypesCacheNode(source types.CacheNode) types.CacheNode { + var typesCacheNode types.CacheNode + typesCacheNode.CacheNodeCreateTime = c.pTimeTimeToPTimeTime(source.CacheNodeCreateTime) + var pString *string + if source.CacheNodeId != nil { + xstring := *source.CacheNodeId + pString = &xstring + } + typesCacheNode.CacheNodeId = pString + var pString2 *string + if source.CacheNodeStatus != nil { + xstring2 := *source.CacheNodeStatus + pString2 = &xstring2 + } + typesCacheNode.CacheNodeStatus = pString2 + var pString3 *string + if source.CustomerAvailabilityZone != nil { + xstring3 := *source.CustomerAvailabilityZone + pString3 = &xstring3 + } + typesCacheNode.CustomerAvailabilityZone = pString3 + var pString4 *string + if source.CustomerOutpostArn != nil { + xstring4 := *source.CustomerOutpostArn + pString4 = &xstring4 + } + typesCacheNode.CustomerOutpostArn = pString4 + typesCacheNode.Endpoint = c.pTypesEndpointToPTypesEndpoint(source.Endpoint) + var pString5 *string + if source.ParameterGroupStatus != nil { + xstring5 := *source.ParameterGroupStatus + pString5 = &xstring5 + } + typesCacheNode.ParameterGroupStatus = pString5 + var pString6 *string + if source.SourceCacheNodeId != nil { + xstring6 := *source.SourceCacheNodeId + pString6 = &xstring6 + } + typesCacheNode.SourceCacheNodeId = pString6 + return typesCacheNode +} +func (c *ConverterImpl) typesCacheSecurityGroupMembershipToTypesCacheSecurityGroupMembership(source types.CacheSecurityGroupMembership) types.CacheSecurityGroupMembership { + var typesCacheSecurityGroupMembership types.CacheSecurityGroupMembership + var pString *string + if source.CacheSecurityGroupName != nil { + xstring := *source.CacheSecurityGroupName + pString = &xstring + } + typesCacheSecurityGroupMembership.CacheSecurityGroupName = pString + var pString2 *string + if source.Status != nil { + xstring2 := *source.Status + pString2 = &xstring2 + } + typesCacheSecurityGroupMembership.Status = pString2 + return typesCacheSecurityGroupMembership +} +func (c *ConverterImpl) typesLogDeliveryConfigurationToTypesLogDeliveryConfiguration(source types.LogDeliveryConfiguration) types.LogDeliveryConfiguration { + var typesLogDeliveryConfiguration types.LogDeliveryConfiguration + typesLogDeliveryConfiguration.DestinationDetails = c.pTypesDestinationDetailsToPTypesDestinationDetails(source.DestinationDetails) + typesLogDeliveryConfiguration.DestinationType = types.DestinationType(source.DestinationType) + typesLogDeliveryConfiguration.LogFormat = types.LogFormat(source.LogFormat) + typesLogDeliveryConfiguration.LogType = types.LogType(source.LogType) + var pString *string + if source.Message != nil { + xstring := *source.Message + pString = &xstring + } + typesLogDeliveryConfiguration.Message = pString + typesLogDeliveryConfiguration.Status = types.LogDeliveryConfigurationStatus(source.Status) + return typesLogDeliveryConfiguration +} +func (c *ConverterImpl) typesPendingLogDeliveryConfigurationToTypesPendingLogDeliveryConfiguration(source types.PendingLogDeliveryConfiguration) types.PendingLogDeliveryConfiguration { + var typesPendingLogDeliveryConfiguration types.PendingLogDeliveryConfiguration + typesPendingLogDeliveryConfiguration.DestinationDetails = c.pTypesDestinationDetailsToPTypesDestinationDetails(source.DestinationDetails) + typesPendingLogDeliveryConfiguration.DestinationType = types.DestinationType(source.DestinationType) + typesPendingLogDeliveryConfiguration.LogFormat = types.LogFormat(source.LogFormat) + typesPendingLogDeliveryConfiguration.LogType = types.LogType(source.LogType) + return typesPendingLogDeliveryConfiguration +} +func (c *ConverterImpl) typesSecurityGroupMembershipToTypesSecurityGroupMembership(source types.SecurityGroupMembership) types.SecurityGroupMembership { + var typesSecurityGroupMembership types.SecurityGroupMembership + var pString *string + if source.SecurityGroupId != nil { + xstring := *source.SecurityGroupId + pString = &xstring + } + typesSecurityGroupMembership.SecurityGroupId = pString + var pString2 *string + if source.Status != nil { + xstring2 := *source.Status + pString2 = &xstring2 + } + typesSecurityGroupMembership.Status = pString2 + return typesSecurityGroupMembership +} diff --git a/pkg/clients/elasticache/elasticache.go b/pkg/clients/elasticache/elasticache.go index 8068d23b3f..4a73524508 100644 --- a/pkg/clients/elasticache/elasticache.go +++ b/pkg/clients/elasticache/elasticache.go @@ -30,11 +30,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/mitchellh/copystructure" "github.com/pkg/errors" cachev1alpha1 "github.com/crossplane-contrib/provider-aws/apis/cache/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/cache/v1beta1" + "github.com/crossplane-contrib/provider-aws/pkg/clients/elasticache/convert" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" tagutils "github.com/crossplane-contrib/provider-aws/pkg/utils/tags" ) @@ -841,14 +841,7 @@ func GenerateCluster(name string, p cachev1alpha1.CacheClusterParameters, c *ela // IsClusterUpToDate checks whether current state is up-to-date compared to the given // set of parameters. func IsClusterUpToDate(name string, in *cachev1alpha1.CacheClusterParameters, observed *elasticachetypes.CacheCluster) (bool, error) { - generated, err := copystructure.Copy(observed) - if err != nil { - return true, errors.Wrap(err, errCheckUpToDate) - } - desired, ok := generated.(*elasticachetypes.CacheCluster) - if !ok { - return true, errors.New(errCheckUpToDate) - } + desired := (&convert.ConverterImpl{}).DeepCopyAWSCacheCluster(observed) GenerateCluster(name, *in, desired) if desired.EngineVersion != nil { diff --git a/pkg/clients/iam/convert/converter_generate.go b/pkg/clients/iam/convert/converter_generate.go new file mode 100644 index 0000000000..4c16c242ec --- /dev/null +++ b/pkg/clients/iam/convert/converter_generate.go @@ -0,0 +1,26 @@ +//go:build generate +// +build generate + +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License 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. +*/ + +package convert + +//go:generate go run -tags generate github.com/jmattheis/goverter/cmd/goverter -output zz_converter.go -packageName convert . + +import ( + _ "github.com/jmattheis/goverter/cmd/goverter" //nolint:typecheck +) diff --git a/pkg/clients/iam/convert/converter_types.go b/pkg/clients/iam/convert/converter_types.go new file mode 100644 index 0000000000..be413ce19b --- /dev/null +++ b/pkg/clients/iam/convert/converter_types.go @@ -0,0 +1,27 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License 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. +*/ + +package convert + +import ( + types "github.com/aws/aws-sdk-go-v2/service/iam/types" +) + +// goverter:converter +// goverter:ignoreUnexported +type Converter interface { + DeepCopyAWSRole(*types.Role) *types.Role +} diff --git a/pkg/clients/iam/convert/zz_converter.go b/pkg/clients/iam/convert/zz_converter.go new file mode 100755 index 0000000000..2cd2ac48b9 --- /dev/null +++ b/pkg/clients/iam/convert/zz_converter.go @@ -0,0 +1,127 @@ +// Code generated by github.com/jmattheis/goverter, DO NOT EDIT. + +package convert + +import ( + types "github.com/aws/aws-sdk-go-v2/service/iam/types" + "time" +) + +type ConverterImpl struct{} + +func (c *ConverterImpl) DeepCopyAWSRole(source *types.Role) *types.Role { + var pTypesRole *types.Role + if source != nil { + var typesRole types.Role + var pString *string + if (*source).Arn != nil { + xstring := *(*source).Arn + pString = &xstring + } + typesRole.Arn = pString + typesRole.CreateDate = c.pTimeTimeToPTimeTime((*source).CreateDate) + var pString2 *string + if (*source).Path != nil { + xstring2 := *(*source).Path + pString2 = &xstring2 + } + typesRole.Path = pString2 + var pString3 *string + if (*source).RoleId != nil { + xstring3 := *(*source).RoleId + pString3 = &xstring3 + } + typesRole.RoleId = pString3 + var pString4 *string + if (*source).RoleName != nil { + xstring4 := *(*source).RoleName + pString4 = &xstring4 + } + typesRole.RoleName = pString4 + var pString5 *string + if (*source).AssumeRolePolicyDocument != nil { + xstring5 := *(*source).AssumeRolePolicyDocument + pString5 = &xstring5 + } + typesRole.AssumeRolePolicyDocument = pString5 + var pString6 *string + if (*source).Description != nil { + xstring6 := *(*source).Description + pString6 = &xstring6 + } + typesRole.Description = pString6 + var pInt32 *int32 + if (*source).MaxSessionDuration != nil { + xint32 := *(*source).MaxSessionDuration + pInt32 = &xint32 + } + typesRole.MaxSessionDuration = pInt32 + typesRole.PermissionsBoundary = c.pTypesAttachedPermissionsBoundaryToPTypesAttachedPermissionsBoundary((*source).PermissionsBoundary) + typesRole.RoleLastUsed = c.pTypesRoleLastUsedToPTypesRoleLastUsed((*source).RoleLastUsed) + var typesTagList []types.Tag + if (*source).Tags != nil { + typesTagList = make([]types.Tag, len((*source).Tags)) + for i := 0; i < len((*source).Tags); i++ { + typesTagList[i] = c.typesTagToTypesTag((*source).Tags[i]) + } + } + typesRole.Tags = typesTagList + pTypesRole = &typesRole + } + return pTypesRole +} +func (c *ConverterImpl) pTimeTimeToPTimeTime(source *time.Time) *time.Time { + var pTimeTime *time.Time + if source != nil { + var timeTime time.Time + _ = (*source) + pTimeTime = &timeTime + } + return pTimeTime +} +func (c *ConverterImpl) pTypesAttachedPermissionsBoundaryToPTypesAttachedPermissionsBoundary(source *types.AttachedPermissionsBoundary) *types.AttachedPermissionsBoundary { + var pTypesAttachedPermissionsBoundary *types.AttachedPermissionsBoundary + if source != nil { + var typesAttachedPermissionsBoundary types.AttachedPermissionsBoundary + var pString *string + if (*source).PermissionsBoundaryArn != nil { + xstring := *(*source).PermissionsBoundaryArn + pString = &xstring + } + typesAttachedPermissionsBoundary.PermissionsBoundaryArn = pString + typesAttachedPermissionsBoundary.PermissionsBoundaryType = types.PermissionsBoundaryAttachmentType((*source).PermissionsBoundaryType) + pTypesAttachedPermissionsBoundary = &typesAttachedPermissionsBoundary + } + return pTypesAttachedPermissionsBoundary +} +func (c *ConverterImpl) pTypesRoleLastUsedToPTypesRoleLastUsed(source *types.RoleLastUsed) *types.RoleLastUsed { + var pTypesRoleLastUsed *types.RoleLastUsed + if source != nil { + var typesRoleLastUsed types.RoleLastUsed + typesRoleLastUsed.LastUsedDate = c.pTimeTimeToPTimeTime((*source).LastUsedDate) + var pString *string + if (*source).Region != nil { + xstring := *(*source).Region + pString = &xstring + } + typesRoleLastUsed.Region = pString + pTypesRoleLastUsed = &typesRoleLastUsed + } + return pTypesRoleLastUsed +} +func (c *ConverterImpl) typesTagToTypesTag(source types.Tag) types.Tag { + var typesTag types.Tag + var pString *string + if source.Key != nil { + xstring := *source.Key + pString = &xstring + } + typesTag.Key = pString + var pString2 *string + if source.Value != nil { + xstring2 := *source.Value + pString2 = &xstring2 + } + typesTag.Value = pString2 + return typesTag +} diff --git a/pkg/clients/iam/role.go b/pkg/clients/iam/role.go index a3bb275b98..744273518e 100644 --- a/pkg/clients/iam/role.go +++ b/pkg/clients/iam/role.go @@ -12,10 +12,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/mitchellh/copystructure" "github.com/pkg/errors" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" + "github.com/crossplane-contrib/provider-aws/pkg/clients/iam/convert" "github.com/crossplane-contrib/provider-aws/pkg/utils/jsonpatch" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" legacypolicy "github.com/crossplane-contrib/provider-aws/pkg/utils/policy/old" @@ -169,16 +169,8 @@ func isAssumeRolePolicyUpToDate(a, b *string) (bool, error) { // IsRoleUpToDate checks whether there is a change in any of the modifiable fields in role. func IsRoleUpToDate(in v1beta1.RoleParameters, observed iamtypes.Role) (bool, string, error) { - generated, err := copystructure.Copy(&observed) - if err != nil { - return true, "", errors.Wrap(err, errCheckUpToDate) - } - desired, ok := generated.(*iamtypes.Role) - if !ok { - return true, "", errors.New(errCheckUpToDate) - } - - if err = GenerateRole(in, desired); err != nil { + desired := (&convert.ConverterImpl{}).DeepCopyAWSRole(&observed) + if err := GenerateRole(in, desired); err != nil { return false, "", err } diff --git a/pkg/controller/s3/bucket/convert/converter_generate.go b/pkg/controller/s3/bucket/convert/converter_generate.go new file mode 100644 index 0000000000..4c16c242ec --- /dev/null +++ b/pkg/controller/s3/bucket/convert/converter_generate.go @@ -0,0 +1,26 @@ +//go:build generate +// +build generate + +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License 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. +*/ + +package convert + +//go:generate go run -tags generate github.com/jmattheis/goverter/cmd/goverter -output zz_converter.go -packageName convert . + +import ( + _ "github.com/jmattheis/goverter/cmd/goverter" //nolint:typecheck +) diff --git a/pkg/controller/s3/bucket/convert/converter_types.go b/pkg/controller/s3/bucket/convert/converter_types.go new file mode 100644 index 0000000000..2505b396b4 --- /dev/null +++ b/pkg/controller/s3/bucket/convert/converter_types.go @@ -0,0 +1,27 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License 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. +*/ + +package convert + +import ( + "github.com/aws/aws-sdk-go-v2/service/s3/types" +) + +// goverter:converter +// goverter:ignoreUnexported +type Converter interface { + DeepCopyAWSQueueConfiguration([]types.QueueConfiguration) []types.QueueConfiguration +} diff --git a/pkg/controller/s3/bucket/convert/zz_converter.go b/pkg/controller/s3/bucket/convert/zz_converter.go new file mode 100755 index 0000000000..866530308d --- /dev/null +++ b/pkg/controller/s3/bucket/convert/zz_converter.go @@ -0,0 +1,79 @@ +// Code generated by github.com/jmattheis/goverter, DO NOT EDIT. + +package convert + +import types "github.com/aws/aws-sdk-go-v2/service/s3/types" + +type ConverterImpl struct{} + +func (c *ConverterImpl) DeepCopyAWSQueueConfiguration(source []types.QueueConfiguration) []types.QueueConfiguration { + var typesQueueConfigurationList []types.QueueConfiguration + if source != nil { + typesQueueConfigurationList = make([]types.QueueConfiguration, len(source)) + for i := 0; i < len(source); i++ { + typesQueueConfigurationList[i] = c.typesQueueConfigurationToTypesQueueConfiguration(source[i]) + } + } + return typesQueueConfigurationList +} +func (c *ConverterImpl) pTypesNotificationConfigurationFilterToPTypesNotificationConfigurationFilter(source *types.NotificationConfigurationFilter) *types.NotificationConfigurationFilter { + var pTypesNotificationConfigurationFilter *types.NotificationConfigurationFilter + if source != nil { + var typesNotificationConfigurationFilter types.NotificationConfigurationFilter + typesNotificationConfigurationFilter.Key = c.pTypesS3KeyFilterToPTypesS3KeyFilter((*source).Key) + pTypesNotificationConfigurationFilter = &typesNotificationConfigurationFilter + } + return pTypesNotificationConfigurationFilter +} +func (c *ConverterImpl) pTypesS3KeyFilterToPTypesS3KeyFilter(source *types.S3KeyFilter) *types.S3KeyFilter { + var pTypesS3KeyFilter *types.S3KeyFilter + if source != nil { + var typesS3KeyFilter types.S3KeyFilter + var typesFilterRuleList []types.FilterRule + if (*source).FilterRules != nil { + typesFilterRuleList = make([]types.FilterRule, len((*source).FilterRules)) + for i := 0; i < len((*source).FilterRules); i++ { + typesFilterRuleList[i] = c.typesFilterRuleToTypesFilterRule((*source).FilterRules[i]) + } + } + typesS3KeyFilter.FilterRules = typesFilterRuleList + pTypesS3KeyFilter = &typesS3KeyFilter + } + return pTypesS3KeyFilter +} +func (c *ConverterImpl) typesFilterRuleToTypesFilterRule(source types.FilterRule) types.FilterRule { + var typesFilterRule types.FilterRule + typesFilterRule.Name = types.FilterRuleName(source.Name) + var pString *string + if source.Value != nil { + xstring := *source.Value + pString = &xstring + } + typesFilterRule.Value = pString + return typesFilterRule +} +func (c *ConverterImpl) typesQueueConfigurationToTypesQueueConfiguration(source types.QueueConfiguration) types.QueueConfiguration { + var typesQueueConfiguration types.QueueConfiguration + var typesEventList []types.Event + if source.Events != nil { + typesEventList = make([]types.Event, len(source.Events)) + for i := 0; i < len(source.Events); i++ { + typesEventList[i] = types.Event(source.Events[i]) + } + } + typesQueueConfiguration.Events = typesEventList + var pString *string + if source.QueueArn != nil { + xstring := *source.QueueArn + pString = &xstring + } + typesQueueConfiguration.QueueArn = pString + typesQueueConfiguration.Filter = c.pTypesNotificationConfigurationFilterToPTypesNotificationConfigurationFilter(source.Filter) + var pString2 *string + if source.Id != nil { + xstring2 := *source.Id + pString2 = &xstring2 + } + typesQueueConfiguration.Id = pString2 + return typesQueueConfiguration +} diff --git a/pkg/controller/s3/bucket/notificationConfig.go b/pkg/controller/s3/bucket/notificationConfig.go index e4e4f20e88..94a2156dcf 100644 --- a/pkg/controller/s3/bucket/notificationConfig.go +++ b/pkg/controller/s3/bucket/notificationConfig.go @@ -25,13 +25,13 @@ import ( awss3 "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/s3/types" "github.com/aws/smithy-go/document" - "github.com/barkimedes/go-deepcopy" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" "github.com/crossplane-contrib/provider-aws/pkg/clients/s3" + "github.com/crossplane-contrib/provider-aws/pkg/controller/s3/bucket/convert" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" ) @@ -137,20 +137,24 @@ func sortTopic(configs []types.TopicConfiguration) { } func sanitizedQueueConfigurations(configs []types.QueueConfiguration) []types.QueueConfiguration { - rawConfig, err := deepcopy.Anything(configs) - if err != nil { - return configs + if configs == nil { + return []types.QueueConfiguration{} } - sConfig := rawConfig.([]types.QueueConfiguration) - + sConfig := (&convert.ConverterImpl{}).DeepCopyAWSQueueConfiguration(configs) for c := range sConfig { + if sConfig[c].Events == nil { + sConfig[c].Events = []types.Event{} + } if sConfig[c].Filter == nil { continue } if sConfig[c].Filter.Key == nil { continue } + if sConfig[c].Filter.Key.FilterRules == nil { + sConfig[c].Filter.Key.FilterRules = []types.FilterRule{} + } for r := range sConfig[c].Filter.Key.FilterRules { name := string(sConfig[c].Filter.Key.FilterRules[r].Name) sConfig[c].Filter.Key.FilterRules[r].Name = types.FilterRuleName(strings.ToLower(name))