From ec59f2005d273bdc164076862f0d8f0744bede62 Mon Sep 17 00:00:00 2001 From: miton18 Date: Tue, 24 Dec 2024 08:53:35 +0100 Subject: [PATCH 1/3] deps: bump --- go.mod | 53 +++++++++++++-------------- go.sum | 113 ++++++++++++++++++++++++++------------------------------- 2 files changed, 77 insertions(+), 89 deletions(-) diff --git a/go.mod b/go.mod index ec162b9..2a7eb89 100644 --- a/go.mod +++ b/go.mod @@ -1,18 +1,18 @@ module go.clever-cloud.com/terraform-provider -go 1.22.0 +go 1.22.7 -toolchain go1.23.2 +toolchain go1.23.4 require ( - github.com/go-git/go-billy/v5 v5.5.0 + github.com/go-git/go-billy/v5 v5.6.0 github.com/go-git/go-git/v5 v5.12.0 - github.com/hashicorp/terraform-plugin-docs v0.19.4 + github.com/hashicorp/terraform-plugin-docs v0.20.1 github.com/hashicorp/terraform-plugin-framework v1.13.0 github.com/hashicorp/terraform-plugin-go v0.25.0 github.com/hashicorp/terraform-plugin-log v0.9.0 - github.com/hashicorp/terraform-plugin-testing v1.10.0 - github.com/minio/minio-go/v7 v7.0.69 + github.com/hashicorp/terraform-plugin-testing v1.11.0 + github.com/minio/minio-go/v7 v7.0.82 go.clever-cloud.dev/client v0.0.8 ) @@ -30,15 +30,17 @@ require ( github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/armon/go-radix v1.0.0 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect - github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect + github.com/bmatcuk/doublestar/v4 v4.7.1 // indirect github.com/cloudflare/circl v1.3.7 // indirect - github.com/cyphar/filepath-securejoin v0.2.4 // indirect + github.com/cyphar/filepath-securejoin v0.2.5 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/fatih/color v1.16.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect + github.com/go-ini/ini v1.67.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/goccy/go-json v0.10.3 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-cmp v0.6.0 // indirect @@ -54,39 +56,35 @@ require ( github.com/hashicorp/go-retryablehttp v0.7.7 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.7.0 // indirect - github.com/hashicorp/hc-install v0.8.0 // indirect - github.com/hashicorp/hcl/v2 v2.21.0 // indirect + github.com/hashicorp/hc-install v0.9.0 // indirect + github.com/hashicorp/hcl/v2 v2.23.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.21.0 // indirect - github.com/hashicorp/terraform-json v0.22.1 // indirect - github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 // indirect + github.com/hashicorp/terraform-json v0.23.0 // indirect + github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0 // indirect github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/huandu/xstrings v1.3.3 // indirect github.com/imdario/mergo v0.3.15 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/json-iterator/go v1.1.12 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect - github.com/klauspost/compress v1.17.6 // indirect - github.com/klauspost/cpuid/v2 v2.2.6 // indirect + github.com/klauspost/compress v1.17.11 // indirect + github.com/klauspost/cpuid/v2 v2.2.8 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect github.com/minio/md5-simd v1.1.2 // indirect - github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect github.com/oklog/run v1.0.0 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/posener/complete v1.2.3 // indirect - github.com/rs/xid v1.5.0 // indirect + github.com/rs/xid v1.6.0 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/sirupsen/logrus v1.9.3 // indirect @@ -96,7 +94,7 @@ require ( github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect - github.com/yuin/goldmark v1.7.1 // indirect + github.com/yuin/goldmark v1.7.7 // indirect github.com/yuin/goldmark-meta v1.1.0 // indirect github.com/zclconf/go-cty v1.15.0 // indirect go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect @@ -104,19 +102,18 @@ require ( go.opentelemetry.io/otel v1.21.0 // indirect go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/trace v1.21.0 // indirect - golang.org/x/crypto v0.28.0 // indirect - golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect - golang.org/x/mod v0.19.0 // indirect + golang.org/x/crypto v0.29.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/mod v0.21.0 // indirect golang.org/x/net v0.30.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.26.0 // indirect - golang.org/x/text v0.19.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect + golang.org/x/sync v0.9.0 // indirect + golang.org/x/sys v0.27.0 // indirect + golang.org/x/text v0.20.0 // indirect + golang.org/x/tools v0.23.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.35.1 // indirect - gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index dc6bf1e..02a1542 100644 --- a/go.sum +++ b/go.sum @@ -30,14 +30,14 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= -github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q= +github.com/bmatcuk/doublestar/v4 v4.7.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= -github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= -github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= +github.com/cyphar/filepath-securejoin v0.2.5 h1:6iR5tXJ/e6tJZzzdMc1km3Sa7RRIVBKAK32O2s7AYfo= +github.com/cyphar/filepath-securejoin v0.2.5/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= 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= @@ -58,12 +58,14 @@ github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= -github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= +github.com/go-git/go-billy/v5 v5.6.0 h1:w2hPNtoehvJIxR00Vb4xX94qHQi/ApZfX+nBE2Cjio8= +github.com/go-git/go-billy/v5 v5.6.0/go.mod h1:sFDq7xD3fn3E0GOwUSZqHo9lrkmx8xJhA0ZrfvjBRGM= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= +github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= +github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -71,6 +73,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= 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/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= +github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -82,7 +86,6 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -112,28 +115,28 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hc-install v0.8.0 h1:LdpZeXkZYMQhoKPCecJHlKvUkQFixN/nvyR1CdfOLjI= -github.com/hashicorp/hc-install v0.8.0/go.mod h1:+MwJYjDfCruSD/udvBmRB22Nlkwwkwf5sAB6uTIhSaU= -github.com/hashicorp/hcl/v2 v2.21.0 h1:lve4q/o/2rqwYOgUg3y3V2YPyD1/zkCLGjIV74Jit14= -github.com/hashicorp/hcl/v2 v2.21.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= +github.com/hashicorp/hc-install v0.9.0 h1:2dIk8LcvANwtv3QZLckxcjyF5w8KVtiMxu6G6eLhghE= +github.com/hashicorp/hc-install v0.9.0/go.mod h1:+6vOP+mf3tuGgMApVYtmsnDoKWMDcFXeTxCACYZ8SFg= +github.com/hashicorp/hcl/v2 v2.23.0 h1:Fphj1/gCylPxHutVSEOf2fBOh1VE4AuLV7+kbJf3qos= +github.com/hashicorp/hcl/v2 v2.23.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= github.com/hashicorp/terraform-exec v0.21.0/go.mod h1:1PPeMYou+KDUSSeRE9szMZ/oHf4fYUmB923Wzbq1ICg= -github.com/hashicorp/terraform-json v0.22.1 h1:xft84GZR0QzjPVWs4lRUwvTcPnegqlyS7orfb5Ltvec= -github.com/hashicorp/terraform-json v0.22.1/go.mod h1:JbWSQCLFSXFFhg42T7l9iJwdGXBYV8fmmD6o/ML4p3A= -github.com/hashicorp/terraform-plugin-docs v0.19.4 h1:G3Bgo7J22OMtegIgn8Cd/CaSeyEljqjH3G39w28JK4c= -github.com/hashicorp/terraform-plugin-docs v0.19.4/go.mod h1:4pLASsatTmRynVzsjEhbXZ6s7xBlUw/2Kt0zfrq8HxA= +github.com/hashicorp/terraform-json v0.23.0 h1:sniCkExU4iKtTADReHzACkk8fnpQXrdD2xoR+lppBkI= +github.com/hashicorp/terraform-json v0.23.0/go.mod h1:MHdXbBAbSg0GvzuWazEGKAn/cyNfIB7mN6y7KJN6y2c= +github.com/hashicorp/terraform-plugin-docs v0.20.1 h1:Fq7E/HrU8kuZu3hNliZGwloFWSYfWEOWnylFhYQIoys= +github.com/hashicorp/terraform-plugin-docs v0.20.1/go.mod h1:Yz6HoK7/EgzSrHPB9J/lWFzwl9/xep2OPnc5jaJDV90= github.com/hashicorp/terraform-plugin-framework v1.13.0 h1:8OTG4+oZUfKgnfTdPTJwZ532Bh2BobF4H+yBiYJ/scw= github.com/hashicorp/terraform-plugin-framework v1.13.0/go.mod h1:j64rwMGpgM3NYXTKuxrCnyubQb/4VKldEKlcG8cvmjU= github.com/hashicorp/terraform-plugin-go v0.25.0 h1:oi13cx7xXA6QciMcpcFi/rwA974rdTxjqEhXJjbAyks= github.com/hashicorp/terraform-plugin-go v0.25.0/go.mod h1:+SYagMYadJP86Kvn+TGeV+ofr/R3g4/If0O5sO96MVw= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 h1:kJiWGx2kiQVo97Y5IOGR4EMcZ8DtMswHhUuFibsCQQE= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0/go.mod h1:sl/UoabMc37HA6ICVMmGO+/0wofkVIRxf+BMb/dnoIg= -github.com/hashicorp/terraform-plugin-testing v1.10.0 h1:2+tmRNhvnfE4Bs8rB6v58S/VpqzGC6RCh9Y8ujdn+aw= -github.com/hashicorp/terraform-plugin-testing v1.10.0/go.mod h1:iWRW3+loP33WMch2P/TEyCxxct/ZEcCGMquSLSCVsrc= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0 h1:wyKCCtn6pBBL46c1uIIBNUOWlNfYXfXpVo16iDyLp8Y= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0/go.mod h1:B0Al8NyYVr8Mp/KLwssKXG1RqnTk7FySqSn4fRuLNgw= +github.com/hashicorp/terraform-plugin-testing v1.11.0 h1:MeDT5W3YHbONJt2aPQyaBsgQeAIckwPX41EUHXEn29A= +github.com/hashicorp/terraform-plugin-testing v1.11.0/go.mod h1:WNAHQ3DcgV/0J+B15WTE6hDvxcUdkPPpnB1FR3M910U= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= @@ -149,15 +152,13 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= -github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= +github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -178,10 +179,8 @@ github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/Qd github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= -github.com/minio/minio-go/v7 v7.0.69 h1:l8AnsQFyY1xiwa/DaQskY4NXSLA2yrGsW5iD9nRPVS0= -github.com/minio/minio-go/v7 v7.0.69/go.mod h1:XAvOPJQ5Xlzk5o3o/ArO2NMbhSGkimC+bpW/ngRKDmQ= -github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= -github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= +github.com/minio/minio-go/v7 v7.0.82 h1:tWfICLhmp2aFPXL8Tli0XDTHj2VB/fNf0PC1f/i1gRo= +github.com/minio/minio-go/v7 v7.0.82/go.mod h1:84gmIilaX4zcvAWWzJ5Z1WI5axN+hAbM5w25xf8xvC0= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= @@ -194,15 +193,10 @@ github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -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= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= +github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -211,10 +205,10 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= -github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= +github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= @@ -230,7 +224,6 @@ github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 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.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -247,8 +240,8 @@ github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.7.1 h1:3bajkSilaCbjdKVsKdZjZCLBNPL9pYzrCakKaf4U49U= -github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark v1.7.7 h1:5m9rrB1sW3JUMToKFQfb+FGt1U7r57IHu5GrYrG2nqU= +github.com/yuin/goldmark v1.7.7/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ= @@ -273,13 +266,13 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= -golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= -golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= -golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= +golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -291,8 +284,8 @@ golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/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-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -312,13 +305,13 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -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/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= +golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= 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= @@ -326,13 +319,13 @@ 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.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= -golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= +golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -351,8 +344,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= -gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 1cde4178a830bd5e4b214bd84fb4f12851162429 Mon Sep 17 00:00:00 2001 From: miton18 Date: Thu, 26 Dec 2024 15:16:52 +0100 Subject: [PATCH 2/3] feat(PHP): implem update --- pkg/application/creation.go | 61 +++++++++++ pkg/attributes/addon.go | 7 +- pkg/attributes/runtime.go | 4 + pkg/helper/provider_block.go | 16 ++- pkg/helper/state.go | 20 ++++ pkg/resources/addon/addon_test.go | 6 +- pkg/resources/cellar/bucket/bucket_test.go | 7 +- pkg/resources/cellar/cellar_test.go | 6 +- pkg/resources/cellar/schema.go | 6 +- pkg/resources/docker/resource_docker_test.go | 6 +- pkg/resources/java/java_test.go | 6 +- pkg/resources/keycloak/keycloak_test.go | 10 +- pkg/resources/materiakv/materiakv_test.go | 6 +- pkg/resources/metabase/metabase_test.go | 10 +- pkg/resources/mongodb/mongodb_test.go | 12 +-- pkg/resources/nodejs/nodejs_test.go | 10 +- pkg/resources/php/crud.go | 102 +++++++++++++++++-- pkg/resources/php/php_test.go | 17 +++- pkg/resources/postgresql/postgresql_test.go | 12 +-- pkg/resources/scala/scala_test.go | 6 +- pkg/resources/static/static_test.go | 6 +- pkg/tmp/app.go | 24 +++-- 22 files changed, 287 insertions(+), 73 deletions(-) create mode 100644 pkg/helper/state.go diff --git a/pkg/application/creation.go b/pkg/application/creation.go index 705b446..a34f701 100644 --- a/pkg/application/creation.go +++ b/pkg/application/creation.go @@ -20,6 +20,17 @@ type CreateReq struct { Dependencies []string } +type UpdateReq struct { + ID string + Client *client.Client + Organization string + Application tmp.UpdateAppReq + Environment map[string]string + VHosts []string + Deployment *Deployment + Dependencies []string +} + type Deployment struct { Repository string Commit *string @@ -79,6 +90,56 @@ func CreateApp(ctx context.Context, req CreateReq) (*CreateRes, diag.Diagnostics return res, diags } +func UpdateApp(ctx context.Context, req UpdateReq) (*CreateRes, diag.Diagnostics) { + diags := diag.Diagnostics{} + + // Application + res := &CreateRes{} + + appRes := tmp.UpdateApp(ctx, req.Client, req.Organization, req.ID, req.Application) + if appRes.HasError() { + diags.AddError("failed to update application", appRes.Error().Error()) + tflog.Error(ctx, "failed to update app", map[string]interface{}{"error": appRes.Error().Error(), "payload": fmt.Sprintf("%+v", req.Application)}) + return nil, diags + } + + res.Application = *appRes.Payload() + + // Environment + envRes := tmp.UpdateAppEnv(ctx, req.Client, req.Organization, res.Application.ID, req.Environment) + if envRes.HasError() { + diags.AddError("failed to configure application environment", envRes.Error().Error()) + } + + // VHosts + for _, vhost := range req.VHosts { + addVhostRes := tmp.AddAppVHost(ctx, req.Client, req.Organization, res.Application.ID, vhost) + if addVhostRes.HasError() { + diags.AddError("failed to add additional vhost", addVhostRes.Error().Error()) + } + } + // TODO: old vhost need to be cleaned + + // Git Deployment + if req.Deployment != nil { + diags.Append(gitDeploy(ctx, *req.Deployment, req.Client, res.Application.DeployURL)...) + } + + // Dependencies + for _, dependency := range req.Dependencies { + // TODO: support another apps as dependency + + depRes := tmp.AddAppLinkedAddons(ctx, req.Client, req.Organization, res.Application.ID, dependency) + if depRes.HasError() { + tflog.Error(ctx, "ERROR: "+dependency, map[string]interface{}{"err": depRes.Error().Error()}) + diags.AddError("failed to add dependency", depRes.Error().Error()) + } + } + // TODO: unlink unneeded deps + + return res, diags +} + // on clever side, it's an enum func FromForceHTTPS(force bool) string { if force { diff --git a/pkg/attributes/addon.go b/pkg/attributes/addon.go index 0783e5e..c1dbb61 100644 --- a/pkg/attributes/addon.go +++ b/pkg/attributes/addon.go @@ -2,7 +2,10 @@ package attributes import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/int64planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/types" "go.clever-cloud.com/terraform-provider/pkg" ) @@ -16,7 +19,7 @@ type Addon struct { } var addonCommon = map[string]schema.Attribute{ - "id": schema.StringAttribute{Computed: true, MarkdownDescription: "Generated unique identifier"}, + "id": schema.StringAttribute{Computed: true, MarkdownDescription: "Generated unique identifier", PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}}, "name": schema.StringAttribute{Required: true, MarkdownDescription: "Name of the service"}, "plan": schema.StringAttribute{Required: true, MarkdownDescription: "Database size and spec"}, "region": schema.StringAttribute{ @@ -25,7 +28,7 @@ var addonCommon = map[string]schema.Attribute{ Default: stringdefault.StaticString("par"), MarkdownDescription: "Geographical region where the data will be stored", }, - "creation_date": schema.Int64Attribute{Computed: true, MarkdownDescription: "Date of database creation"}, + "creation_date": schema.Int64Attribute{Computed: true, MarkdownDescription: "Date of database creation", PlanModifiers: []planmodifier.Int64{int64planmodifier.UseStateForUnknown()}}, } func WithAddonCommons(runtimeSpecifics map[string]schema.Attribute) map[string]schema.Attribute { diff --git a/pkg/attributes/runtime.go b/pkg/attributes/runtime.go index 0da76ce..ef1ef74 100644 --- a/pkg/attributes/runtime.go +++ b/pkg/attributes/runtime.go @@ -7,7 +7,9 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/types" "go.clever-cloud.com/terraform-provider/pkg" ) @@ -98,10 +100,12 @@ var runtimeCommon = map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, MarkdownDescription: "Unique identifier generated during application creation", + PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, }, "deploy_url": schema.StringAttribute{ Computed: true, MarkdownDescription: "Git URL used to push source code", + PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, }, // cleverapps one "vhost": schema.StringAttribute{ diff --git a/pkg/helper/provider_block.go b/pkg/helper/provider_block.go index e89c0a0..eda8c75 100644 --- a/pkg/helper/provider_block.go +++ b/pkg/helper/provider_block.go @@ -1,9 +1,16 @@ package helper +import ( + "fmt" + + "go.clever-cloud.com/terraform-provider/pkg" +) + // Provider structur type Provider struct { provider string organisation string + blocks []fmt.Stringer } // New function type that accepts pointer to Provider @@ -37,6 +44,11 @@ func (p *Provider) SetOrganisation(orgName string) *Provider { return p } +func (p *Provider) Append(blocks ...fmt.Stringer) *Provider { + p.blocks = blocks + return p +} + // Provider block // - desc: chained function that stringify Provider into a terraform block // - args: none @@ -45,6 +57,8 @@ func (p *Provider) String() string { s := `provider "` + p.provider + `" { organisation = "` + p.organisation + `" } -` +` + pkg.Reduce[fmt.Stringer, string](p.blocks, "", func(acc string, block fmt.Stringer) string { + return acc + block.String() + "\n" + }) return s } diff --git a/pkg/helper/state.go b/pkg/helper/state.go new file mode 100644 index 0000000..71a3528 --- /dev/null +++ b/pkg/helper/state.go @@ -0,0 +1,20 @@ +package helper + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" +) + +func PlanFrom[T any](ctx context.Context, p tfsdk.Plan, diags diag.Diagnostics) T { + var t T + diags.Append(p.Get(ctx, &t)...) + return t +} + +func StateFrom[T any](ctx context.Context, s tfsdk.State, diags diag.Diagnostics) T { + var t T + diags.Append(s.Get(ctx, &t)...) + return t +} diff --git a/pkg/resources/addon/addon_test.go b/pkg/resources/addon/addon_test.go index 56f33ca..835d6a1 100644 --- a/pkg/resources/addon/addon_test.go +++ b/pkg/resources/addon/addon_test.go @@ -28,7 +28,7 @@ func TestAccAddon_basic(t *testing.T) { fullName := fmt.Sprintf("clevercloud_addon.%s", rName) cc := client.New(client.WithAutoOauthConfig()) org := os.Getenv("ORGANISATION") - providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org).String() + providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org) addonBlock := helper.NewRessource( "clevercloud_addon", rName, @@ -37,7 +37,7 @@ func TestAccAddon_basic(t *testing.T) { "region": "par", "plan": "clever_solo", "third_party_provider": "mailpace", - })).String() + })) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -62,7 +62,7 @@ func TestAccAddon_basic(t *testing.T) { }, Steps: []resource.TestStep{{ ResourceName: rName, - Config: providerBlock + addonBlock, + Config: providerBlock.Append(addonBlock).String(), Check: resource.ComposeAggregateTestCheckFunc( resource.TestMatchResourceAttr(fullName, "id", regexp.MustCompile(`^addon_.*`)), //resource.TestMatchResourceAttr(fullName, "password", regexp.MustCompile(`^[a-zA-Z0-9]+$`)), diff --git a/pkg/resources/cellar/bucket/bucket_test.go b/pkg/resources/cellar/bucket/bucket_test.go index 306d7d5..fcf1366 100644 --- a/pkg/resources/cellar/bucket/bucket_test.go +++ b/pkg/resources/cellar/bucket/bucket_test.go @@ -29,7 +29,7 @@ func TestAccCellarBucket_basic(t *testing.T) { rName := fmt.Sprintf("my-bucket-%d", time.Now().UnixMilli()) cc := client.New(client.WithAutoOauthConfig()) org := os.Getenv("ORGANISATION") - providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org).String() + providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org) cellar := &tmp.AddonResponse{} if os.Getenv("TF_ACC") == "1" { @@ -41,6 +41,7 @@ func TestAccCellarBucket_basic(t *testing.T) { }) if res.HasError() { t.Errorf("failed to create depdendence Cellar: %s", res.Error().Error()) + return } cellar = res.Payload() @@ -59,7 +60,7 @@ func TestAccCellarBucket_basic(t *testing.T) { helper.SetKeyValues(map[string]any{ "id": rName, "cellar_id": cellar.RealID, - })).String() + })) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -73,7 +74,7 @@ func TestAccCellarBucket_basic(t *testing.T) { ProtoV6ProviderFactories: TestProtoV6Provider, Steps: []resource.TestStep{{ ResourceName: "cellar_bucket_" + rName, - Config: providerBlock + cellarBucketBlock, + Config: providerBlock.Append(cellarBucketBlock).String(), Check: resource.ComposeAggregateTestCheckFunc( func(*terraform.State) error { return nil diff --git a/pkg/resources/cellar/cellar_test.go b/pkg/resources/cellar/cellar_test.go index 09f4733..47760a9 100644 --- a/pkg/resources/cellar/cellar_test.go +++ b/pkg/resources/cellar/cellar_test.go @@ -29,14 +29,14 @@ func TestAccCellar_basic(t *testing.T) { fullName := fmt.Sprintf("clevercloud_cellar.%s", rName) cc := client.New(client.WithAutoOauthConfig()) org := os.Getenv("ORGANISATION") - providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org).String() + providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org) cellarBlock := helper.NewRessource( "clevercloud_cellar", rName, helper.SetKeyValues(map[string]any{ "name": rName, "region": "par", - })).String() + })) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -47,7 +47,7 @@ func TestAccCellar_basic(t *testing.T) { ProtoV6ProviderFactories: TestProtoV6Provider, Steps: []resource.TestStep{{ ResourceName: "cellar_" + rName, - Config: providerBlock + cellarBlock, + Config: providerBlock.Append(cellarBlock).String(), Check: resource.ComposeAggregateTestCheckFunc( resource.TestMatchResourceAttr(fullName, "id", regexp.MustCompile(`^cellar_.*`)), resource.TestMatchResourceAttr(fullName, "host", regexp.MustCompile(`^.*\.services.clever-cloud.com$`)), diff --git a/pkg/resources/cellar/schema.go b/pkg/resources/cellar/schema.go index 3306bde..4519cd7 100644 --- a/pkg/resources/cellar/schema.go +++ b/pkg/resources/cellar/schema.go @@ -6,7 +6,9 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/types" ) @@ -39,8 +41,8 @@ func (r ResourceCellar) Schema(_ context.Context, req resource.SchemaRequest, re }, // provider - "id": schema.StringAttribute{Computed: true, MarkdownDescription: "Generated unique identifier"}, - "host": schema.StringAttribute{Computed: true, MarkdownDescription: "S3 compatible Cellar endpoint"}, + "id": schema.StringAttribute{Computed: true, MarkdownDescription: "Generated unique identifier", PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}}, + "host": schema.StringAttribute{Computed: true, MarkdownDescription: "S3 compatible Cellar endpoint", PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}}, "key_id": schema.StringAttribute{Computed: true, MarkdownDescription: "Key ID used to authenticate"}, "key_secret": schema.StringAttribute{Computed: true, Sensitive: true, MarkdownDescription: "Key secret used to authenticate"}, }, diff --git a/pkg/resources/docker/resource_docker_test.go b/pkg/resources/docker/resource_docker_test.go index 71685c5..5048a91 100644 --- a/pkg/resources/docker/resource_docker_test.go +++ b/pkg/resources/docker/resource_docker_test.go @@ -29,7 +29,7 @@ func TestAccDocker_basic(t *testing.T) { fullName := fmt.Sprintf("clevercloud_docker.%s", rName) cc := client.New(client.WithAutoOauthConfig()) org := os.Getenv("ORGANISATION") - providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org).String() + providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org) dockerBlock := helper.NewRessource( "clevercloud_docker", rName, @@ -41,7 +41,7 @@ func TestAccDocker_basic(t *testing.T) { "smallest_flavor": "XS", "biggest_flavor": "M", "additional_vhosts": [1]string{"toto-tf5283457829345.com"}, - })).String() + })) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -53,7 +53,7 @@ func TestAccDocker_basic(t *testing.T) { Steps: []resource.TestStep{{ Destroy: false, ResourceName: rName, - Config: providerBlock + dockerBlock, + Config: providerBlock.Append(dockerBlock).String(), Check: resource.ComposeAggregateTestCheckFunc( resource.TestMatchResourceAttr(fullName, "id", regexp.MustCompile(`^app_.*$`)), resource.TestMatchResourceAttr(fullName, "deploy_url", regexp.MustCompile(`^git\+ssh.*\.git$`)), diff --git a/pkg/resources/java/java_test.go b/pkg/resources/java/java_test.go index c965726..4b4361f 100644 --- a/pkg/resources/java/java_test.go +++ b/pkg/resources/java/java_test.go @@ -29,7 +29,7 @@ func TestAccJava_basic(t *testing.T) { fullName := fmt.Sprintf("clevercloud_java_war.%s", rName) cc := client.New(client.WithAutoOauthConfig()) org := os.Getenv("ORGANISATION") - providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org).String() + providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org) javaBlock := helper.NewRessource( "clevercloud_java_war", rName, @@ -40,7 +40,7 @@ func TestAccJava_basic(t *testing.T) { "max_instance_count": 2, "smallest_flavor": "XS", "biggest_flavor": "M", - })).String() + })) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -52,7 +52,7 @@ func TestAccJava_basic(t *testing.T) { Steps: []resource.TestStep{{ Destroy: false, ResourceName: rName, - Config: providerBlock + javaBlock, + Config: providerBlock.Append(javaBlock).String(), Check: resource.ComposeAggregateTestCheckFunc( resource.TestMatchResourceAttr(fullName, "id", regexp.MustCompile(`^app_.*$`)), resource.TestMatchResourceAttr(fullName, "deploy_url", regexp.MustCompile(`^git\+ssh.*\.git$`)), diff --git a/pkg/resources/keycloak/keycloak_test.go b/pkg/resources/keycloak/keycloak_test.go index afc913d..61a7e1f 100644 --- a/pkg/resources/keycloak/keycloak_test.go +++ b/pkg/resources/keycloak/keycloak_test.go @@ -29,8 +29,12 @@ func TestAccKeycloak_basic(t *testing.T) { fullName := fmt.Sprintf("clevercloud_keycloak.%s", rName) cc := client.New(client.WithAutoOauthConfig()) org := os.Getenv("ORGANISATION") - providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org).String() - materiakvBlock := helper.NewRessource("clevercloud_keycloak", rName, helper.SetKeyValues(map[string]any{"name": rName, "region": "par"})).String() + providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org) + materiakvBlock := helper.NewRessource( + "clevercloud_keycloak", + rName, + helper.SetKeyValues(map[string]any{"name": rName, "region": "par"}), + ) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -55,7 +59,7 @@ func TestAccKeycloak_basic(t *testing.T) { }, Steps: []resource.TestStep{{ ResourceName: rName, - Config: providerBlock + materiakvBlock, + Config: providerBlock.Append(materiakvBlock).String(), Check: resource.ComposeAggregateTestCheckFunc( resource.TestMatchResourceAttr(fullName, "id", regexp.MustCompile(`^keycloak_.*`)), resource.TestMatchResourceAttr(fullName, "host", regexp.MustCompile(`^.*clever-cloud.com$`)), diff --git a/pkg/resources/materiakv/materiakv_test.go b/pkg/resources/materiakv/materiakv_test.go index 4adc960..0647167 100644 --- a/pkg/resources/materiakv/materiakv_test.go +++ b/pkg/resources/materiakv/materiakv_test.go @@ -29,8 +29,8 @@ func TestAccMateriaKV_basic(t *testing.T) { fullName := fmt.Sprintf("clevercloud_materia_kv.%s", rName) cc := client.New(client.WithAutoOauthConfig()) org := os.Getenv("ORGANISATION") - providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org).String() - materiakvBlock := helper.NewRessource("clevercloud_materia_kv", rName, helper.SetKeyValues(map[string]any{"name": rName, "region": "par"})).String() + providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org) + materiakvBlock := helper.NewRessource("clevercloud_materia_kv", rName, helper.SetKeyValues(map[string]any{"name": rName, "region": "par"})) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -58,7 +58,7 @@ func TestAccMateriaKV_basic(t *testing.T) { }, Steps: []resource.TestStep{{ ResourceName: rName, - Config: providerBlock + materiakvBlock, + Config: providerBlock.Append(materiakvBlock).String(), Check: resource.ComposeAggregateTestCheckFunc( resource.TestMatchResourceAttr(fullName, "id", regexp.MustCompile(`^kv_.*`)), resource.TestMatchResourceAttr(fullName, "host", regexp.MustCompile(`^.*clever-cloud.com$`)), diff --git a/pkg/resources/metabase/metabase_test.go b/pkg/resources/metabase/metabase_test.go index d5a29ce..fa6d362 100644 --- a/pkg/resources/metabase/metabase_test.go +++ b/pkg/resources/metabase/metabase_test.go @@ -29,8 +29,12 @@ func TestAccMetabase_basic(t *testing.T) { fullName := fmt.Sprintf("clevercloud_metabase.%s", rName) cc := client.New(client.WithAutoOauthConfig()) org := os.Getenv("ORGANISATION") - providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org).String() - metabaseBlock := helper.NewRessource("clevercloud_metabase", rName, helper.SetKeyValues(map[string]any{"name": rName, "plan": "beta", "region": "par"})).String() + providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org) + metabaseBlock := helper.NewRessource( + "clevercloud_metabase", + rName, + helper.SetKeyValues(map[string]any{"name": rName, "plan": "beta", "region": "par"}), + ) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -58,7 +62,7 @@ func TestAccMetabase_basic(t *testing.T) { }, Steps: []resource.TestStep{{ ResourceName: rName, - Config: providerBlock + metabaseBlock, + Config: providerBlock.Append(metabaseBlock).String(), Check: resource.ComposeAggregateTestCheckFunc( resource.TestMatchResourceAttr(fullName, "id", regexp.MustCompile(`^addon_.*`)), ), diff --git a/pkg/resources/mongodb/mongodb_test.go b/pkg/resources/mongodb/mongodb_test.go index 4a7cb01..313238b 100644 --- a/pkg/resources/mongodb/mongodb_test.go +++ b/pkg/resources/mongodb/mongodb_test.go @@ -28,8 +28,8 @@ func TestAccMongoDB_basic(t *testing.T) { fullName := fmt.Sprintf("clevercloud_mongodb.%s", rName) cc := client.New(client.WithAutoOauthConfig()) org := os.Getenv("ORGANISATION") - providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org).String() - mongodbBlock := helper.NewRessource("clevercloud_mongodb", rName, helper.SetKeyValues(map[string]any{"name": rName, "plan": "xs_med", "region": "par"})).String() + providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org) + mongodbBlock := helper.NewRessource("clevercloud_mongodb", rName, helper.SetKeyValues(map[string]any{"name": rName, "plan": "xs_med", "region": "par"})) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -57,7 +57,7 @@ func TestAccMongoDB_basic(t *testing.T) { }, Steps: []resource.TestStep{{ ResourceName: rName, - Config: providerBlock + mongodbBlock, + Config: providerBlock.Append(mongodbBlock).String(), Check: resource.ComposeAggregateTestCheckFunc( resource.TestMatchResourceAttr(fullName, "id", regexp.MustCompile(`^addon_.*`)), ), @@ -70,8 +70,8 @@ func TestAccMongoDB_RefreshDeleted(t *testing.T) { //fullName := fmt.Sprintf("clevercloud_mongodb.%s", rName) cc := client.New(client.WithAutoOauthConfig()) org := os.Getenv("ORGANISATION") - providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org).String() - mongodbBlock2 := helper.NewRessource("clevercloud_mongodb", rName, helper.SetKeyValues(map[string]any{"name": rName, "plan": "xs_med", "region": "par"})).String() + providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org) + mongodbBlock2 := helper.NewRessource("clevercloud_mongodb", rName, helper.SetKeyValues(map[string]any{"name": rName, "plan": "xs_med", "region": "par"})) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -101,7 +101,7 @@ func TestAccMongoDB_RefreshDeleted(t *testing.T) { // create a database instance on first step { ResourceName: rName, - Config: providerBlock + mongodbBlock2, + Config: providerBlock.Append(mongodbBlock2).String(), }, { ResourceName: rName, diff --git a/pkg/resources/nodejs/nodejs_test.go b/pkg/resources/nodejs/nodejs_test.go index 2a98715..b88577d 100644 --- a/pkg/resources/nodejs/nodejs_test.go +++ b/pkg/resources/nodejs/nodejs_test.go @@ -33,7 +33,7 @@ func TestAccNodejs_basic(t *testing.T) { fullName2 := fmt.Sprintf("clevercloud_nodejs.%s", rName2) cc := client.New(client.WithAutoOauthConfig()) org := os.Getenv("ORGANISATION") - providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org).String() + providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org) nodejsBlock := helper.NewRessource( "clevercloud_nodejs", rName, @@ -51,7 +51,7 @@ func TestAccNodejs_basic(t *testing.T) { "dependencies": []string{}, }), helper.SetBlockValues("hooks", map[string]any{"post_build": "echo \"build is OK!\""}), - ).String() + ) nodejsBlock2 := helper.NewRessource( "clevercloud_nodejs", rName2, @@ -63,7 +63,7 @@ func TestAccNodejs_basic(t *testing.T) { "smallest_flavor": "XS", "biggest_flavor": "M", }), - helper.SetBlockValues("deployment", map[string]any{"repository": "https://github.com/CleverCloud/nodejs-example.git"})).String() + helper.SetBlockValues("deployment", map[string]any{"repository": "https://github.com/CleverCloud/nodejs-example.git"})) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -91,7 +91,7 @@ func TestAccNodejs_basic(t *testing.T) { }, Steps: []resource.TestStep{{ ResourceName: rName, - Config: providerBlock + nodejsBlock, + Config: providerBlock.Append(nodejsBlock).String(), Check: resource.ComposeAggregateTestCheckFunc( // Test the state for provider's populated values resource.TestMatchResourceAttr(fullName, "id", regexp.MustCompile(`^app_.*$`)), @@ -169,7 +169,7 @@ func TestAccNodejs_basic(t *testing.T) { ), }, { ResourceName: rName2, - Config: providerBlock + nodejsBlock2, + Config: providerBlock.Append(nodejsBlock2).String(), Check: func(state *terraform.State) error { id := state.RootModule().Resources[fullName2].Primary.ID diff --git a/pkg/resources/php/crud.go b/pkg/resources/php/crud.go index 461ec2f..95a4d7d 100644 --- a/pkg/resources/php/crud.go +++ b/pkg/resources/php/crud.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-log/tflog" "go.clever-cloud.com/terraform-provider/pkg" "go.clever-cloud.com/terraform-provider/pkg/application" + "go.clever-cloud.com/terraform-provider/pkg/helper" "go.clever-cloud.com/terraform-provider/pkg/provider" "go.clever-cloud.com/terraform-provider/pkg/tmp" ) @@ -34,9 +35,8 @@ func (r *ResourcePHP) Configure(ctx context.Context, req resource.ConfigureReque // Create a new resource func (r *ResourcePHP) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - plan := PHP{} - - resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + tflog.Debug(ctx, "ResourcePHP.Create()") + plan := helper.PlanFrom[PHP](ctx, req.Plan, resp.Diagnostics) if resp.Diagnostics.HasError() { return } @@ -88,10 +88,11 @@ func (r *ResourcePHP) Create(ctx context.Context, req resource.CreateRequest, re return } - tflog.Debug(ctx, "BUILD FLAVOR RES"+createAppRes.Application.BuildFlavor.Name, map[string]interface{}{}) + tflog.Debug(ctx, "BUILD FLAVOR RES", map[string]interface{}{"flavor": createAppRes.Application.BuildFlavor.Name}) plan.ID = pkg.FromStr(createAppRes.Application.ID) plan.DeployURL = pkg.FromStr(createAppRes.Application.DeployURL) plan.VHost = pkg.FromStr(createAppRes.Application.Vhosts[0].Fqdn) + //plan.AdditionalVHosts = createAppRes.Application.Vhosts resp.Diagnostics.Append(resp.State.Set(ctx, plan)...) if resp.Diagnostics.HasError() { @@ -101,9 +102,8 @@ func (r *ResourcePHP) Create(ctx context.Context, req resource.CreateRequest, re // Read resource information func (r *ResourcePHP) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state PHP - - resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + tflog.Debug(ctx, "ResourcePHP.Read()") + state := helper.StateFrom[PHP](ctx, req.State, resp.Diagnostics) if resp.Diagnostics.HasError() { return } @@ -163,11 +163,96 @@ func (r *ResourcePHP) Read(ctx context.Context, req resource.ReadRequest, resp * // Update resource func (r *ResourcePHP) Update(ctx context.Context, req resource.UpdateRequest, res *resource.UpdateResponse) { - // TODO + tflog.Debug(ctx, "ResourcePHP.Update()") + + plan := helper.PlanFrom[PHP](ctx, req.Plan, res.Diagnostics) + if res.Diagnostics.HasError() { + return + } + + state := helper.StateFrom[PHP](ctx, req.State, res.Diagnostics) + if res.Diagnostics.HasError() { + return + } + + instance := application.LookupInstance(ctx, r.cc, "php", "PHP", res.Diagnostics) + if res.Diagnostics.HasError() { + return + } + + environment := plan.toEnv(ctx, res.Diagnostics) + if res.Diagnostics.HasError() { + return + } + + vhosts := []string{} + if res.Diagnostics.Append(plan.AdditionalVHosts.ElementsAs(ctx, &vhosts, false)...); res.Diagnostics.HasError() { + return + } + + updateAppReq := application.UpdateReq{ + ID: state.ID.ValueString(), + Client: r.cc, + Organization: r.org, + Application: tmp.UpdateAppReq{ + Name: plan.Name.ValueString(), + Deploy: "git", + Description: plan.Description.ValueString(), + InstanceType: instance.Type, + InstanceVariant: instance.Variant.ID, + InstanceVersion: instance.Version, + BuildFlavor: plan.BuildFlavor.ValueString(), + MinFlavor: plan.SmallestFlavor.ValueString(), + MaxFlavor: plan.BiggestFlavor.ValueString(), + MinInstances: plan.MinInstanceCount.ValueInt64(), + MaxInstances: plan.MaxInstanceCount.ValueInt64(), + StickySessions: plan.StickySessions.ValueBool(), + ForceHttps: application.FromForceHTTPS(plan.RedirectHTTPS.ValueBool()), + Zone: plan.Region.ValueString(), + CancelOnPush: false, + }, + Environment: environment, + VHosts: vhosts, + Deployment: plan.toDeployment(), + } + + _, diags := application.UpdateApp(ctx, updateAppReq) + res.Diagnostics.Append(diags...) + if res.Diagnostics.HasError() { + return + } + + hasDefaultVHost := pkg.HasSome(updateAppReq.VHosts, func(vhost string) bool { + return pkg.VhostCleverAppsRegExp.MatchString(vhost) + }) + if hasDefaultVHost { + cleverapps := *pkg.First(vhosts, func(vhost string) bool { + return pkg.VhostCleverAppsRegExp.MatchString(vhost) + }) + plan.VHost = pkg.FromStr(cleverapps) + } else { + plan.VHost = types.StringNull() + } + + vhostsWithoutDefault := pkg.Filter(updateAppReq.VHosts, func(vhost string) bool { + ok := pkg.VhostCleverAppsRegExp.MatchString(vhost) + return !ok + }) + if len(vhostsWithoutDefault) > 0 { + plan.AdditionalVHosts = pkg.FromListString(vhostsWithoutDefault) + } else { + plan.AdditionalVHosts = types.ListNull(types.StringType) + } + + res.Diagnostics.Append(res.State.Set(ctx, plan)...) + if res.Diagnostics.HasError() { + return + } } // Delete resource func (r *ResourcePHP) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + tflog.Debug(ctx, "ResourcePHP.Delete()") var state PHP resp.Diagnostics.Append(req.State.Get(ctx, &state)...) @@ -191,6 +276,7 @@ func (r *ResourcePHP) Delete(ctx context.Context, req resource.DeleteRequest, re // Import resource func (r *ResourcePHP) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + tflog.Debug(ctx, "ResourcePHP.ImportState()") // Save the import identifier in the id attribute // and call Read() to fill fields attr := path.Root("id") diff --git a/pkg/resources/php/php_test.go b/pkg/resources/php/php_test.go index cb19d4b..8a9b49f 100644 --- a/pkg/resources/php/php_test.go +++ b/pkg/resources/php/php_test.go @@ -24,12 +24,13 @@ var protoV6Provider = map[string]func() (tfprotov6.ProviderServer, error){ } func TestAccPHP_basic(t *testing.T) { + t.Logf("starting....") ctx := context.Background() rName := fmt.Sprintf("tf-test-php-%d", time.Now().UnixMilli()) fullName := fmt.Sprintf("clevercloud_php.%s", rName) cc := client.New(client.WithAutoOauthConfig()) org := os.Getenv("ORGANISATION") - providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org).String() + providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org) phpBlock := helper.NewRessource( "clevercloud_php", rName, @@ -42,7 +43,7 @@ func TestAccPHP_basic(t *testing.T) { "biggest_flavor": "M", "php_version": "8", "additional_vhosts": [1]string{"toto-tf5283457829345.com"}, - })).String() + })) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -52,14 +53,22 @@ func TestAccPHP_basic(t *testing.T) { }, ProtoV6ProviderFactories: protoV6Provider, Steps: []resource.TestStep{{ - Destroy: false, ResourceName: rName, - Config: providerBlock + phpBlock, + Config: providerBlock.Append(phpBlock).String(), Check: resource.ComposeAggregateTestCheckFunc( resource.TestMatchResourceAttr(fullName, "id", regexp.MustCompile(`^app_.*$`)), resource.TestMatchResourceAttr(fullName, "deploy_url", regexp.MustCompile(`^git\+ssh.*\.git$`)), resource.TestCheckResourceAttr(fullName, "region", "par"), ), + }, { + ResourceName: rName, + Config: providerBlock.Append( + phpBlock.SetOneValue("min_instance_count", 2).SetOneValue("max_instance_count", 6), + ).String(), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(fullName, "min_instance_count", "2"), + resource.TestCheckResourceAttr(fullName, "max_instance_count", "6"), + ), }}, CheckDestroy: func(state *terraform.State) error { for _, resource := range state.RootModule().Resources { diff --git a/pkg/resources/postgresql/postgresql_test.go b/pkg/resources/postgresql/postgresql_test.go index df081c9..c8a0d31 100644 --- a/pkg/resources/postgresql/postgresql_test.go +++ b/pkg/resources/postgresql/postgresql_test.go @@ -28,7 +28,7 @@ func TestAccPostgreSQL_basic(t *testing.T) { fullName := fmt.Sprintf("clevercloud_postgresql.%s", rName) cc := client.New(client.WithAutoOauthConfig()) org := os.Getenv("ORGANISATION") - providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org).String() + providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org) postgresqlBlock := helper.NewRessource( "clevercloud_postgresql", rName, @@ -36,7 +36,7 @@ func TestAccPostgreSQL_basic(t *testing.T) { "name": rName, "region": "par", "plan": "dev", - })).String() + })) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -64,7 +64,7 @@ func TestAccPostgreSQL_basic(t *testing.T) { }, Steps: []resource.TestStep{{ ResourceName: rName, - Config: providerBlock + postgresqlBlock, + Config: providerBlock.Append(postgresqlBlock).String(), Check: resource.ComposeAggregateTestCheckFunc( resource.TestMatchResourceAttr(fullName, "id", regexp.MustCompile(`^addon_.*`)), resource.TestMatchResourceAttr(fullName, "host", regexp.MustCompile(`^.*-postgresql\.services\.clever-cloud\.com$`)), @@ -82,7 +82,7 @@ func TestAccPostgreSQL_RefreshDeleted(t *testing.T) { //fullName := fmt.Sprintf("clevercloud_postgresql.%s", rName) cc := client.New(client.WithAutoOauthConfig()) org := os.Getenv("ORGANISATION") - providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org).String() + providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org) postgresqlBlock := helper.NewRessource( "clevercloud_postgresql", rName, @@ -90,7 +90,7 @@ func TestAccPostgreSQL_RefreshDeleted(t *testing.T) { "name": rName, "region": "par", "plan": "dev", - })).String() + })) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -120,7 +120,7 @@ func TestAccPostgreSQL_RefreshDeleted(t *testing.T) { // create a database instance on first step { ResourceName: rName, - Config: providerBlock + postgresqlBlock, + Config: providerBlock.Append(postgresqlBlock).String(), }, { ResourceName: rName, diff --git a/pkg/resources/scala/scala_test.go b/pkg/resources/scala/scala_test.go index 4d4bb44..c2c0acf 100644 --- a/pkg/resources/scala/scala_test.go +++ b/pkg/resources/scala/scala_test.go @@ -29,7 +29,7 @@ func TestAccScala_basic(t *testing.T) { fullName := fmt.Sprintf("clevercloud_scala.%s", rName) cc := client.New(client.WithAutoOauthConfig()) org := os.Getenv("ORGANISATION") - providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org).String() + providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org) scalaBlock := helper.NewRessource( "clevercloud_scala", rName, @@ -40,7 +40,7 @@ func TestAccScala_basic(t *testing.T) { "max_instance_count": 2, "smallest_flavor": "XS", "biggest_flavor": "M", - })).String() + })) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -52,7 +52,7 @@ func TestAccScala_basic(t *testing.T) { Steps: []resource.TestStep{{ Destroy: false, ResourceName: rName, - Config: providerBlock + scalaBlock, + Config: providerBlock.Append(scalaBlock).String(), Check: resource.ComposeAggregateTestCheckFunc( resource.TestMatchResourceAttr(fullName, "id", regexp.MustCompile(`^app_.*$`)), resource.TestMatchResourceAttr(fullName, "deploy_url", regexp.MustCompile(`^git\+ssh.*\.git$`)), diff --git a/pkg/resources/static/static_test.go b/pkg/resources/static/static_test.go index 10e4d81..53ff441 100644 --- a/pkg/resources/static/static_test.go +++ b/pkg/resources/static/static_test.go @@ -29,7 +29,7 @@ func TestAccStatic_basic(t *testing.T) { fullName := fmt.Sprintf("clevercloud_static.%s", rName) cc := client.New(client.WithAutoOauthConfig()) org := os.Getenv("ORGANISATION") - providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org).String() + providerBlock := helper.NewProvider("clevercloud").SetOrganisation(org) staticBlock := helper.NewRessource( "clevercloud_static", rName, @@ -40,7 +40,7 @@ func TestAccStatic_basic(t *testing.T) { "max_instance_count": 2, "smallest_flavor": "XS", "biggest_flavor": "M", - })).String() + })) resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -52,7 +52,7 @@ func TestAccStatic_basic(t *testing.T) { Steps: []resource.TestStep{{ Destroy: false, ResourceName: rName, - Config: providerBlock + staticBlock, + Config: providerBlock.Append(staticBlock).String(), Check: resource.ComposeAggregateTestCheckFunc( resource.TestMatchResourceAttr(fullName, "id", regexp.MustCompile(`^app_.*$`)), resource.TestMatchResourceAttr(fullName, "deploy_url", regexp.MustCompile(`^git\+ssh.*\.git$`)), diff --git a/pkg/tmp/app.go b/pkg/tmp/app.go index 2cead5e..63f6050 100644 --- a/pkg/tmp/app.go +++ b/pkg/tmp/app.go @@ -213,15 +213,21 @@ func GetProductInstance(ctx context.Context, cc *client.Client) client.Response[ } type UpdateAppReq struct { - CancelOnPush bool `json:"cancelOnPush"` - Description string `json:"description"` - ForceHTTPS string `json:"forceHttps"` - Homogeneous bool `json:"homogeneous"` - AppID string `json:"id"` - Name string `json:"name"` - SeparateBuild bool `json:"separateBuild"` - StickySessions bool `json:"stickySessions"` - Zone string `json:"zone"` + Name string `json:"name" example:"SOME_NAME"` + Deploy string `json:"deploy" example:"git"` + Description string `json:"description" example:"SOME_DESC"` + InstanceType string `json:"instanceType" example:"node"` + InstanceVariant string `json:"instanceVariant" example:"395103fb-d6e2-4fdd-93bc-bc99146f1ea2"` + InstanceVersion string `json:"instanceVersion" example:"20220330"` + MinFlavor string `json:"minFlavor" example:"pico"` + MaxFlavor string `json:"maxFlavor" example:"M"` + BuildFlavor string `json:"buildFlavor" example:"XL"` + MinInstances int64 `json:"minInstances" example:"1"` + MaxInstances int64 `json:"maxInstances" example:"4"` + Zone string `json:"zone" example:"par"` + CancelOnPush bool `json:"cancelOnPush"` + StickySessions bool `json:"stickySessions"` + ForceHttps string `json:"forceHttps"` } func UpdateApp(ctx context.Context, cc *client.Client, organisationID, applicationID string, req UpdateAppReq) client.Response[CreatAppResponse] { From bac736b963d91cbcffbd009fb85af7e169f38f7d Mon Sep 17 00:00:00 2001 From: miton18 Date: Thu, 26 Dec 2024 16:02:13 +0100 Subject: [PATCH 3/3] build(goreleaser): fix config version Fix #95 --- .github/workflows/doc_sync.yml | 4 ++-- .goreleaser.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/doc_sync.yml b/.github/workflows/doc_sync.yml index a58b92f..8ddf741 100644 --- a/.github/workflows/doc_sync.yml +++ b/.github/workflows/doc_sync.yml @@ -9,7 +9,7 @@ on: - master workflow_dispatch: -permissions: +permissions: contents: read jobs: @@ -22,7 +22,7 @@ jobs: - name: sets up go environnement uses: actions/setup-go@v4 with: - go-version: '1.21' + go-version: '1.22' - name: Get dependencies run: go mod download - name: Install tfplugindocs diff --git a/.goreleaser.yml b/.goreleaser.yml index f16c23d..16be86c 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,5 +1,6 @@ # Visit https://goreleaser.com for documentation on how to customize this # behavior. +version: 2 before: hooks: # this is just an example and not a requirement for provider building/publishing