diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..a880fa0 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,2 @@ +# This team will own the entire repository +* @arangodb-managed/developers diff --git a/go.mod b/go.mod index b42ec84..6deb8d4 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,18 @@ module github.com/arangodb-managed/terraform-provider-oasis -go 1.20 +go 1.22.7 + +toolchain go1.22.8 require ( - github.com/arangodb-managed/apis v0.84.3 + github.com/arangodb-managed/apis v0.89.1 github.com/arangodb-managed/log-helper v0.2.5 - github.com/gogo/protobuf v1.3.2 github.com/hashicorp/terraform-plugin-docs v0.8.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.13.0 github.com/rs/zerolog v1.26.1 - github.com/stretchr/testify v1.7.0 - google.golang.org/grpc v1.47.0 + github.com/stretchr/testify v1.10.0 + google.golang.org/grpc v1.68.0 + google.golang.org/protobuf v1.35.2 ) require ( @@ -25,7 +27,7 @@ require ( github.com/bgentry/speakeasy v0.1.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/color v1.12.0 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-cmp v0.5.8 // indirect github.com/google/uuid v1.3.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect @@ -69,16 +71,14 @@ require ( github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect github.com/vmihailenco/tagparser v0.1.1 // indirect github.com/zclconf/go-cty v1.10.0 // indirect - golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e // indirect - golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect - golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect - golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/crypto v0.28.0 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/text v0.19.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350 // indirect - google.golang.org/protobuf v1.27.1 // indirect + google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) replace github.com/Azure/go-autorest => github.com/Azure/go-autorest v14.2.0+incompatible diff --git a/go.sum b/go.sum index 10d784d..102feed 100644 --- a/go.sum +++ b/go.sum @@ -30,8 +30,8 @@ github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/ github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= -github.com/arangodb-managed/apis v0.84.3 h1:Mk2wFdbIvE0nNp/0sKZ4BV4qBQbIcVVfrIUuFCJyNcY= -github.com/arangodb-managed/apis v0.84.3/go.mod h1:ZlvA803MmUI3m6ijvaAYKKaWgLJq8bBZZuq8uyZo2PY= +github.com/arangodb-managed/apis v0.89.1 h1:qFzMhkV7Di5VfR2tZmWKMYAViCKho52Y5XCXH/iML9o= +github.com/arangodb-managed/apis v0.89.1/go.mod h1:NqGYEs2tPU9ZEC+2N1kYR8mvkeA3oQ2FAxgvX6rJLIw= github.com/arangodb-managed/log-helper v0.2.5 h1:Kg3+0bDVFhEgyjMhIbCIj9hejgN2VaD4Cw/JQ4ARsd4= github.com/arangodb-managed/log-helper v0.2.5/go.mod h1:G17ASSd3Edday3i1QREGefyLJ2TduHxxFsOaqoigurE= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= @@ -68,8 +68,6 @@ github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -85,8 +83,8 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -100,7 +98,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= @@ -168,8 +165,6 @@ github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZ github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -252,8 +247,9 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= @@ -263,9 +259,7 @@ github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37w github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= @@ -284,10 +278,10 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e h1:1SzTfNOXwIS2oWiMF+6qu0OUDKb0dauo6MoDUQyu+yU= golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -298,19 +292,16 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY= -golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -318,29 +309,25 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6 h1:cdsMqa2nXzqlgs183pHxtvoVwU7CyzaCTAUOg94af4c= golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6/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-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 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 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -366,9 +353,9 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= +google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -385,5 +372,5 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/data_source_backup.go b/internal/data_source_backup.go index aaf3c82..ea70c18 100644 --- a/internal/data_source_backup.go +++ b/internal/data_source_backup.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2022-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package provider import ( "context" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -124,7 +125,7 @@ func flattenBackupObject(backup *backup.Backup) map[string]interface{} { backupDataSourceURLFieldName: backup.GetUrl(), backupDataSourcePolicyIDFieldName: backup.GetBackupPolicyId(), backupDataSourceDeploymentIDFieldName: backup.GetDeploymentId(), - backupDataSourceCreatedAtFieldName: backup.GetCreatedAt().String(), + backupDataSourceCreatedAtFieldName: backup.GetCreatedAt().AsTime().Format(time.RFC3339Nano), backupRegionIDFieldName: backup.GetRegionId(), } } diff --git a/internal/data_source_backup_test.go b/internal/data_source_backup_test.go index 0d607c0..949bbea 100644 --- a/internal/data_source_backup_test.go +++ b/internal/data_source_backup_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2022-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,15 +24,15 @@ import ( "testing" "time" - "github.com/gogo/protobuf/types" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/types/known/timestamppb" backup "github.com/arangodb-managed/apis/backup/v1" ) // TestFlattenBackupObject tests the Oasis Backup flattening for Terraform schema compatibility. func TestFlattenBackupObject(t *testing.T) { - createdAtTimeStamp, _ := types.TimestampProto(time.Date(2022, 1, 1, 1, 1, 1, 0, time.UTC)) + createdAtTimeStamp := timestamppb.New(time.Date(2022, 1, 1, 1, 1, 1, 0, time.UTC)) backup := backup.Backup{ Id: "test-id", Url: "https://test.url", diff --git a/internal/data_source_oasis_example_dataset.go b/internal/data_source_oasis_example_dataset.go index c7eb6f3..027bf11 100644 --- a/internal/data_source_oasis_example_dataset.go +++ b/internal/data_source_oasis_example_dataset.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package provider import ( "context" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -136,7 +137,7 @@ func flattenExampleDataset(items []*example.ExampleDataset) []interface{} { exampleExampleDatasetsIDFieldName: v.GetId(), exampleExampleDatasetsNameFieldName: v.GetName(), exampleExampleDatasetsDescriptionFieldName: v.GetDescription(), - exampleExampleDatasetsCreatedAtFieldName: v.GetCreatedAt().String(), + exampleExampleDatasetsCreatedAtFieldName: v.GetCreatedAt().AsTime().Format(time.RFC3339Nano), exampleExampleDatasetsGuideFieldName: v.GetGuide(), }) } diff --git a/internal/data_source_oasis_example_dataset_installation.go b/internal/data_source_oasis_example_dataset_installation.go index 60997fb..562f3ed 100644 --- a/internal/data_source_oasis_example_dataset_installation.go +++ b/internal/data_source_oasis_example_dataset_installation.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package provider import ( "context" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -146,7 +147,7 @@ func flattenInstallation(items []*example.ExampleDatasetInstallation) []interfac for _, v := range items { ret = append(ret, map[string]interface{}{ installationExampleDatasetIdFieldName: v.GetExampledatasetId(), - installationCreatedAtFieldName: v.GetCreatedAt().String(), + installationCreatedAtFieldName: v.GetCreatedAt().AsTime().Format(time.RFC3339Nano), installationStatusFieldName: flattenInstallationStatus(v.GetStatus()), }) } diff --git a/internal/data_source_oasis_example_dataset_installation_test.go b/internal/data_source_oasis_example_dataset_installation_test.go index 0589c75..3143c26 100644 --- a/internal/data_source_oasis_example_dataset_installation_test.go +++ b/internal/data_source_oasis_example_dataset_installation_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,14 +24,14 @@ import ( "testing" "time" - "github.com/gogo/protobuf/types" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/types/known/timestamppb" example "github.com/arangodb-managed/apis/example/v1" ) func TestFlattenExampleDatasetInstallations(t *testing.T) { - created, _ := types.TimestampProto(time.Date(1980, 03, 03, 1, 1, 1, 0, time.UTC)) + created := timestamppb.New(time.Date(1980, 03, 03, 1, 1, 1, 0, time.UTC)) items := &example.ExampleDatasetInstallationList{ Items: []*example.ExampleDatasetInstallation{ { diff --git a/internal/data_source_oasis_example_dataset_test.go b/internal/data_source_oasis_example_dataset_test.go index cd16cc9..9a58fbc 100644 --- a/internal/data_source_oasis_example_dataset_test.go +++ b/internal/data_source_oasis_example_dataset_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,8 +17,6 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// Author Gergely Brautigam -// package provider @@ -26,14 +24,14 @@ import ( "testing" "time" - "github.com/gogo/protobuf/types" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/types/known/timestamppb" example "github.com/arangodb-managed/apis/example/v1" ) func TestFlattenExampleDataset(t *testing.T) { - created, _ := types.TimestampProto(time.Date(1980, 03, 03, 1, 1, 1, 0, time.UTC)) + created := timestamppb.New(time.Date(1980, 03, 03, 1, 1, 1, 0, time.UTC)) items := &example.ExampleDatasetList{ Items: []*example.ExampleDataset{ { diff --git a/internal/data_source_oasis_organization.go b/internal/data_source_oasis_organization.go index 0655896..584a019 100644 --- a/internal/data_source_oasis_organization.go +++ b/internal/data_source_oasis_organization.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package provider import ( "context" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -152,7 +153,7 @@ func flattenOrganizationObject(org *rm.Organization) map[string]interface{} { orgNameFieldName: org.GetName(), orgDescriptionFieldName: org.GetDescription(), orgUrlFieldName: org.GetUrl(), - orgCreatedAtFieldName: org.GetCreatedAt().String(), + orgCreatedAtFieldName: org.GetCreatedAt().AsTime().Format(time.RFC3339Nano), tierFieldName: flattenTierObject(org.GetTier()), } diff --git a/internal/data_source_oasis_organization_test.go b/internal/data_source_oasis_organization_test.go index 357f7f7..cd0890b 100644 --- a/internal/data_source_oasis_organization_test.go +++ b/internal/data_source_oasis_organization_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,7 +26,8 @@ import ( "testing" "time" - "github.com/gogo/protobuf/types" + "google.golang.org/protobuf/types/known/timestamppb" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/stretchr/testify/assert" @@ -65,7 +66,7 @@ func testOrgAccDataSourcePreCheck(t *testing.T) { } func TestFlattenOrganizationDataSource(t *testing.T) { - createdAtTimeStamp, _ := types.TimestampProto(time.Date(1980, 1, 1, 1, 1, 1, 0, time.UTC)) + createdAtTimeStamp := timestamppb.New(time.Date(1980, 1, 1, 1, 1, 1, 0, time.UTC)) org := rm.Organization{ Id: "test-id", Url: "https://test.url", diff --git a/internal/data_source_oasis_project.go b/internal/data_source_oasis_project.go index 4cbd048..01db174 100644 --- a/internal/data_source_oasis_project.go +++ b/internal/data_source_oasis_project.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package provider import ( "context" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -106,6 +107,6 @@ func flattenProjectObject(proj *rm.Project) map[string]interface{} { projNameFieldName: proj.GetName(), projDescriptionFieldName: proj.GetDescription(), projUrlFieldName: proj.GetUrl(), - projCreatedAtFieldName: proj.GetCreatedAt().String(), + projCreatedAtFieldName: proj.GetCreatedAt().AsTime().Format(time.RFC3339Nano), } } diff --git a/internal/data_source_oasis_project_test.go b/internal/data_source_oasis_project_test.go index 00c84ea..a01aaf7 100644 --- a/internal/data_source_oasis_project_test.go +++ b/internal/data_source_oasis_project_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,10 +27,10 @@ import ( "testing" "time" - "github.com/gogo/protobuf/types" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/types/known/timestamppb" rm "github.com/arangodb-managed/apis/resourcemanager/v1" ) @@ -69,7 +69,7 @@ func testProjectAccDataSourcePreCheck(t *testing.T) { } func TestFlattenProjectDataSource(t *testing.T) { - createdAtTimeStamp, _ := types.TimestampProto(time.Date(1980, 1, 1, 1, 1, 1, 0, time.UTC)) + createdAtTimeStamp := timestamppb.New(time.Date(1980, 1, 1, 1, 1, 1, 0, time.UTC)) proj := rm.Project{ Id: "test-id", Url: "https://test.url", diff --git a/internal/data_source_oasis_terms_and_conditions.go b/internal/data_source_oasis_terms_and_conditions.go index 2472a93..6fec8c1 100644 --- a/internal/data_source_oasis_terms_and_conditions.go +++ b/internal/data_source_oasis_terms_and_conditions.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package provider import ( "context" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -111,7 +112,7 @@ func dataSourceTermsAndConditionsRead(ctx context.Context, data *schema.Resource func flattenTCObject(tc *rm.TermsAndConditions) map[string]interface{} { return map[string]interface{}{ tcIDFieldName: tc.GetId(), - tcCreatedAtFieldName: tc.GetCreatedAt().String(), + tcCreatedAtFieldName: tc.GetCreatedAt().AsTime().Format(time.RFC3339Nano), tcContentFieldName: tc.GetContent(), } } diff --git a/internal/data_source_oasis_terms_and_conditions_test.go b/internal/data_source_oasis_terms_and_conditions_test.go index 84ef407..81d6777 100644 --- a/internal/data_source_oasis_terms_and_conditions_test.go +++ b/internal/data_source_oasis_terms_and_conditions_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,9 +26,9 @@ import ( "testing" "time" - "github.com/gogo/protobuf/types" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/types/known/timestamppb" rm "github.com/arangodb-managed/apis/resourcemanager/v1" ) @@ -59,7 +59,7 @@ func TestOasisTermsAndConditionsDataSource_Basic(t *testing.T) { } func TestFlattenTAndCDataSource(t *testing.T) { - createdAtTimeStamp, _ := types.TimestampProto(time.Date(1980, 1, 1, 1, 1, 1, 0, time.UTC)) + createdAtTimeStamp := timestamppb.New(time.Date(1980, 1, 1, 1, 1, 1, 0, time.UTC)) term := rm.TermsAndConditions{ Id: "test-id", Content: "Content", diff --git a/internal/resource_backup.go b/internal/resource_backup.go index e0fb5a1..5b481a2 100644 --- a/internal/resource_backup.go +++ b/internal/resource_backup.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2022-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,9 +26,9 @@ import ( "fmt" "time" - "github.com/gogo/protobuf/types" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "google.golang.org/protobuf/types/known/timestamppb" backup "github.com/arangodb-managed/apis/backup/v1" common "github.com/arangodb-managed/apis/common/v1" @@ -153,8 +153,8 @@ func expandBackupResource(d *schema.ResourceData) (*backup.Backup, error) { return nil, fmt.Errorf("unable to find parse field %s", backupDeploymentIDFieldName) } if v, ok := d.GetOk(backupAutoDeleteAtFieldName); ok { - autoDeleteAt, err := types.TimestampProto(time.Now().AddDate(0, 0, v.(int))) // add n days for backup auto deletion - if err != nil { + autoDeleteAt := timestamppb.New(time.Now().AddDate(0, 0, v.(int))) // add n days for backup auto deletion + if err := autoDeleteAt.CheckValid(); err != nil { return nil, fmt.Errorf("unable to parse time for auto delete backup") } ret.AutoDeletedAt = autoDeleteAt @@ -239,8 +239,8 @@ func resourceBackupUpdate(ctx context.Context, d *schema.ResourceData, m interfa backup.Upload = d.Get(backupUploadFieldName).(bool) } if d.HasChange(backupAutoDeleteAtFieldName) { - updatedAutoDeleteAt, err := types.TimestampProto(time.Now().AddDate(0, 0, d.Get(backupAutoDeleteAtFieldName).(int))) - if err != nil { + updatedAutoDeleteAt := timestamppb.New(time.Now().AddDate(0, 0, d.Get(backupAutoDeleteAtFieldName).(int))) + if err := updatedAutoDeleteAt.CheckValid(); err != nil { return diag.FromErr(errors.New("unable to parse time for auto delete backup")) } backup.AutoDeletedAt = updatedAutoDeleteAt diff --git a/internal/resource_backup_policy.go b/internal/resource_backup_policy.go index 34ce595..e76f2c3 100644 --- a/internal/resource_backup_policy.go +++ b/internal/resource_backup_policy.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,9 +25,9 @@ import ( "fmt" "time" - "github.com/gogo/protobuf/types" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "google.golang.org/protobuf/types/known/durationpb" backup "github.com/arangodb-managed/apis/backup/v1" common "github.com/arangodb-managed/apis/common/v1" @@ -368,9 +368,9 @@ func resourceBackupPolicyUpdate(ctx context.Context, d *schema.ResourceData, m i } // getRetentionPeriod calculates the retention period. -func getRetentionPeriod(v interface{}) *types.Duration { +func getRetentionPeriod(v interface{}) *durationpb.Duration { // retention period is given in hours - return types.DurationProto((time.Duration(v.(int)) * 60 * 60) * time.Second) + return durationpb.New((time.Duration(v.(int)) * 60 * 60) * time.Second) } // resourceBackupPolicyRead will gather information from the terraform store and display it accordingly. diff --git a/internal/resource_backup_policy_test.go b/internal/resource_backup_policy_test.go index b5b1a2d..38aee9c 100644 --- a/internal/resource_backup_policy_test.go +++ b/internal/resource_backup_policy_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/gogo/protobuf/types" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/types/known/durationpb" backup "github.com/arangodb-managed/apis/backup/v1" ) @@ -38,7 +38,7 @@ func TestFlattenBackupPolicy(t *testing.T) { DeploymentId: "123456", IsPaused: true, Upload: true, - RetentionPeriod: types.DurationProto(200 * time.Hour), + RetentionPeriod: durationpb.New(200 * time.Hour), EmailNotification: "None", Locked: true, AdditionalRegionIds: []string{"aks-westeurope"}, @@ -178,7 +178,7 @@ func TestExpandBackupPolicy(t *testing.T) { DeploymentId: "123456", IsPaused: true, Upload: true, - RetentionPeriod: types.DurationProto(200 * time.Hour), + RetentionPeriod: durationpb.New(200 * time.Hour), EmailNotification: "None", Locked: true, AdditionalRegionIds: []string{"aks-westeurope"}, diff --git a/internal/resource_backup_test.go b/internal/resource_backup_test.go index eb67742..023e4c2 100644 --- a/internal/resource_backup_test.go +++ b/internal/resource_backup_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2022-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,13 +28,13 @@ import ( "testing" "time" - "github.com/gogo/protobuf/types" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/types/known/timestamppb" backup "github.com/arangodb-managed/apis/backup/v1" common "github.com/arangodb-managed/apis/common/v1" @@ -200,8 +200,8 @@ func TestExpandBackup(t *testing.T) { backup, err := expandBackupResource(resourceData) assert.NoError(t, err) - autoDeleteAt, err := types.TimestampProto(time.Now().AddDate(0, 0, raw[backupAutoDeleteAtFieldName].(int))) - assert.NoError(t, err) + autoDeleteAt := timestamppb.New(time.Now().AddDate(0, 0, raw[backupAutoDeleteAtFieldName].(int))) + assert.NoError(t, autoDeleteAt.CheckValid()) expected.AutoDeletedAt = autoDeleteAt assert.Equal(t, expected.AutoDeletedAt.GetSeconds(), backup.AutoDeletedAt.GetSeconds()) diff --git a/internal/resource_certificate.go b/internal/resource_certificate.go index 5813a65..f080d6b 100644 --- a/internal/resource_certificate.go +++ b/internal/resource_certificate.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,9 +24,9 @@ import ( "context" "time" - "github.com/gogo/protobuf/types" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "google.golang.org/protobuf/types/known/durationpb" common "github.com/arangodb-managed/apis/common/v1" crypto "github.com/arangodb-managed/apis/crypto/v1" @@ -171,8 +171,8 @@ func flattenCertificateResource(cert *crypto.CACertificate) map[string]interface useWellKnownCertificateFieldName: cert.GetUseWellKnownCertificate(), lifetimeFieldName: int(cert.GetLifetime().GetSeconds()), isDefaultFieldName: cert.GetIsDefault(), - expiresAtFieldName: cert.GetExpiresAt().String(), - createdAtFieldName: cert.GetCreatedAt().String(), + expiresAtFieldName: cert.GetExpiresAt().AsTime().Format(time.RFC3339Nano), + createdAtFieldName: cert.GetCreatedAt().AsTime().Format(time.RFC3339Nano), lockedFieldName: cert.GetLocked(), } return flatted @@ -186,7 +186,7 @@ func expandToCertificate(d *schema.ResourceData) *crypto.CACertificate { description string lifetime int useWellKnownCertificate bool - lt *types.Duration + lt *durationpb.Duration locked bool ) if v, ok := d.GetOk(descriptionFieldName); ok { @@ -195,7 +195,7 @@ func expandToCertificate(d *schema.ResourceData) *crypto.CACertificate { if v, ok := d.GetOk(lifetimeFieldName); ok { lifetime = v.(int) if lifetime > 0 { - lt = types.DurationProto(time.Duration(lifetime) * time.Second) + lt = durationpb.New(time.Duration(lifetime) * time.Second) } } if v, ok := d.GetOk(useWellKnownCertificateFieldName); ok { @@ -245,7 +245,7 @@ func resourceCertificateUpdate(ctx context.Context, d *schema.ResourceData, m in cert.UseWellKnownCertificate = d.Get(useWellKnownCertificateFieldName).(bool) } if d.HasChange(lifetimeFieldName) { - cert.Lifetime = types.DurationProto(time.Duration(d.Get(lifetimeFieldName).(int))) + cert.Lifetime = durationpb.New(time.Duration(d.Get(lifetimeFieldName).(int))) } if d.HasChange(lockedFieldName) { cert.Locked = d.Get(lockedFieldName).(bool) diff --git a/internal/resource_certificate_test.go b/internal/resource_certificate_test.go index 4949435..b9f58cf 100644 --- a/internal/resource_certificate_test.go +++ b/internal/resource_certificate_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,7 +27,9 @@ import ( "testing" "time" - "github.com/gogo/protobuf/types" + "google.golang.org/protobuf/types/known/durationpb" + "google.golang.org/protobuf/types/known/timestamppb" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -99,13 +101,13 @@ func TestFlattenCertificateResource(t *testing.T) { lockedFieldName: false, } - created, _ := types.TimestampProto(time.Date(1980, 03, 03, 1, 1, 1, 0, time.UTC)) - expires, _ := types.TimestampProto(time.Date(1980, 03, 10, 1, 1, 1, 0, time.UTC)) + created := timestamppb.New(time.Date(1980, 03, 03, 1, 1, 1, 0, time.UTC)) + expires := timestamppb.New(time.Date(1980, 03, 10, 1, 1, 1, 0, time.UTC)) cert := crypto.CACertificate{ Name: "test-name", Description: "test-description", ProjectId: "123456789", - Lifetime: types.DurationProto(1 * time.Hour), + Lifetime: durationpb.New(1 * time.Hour), CreatedAt: created, ExpiresAt: expires, IsDefault: false, diff --git a/internal/resource_example_dataset_installation.go b/internal/resource_example_dataset_installation.go index 9abfd67..550668c 100644 --- a/internal/resource_example_dataset_installation.go +++ b/internal/resource_example_dataset_installation.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ package provider import ( "context" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -163,7 +164,7 @@ func flattenExampleDatasetInstallation(item *example.ExampleDatasetInstallation) return map[string]interface{}{ datasetDeploymentIdFieldName: item.GetDeploymentId(), datasetExampleDatasetIdFieldName: item.GetExampledatasetId(), - datasetCreatedAtFieldName: item.GetCreatedAt().String(), + datasetCreatedAtFieldName: item.GetCreatedAt().AsTime().Format(time.RFC3339Nano), datasetStatusFieldName: flattenStatus(item.GetStatus()), } } diff --git a/internal/resource_example_dataset_installation_test.go b/internal/resource_example_dataset_installation_test.go index d96d249..78f953c 100644 --- a/internal/resource_example_dataset_installation_test.go +++ b/internal/resource_example_dataset_installation_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,15 +24,15 @@ import ( "testing" "time" - "github.com/gogo/protobuf/types" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/types/known/timestamppb" example "github.com/arangodb-managed/apis/example/v1" ) func TestFlattenExampleDatasetInstallation(t *testing.T) { - created, _ := types.TimestampProto(time.Date(1980, 03, 03, 1, 1, 1, 0, time.UTC)) + created := timestamppb.New(time.Date(1980, 03, 03, 1, 1, 1, 0, time.UTC)) testInt := &example.ExampleDatasetInstallation{ Id: "test-id", Url: "test-url", diff --git a/internal/resource_ip_allowlist.go b/internal/resource_ip_allowlist.go index 2af830f..0ab10ec 100644 --- a/internal/resource_ip_allowlist.go +++ b/internal/resource_ip_allowlist.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ package provider import ( "context" "fmt" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -189,7 +190,7 @@ func flattenIPAllowlistResource(ip *security.IPAllowlist) map[string]interface{} ipDescriptionFieldName: ip.GetDescription(), ipCIDRRangeFieldName: ip.GetCidrRanges(), ipRemoteInspectionAllowedFieldName: ip.GetRemoteInspectionAllowed(), - ipCreatedAtFieldName: ip.GetCreatedAt().String(), + ipCreatedAtFieldName: ip.GetCreatedAt().AsTime().Format(time.RFC3339Nano), ipIsDeletedFieldName: ip.GetIsDeleted(), ipLockedFieldName: ip.GetLocked(), } diff --git a/internal/resource_ip_allowlist_test.go b/internal/resource_ip_allowlist_test.go index 9947050..e33c874 100644 --- a/internal/resource_ip_allowlist_test.go +++ b/internal/resource_ip_allowlist_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,12 +23,12 @@ package provider import ( "context" "fmt" + "google.golang.org/protobuf/types/known/timestamppb" "os" "regexp" "testing" "time" - "github.com/gogo/protobuf/types" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -92,7 +92,7 @@ func TestFlattenIPAllowlistResource(t *testing.T) { ipLockedFieldName: true, } - created, _ := types.TimestampProto(time.Date(1980, 03, 03, 1, 1, 1, 0, time.UTC)) + created := timestamppb.New(time.Date(1980, 03, 03, 1, 1, 1, 0, time.UTC)) cert := security.IPAllowlist{ Name: "test-name", Description: "test-description", diff --git a/internal/resource_notebook.go b/internal/resource_notebook.go index 6f2527b..dca2f51 100644 --- a/internal/resource_notebook.go +++ b/internal/resource_notebook.go @@ -23,6 +23,7 @@ package provider import ( "context" "fmt" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -245,24 +246,24 @@ func flattenNotebookResource(notebook *nb.Notebook) map[string]interface{} { } flattened[notebookIsPausedFieldName] = notebook.GetIsPaused() if notebook.GetLastPausedAt() != nil { - flattened[notebookLastPausedAtFieldName] = notebook.GetLastPausedAt().String() + flattened[notebookLastPausedAtFieldName] = notebook.GetLastPausedAt().AsTime().Format(time.RFC3339Nano) } if notebook.GetLastResumedAt() != nil { - flattened[notebookLastResumedAtFieldName] = notebook.GetLastResumedAt().String() + flattened[notebookLastResumedAtFieldName] = notebook.GetLastResumedAt().AsTime().Format(time.RFC3339Nano) } if notebook.GetCreatedById() != "" { flattened[notebookCreatedByIdFieldName] = notebook.GetCreatedById() } + flattened[notebookCreatedAtFieldName] = notebook.GetCreatedAt() if notebook.GetCreatedAt() != nil { - flattened[notebookCreatedAtFieldName] = notebook.GetCreatedAt() + flattened[notebookCreatedAtFieldName] = notebook.GetCreatedAt().AsTime().Format(time.RFC3339Nano) } - flattened[notebookCreatedAtFieldName] = notebook.GetCreatedAt().String() if notebook.GetModel() != nil { flattened[notebookModelFieldName] = flattenNotebookModelSpecResource(notebook.GetModel()) } flattened[notebookIsDeletedFieldName] = notebook.GetIsDeleted() if notebook.GetDeletedAt() != nil { - flattened[notebookDeletedAtFieldName] = notebook.GetDeletedAt().String() + flattened[notebookDeletedAtFieldName] = notebook.GetDeletedAt().AsTime().Format(time.RFC3339Nano) } if notebook.GetStatus() != nil { flattened[notebookStatusFieldName] = flattenNotebookStatus(notebook.GetStatus()) diff --git a/internal/resource_notebook_test.go b/internal/resource_notebook_test.go index baef8b9..fa73753 100644 --- a/internal/resource_notebook_test.go +++ b/internal/resource_notebook_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2022-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,7 +23,6 @@ package provider import ( "context" "fmt" - "github.com/gogo/protobuf/types" "os" "regexp" "testing" @@ -35,6 +34,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/types/known/timestamppb" common "github.com/arangodb-managed/apis/common/v1" nb "github.com/arangodb-managed/apis/notebook/v1" @@ -114,7 +114,7 @@ func testNotebookConfig(project, notebookResource string) string { // TestFlattenNotebook tests the Oasis Notebook flattening for Terraform schema compatibility. func TestFlattenNotebook(t *testing.T) { - created, _ := types.TimestampProto(time.Date(2022, 03, 03, 1, 1, 1, 0, time.UTC)) + created := timestamppb.New(time.Date(2022, 03, 03, 1, 1, 1, 0, time.UTC)) notebook := &nb.Notebook{ Id: "test", diff --git a/internal/resource_project.go b/internal/resource_project.go index ea28cf8..3ced803 100644 --- a/internal/resource_project.go +++ b/internal/resource_project.go @@ -23,6 +23,7 @@ package provider import ( "context" "fmt" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -145,7 +146,7 @@ func flattenProjectResource(project *rm.Project) map[string]interface{} { projectNameFieldName: project.GetName(), projectDescriptionFieldName: project.GetDescription(), projectOrganizationFieldName: project.GetOrganizationId(), - projectCreatedAtFieldName: project.GetCreatedAt().String(), + projectCreatedAtFieldName: project.GetCreatedAt().AsTime().Format(time.RFC3339Nano), projectIsDeletedFieldName: project.GetIsDeleted(), projectLockedFieldName: project.GetLocked(), } diff --git a/internal/resource_project_test.go b/internal/resource_project_test.go index ef2cf01..1de4f11 100644 --- a/internal/resource_project_test.go +++ b/internal/resource_project_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,7 +27,8 @@ import ( "testing" "time" - "github.com/gogo/protobuf/types" + "google.golang.org/protobuf/types/known/timestamppb" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -85,7 +86,7 @@ func TestFlattenProjectResource(t *testing.T) { projectLockedFieldName: false, } - created, _ := types.TimestampProto(time.Date(1980, 03, 03, 1, 1, 1, 0, time.UTC)) + created := timestamppb.New(time.Date(1980, 03, 03, 1, 1, 1, 0, time.UTC)) proj := rm.Project{ Name: "test-name", Description: "test-description",